Skip to content

[ColorSync] Convert color values to semantic tokens in label-image#3435

Merged
Myranae merged 25 commits intomainfrom
tb/testing-font-color-conversion
Apr 29, 2026
Merged

[ColorSync] Convert color values to semantic tokens in label-image#3435
Myranae merged 25 commits intomainfrom
tb/testing-font-color-conversion

Conversation

@Myranae
Copy link
Copy Markdown
Contributor

@Myranae Myranae commented Mar 31, 2026

Summary:

As the first step of our reignited Color Sync project, we're converting label image's color values to semantic tokens.

  • Replaced three hardcoded hex colors (#00880b, #ECF3FE) and one rgba value (rgba(33, 36, 44, 0.32)) in answer-pill.tsx, marker.tsx, and label-image.tsx with semantic tokens from @khanacademy/wonder-blocks-tokens
  • Added Chromatic visual regression stories (label-image-initial-state-regression.stories.tsx and label-image-interactions-regression.stories.tsx) to establish a baseline before conversion and capture diffs after.

Issue: LEMS-3994

Test plan:

  • Chromatic diffs for the color changes have been reviewed and approved against the regression story baseline
  • pnpm lint, pnpm tsc, and pnpm test all pass
  • Storybook play functions verified: all interaction stories (MarkerOpened, AnswerSelected, CorrectAnswerGraded, IncorrectAnswerWithPill, MathChoicesVisible) complete without errors — Interactions tab shows green checkmarks
  • Visual states confirmed in Storybook:
    • Unanswered: marker pulsates, no selection
    • Answer selected: marker filled (solid blue, instructive.default)
    • Correct graded: marker and pill render green (success.strong)
    • Incorrect: marker and pill render neutral gray (neutral.default)
    • Instructions with choices: separator dots visible between choice items

@Myranae Myranae self-assigned this Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

🛠️ Item Splitting: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

Size Change: 0 B

Total Size: 502 kB

ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.6 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 6.36 kB
packages/math-input/dist/es/index.js 98.5 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 12 kB
packages/perseus-core/dist/es/index.js 25.4 kB
packages/perseus-editor/dist/es/index.js 103 kB
packages/perseus-linter/dist/es/index.js 9.42 kB
packages/perseus-score/dist/es/index.js 9.78 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/index.js 198 kB
packages/perseus/dist/es/strings.js 8.46 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

npm Snapshot: Published

Good news!! We've packaged up the latest commit from this PR (92c05a3) and published it to npm. You
can install it using the tag PR3435.

Example:

pnpm add @khanacademy/perseus@PR3435

If you are working in Khan Academy's frontend, you can run the below command.

./dev/tools/bump_perseus_version.ts -t PR3435

If you are working in Khan Academy's webapp, you can run the below command.

./dev/tools/bump_perseus_version.js -t PR3435

Myranae added 14 commits March 31, 2026 10:24
Though these colors are not touched during this conversion, we still want regression stories that cover all states of the widget
…n vs figma color

The Figma design was based on using only one point in all the widgets, so it is the interactive graph point. This project does not have a redesign goal, so the Figma does not reflect how the widget should look.
@Myranae Myranae requested a review from mark-fitzgerald April 1, 2026 16:41
@Myranae Myranae changed the title [WIP] Convert color values to semantic tokens in label-image [ColorSync] Convert color values to semantic tokens in label-image Apr 1, 2026
@Myranae Myranae marked this pull request as ready for review April 1, 2026 21:22
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@Myranae
Copy link
Copy Markdown
Contributor Author

Myranae commented Apr 1, 2026

@claude review once

Comment thread packages/perseus/src/widgets/label-image/label-image.tsx
Comment thread .changeset/nervous-moons-roll.md Outdated
Copy link
Copy Markdown
Contributor

@mark-fitzgerald mark-fitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. You may want to wait to merge until after Nisha's update to the Storybook template is available, and use it to verify the tests are structured properly.

@Myranae Myranae merged commit dee6ce6 into main Apr 29, 2026
11 checks passed
@Myranae Myranae deleted the tb/testing-font-color-conversion branch April 29, 2026 19:58
jeremywiebe pushed a commit that referenced this pull request May 4, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.


# Releases
## @khanacademy/perseus-core@26.0.0

### Major Changes

-   [#3517](#3517) [`957970dfdb`](957970d) Thanks [@benchristel](https://github.com/benchristel)! - Breaking change: The deprecated `violatingWidgets` function has been removed. Callers should use `isItemAccessible` instead. `isItemAccessible` now checks for inaccessible widgets in hints as well as question content.

### Patch Changes

-   [#3415](#3415) [`e21c523f5d`](e21c523) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Removing Interactive Graph Builder and refactoring tests/storybook to use more standardized generator patterns.

## @khanacademy/perseus-editor@31.0.0

### Major Changes

-   [#3568](#3568) [`896e869ef5`](896e869) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove unused `paths` field from `LinterContextProps` and the corresponding `contentPaths` prop from `EditorPage`, `ArticleEditor`, and `HintEditor`. The field was never read by any linter rule or renderer.

### Minor Changes

-   [#3532](#3532) [`3263332fe2`](3263332) Thanks [@benchristel](https://github.com/benchristel)! - The issue panels in the article editor now show only issues for their associated article section. Previously, each panel showed the full set of issues for the entire article.

### Patch Changes

-   [#3543](#3543) [`51ebddf119`](51ebddf) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Refactoring Start Coords for efficiency


-   [#3415](#3415) [`e21c523f5d`](e21c523) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Removing Interactive Graph Builder and refactoring tests/storybook to use more standardized generator patterns.


-   [#3538](#3538) [`8b95cdf6e3`](8b95cdf) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add Storybook MCP addon for AI-assisted UI development

-   Updated dependencies \[[`494f287541`](494f287), [`743ad9d5f4`](743ad9d), [`0bf97ee3b6`](0bf97ee), [`957970dfdb`](957970d), [`e21c523f5d`](e21c523), [`e5ddaef207`](e5ddaef), [`ce83363534`](ce83363), [`dee6ce680c`](dee6ce6), [`896e869ef5`](896e869), [`cf5147d61c`](cf5147d), [`afc4f33090`](afc4f33), [`8b95cdf6e3`](8b95cdf), [`1dbd5742dc`](1dbd574)]:
    -   @khanacademy/perseus@77.3.2
    -   @khanacademy/perseus-core@26.0.0
    -   @khanacademy/perseus-linter@5.0.0
    -   @khanacademy/kmath@2.4.3
    -   @khanacademy/math-input@26.4.17
    -   @khanacademy/keypad-context@3.2.45
    -   @khanacademy/perseus-score@8.7.1

## @khanacademy/perseus-linter@5.0.0

### Major Changes

-   [#3568](#3568) [`896e869ef5`](896e869) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove unused `paths` field from `LinterContextProps` and the corresponding `contentPaths` prop from `EditorPage`, `ArticleEditor`, and `HintEditor`. The field was never read by any linter rule or renderer.

### Patch Changes

-   Updated dependencies \[[`957970dfdb`](957970d), [`e21c523f5d`](e21c523), [`cf5147d61c`](cf5147d)]:
    -   @khanacademy/perseus-core@26.0.0
    -   @khanacademy/kmath@2.4.3

## @khanacademy/keypad-context@3.2.45

### Patch Changes

-   Updated dependencies \[[`957970dfdb`](957970d), [`e21c523f5d`](e21c523)]:
    -   @khanacademy/perseus-core@26.0.0

## @khanacademy/kmath@2.4.3

### Patch Changes

-   [#3534](#3534) [`cf5147d61c`](cf5147d) Thanks [@marnikostman](https://github.com/marnikostman)! - Remove `underscore` and `jquery` as peer and dev dependencies. All usages have been replaced with native JavaScript equivalents.

-   Updated dependencies \[[`957970dfdb`](957970d), [`e21c523f5d`](e21c523)]:
    -   @khanacademy/perseus-core@26.0.0

## @khanacademy/math-input@26.4.17

### Patch Changes

-   [#3572](#3572) [`afc4f33090`](afc4f33) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Bumped deps

-   Updated dependencies \[[`957970dfdb`](957970d), [`e21c523f5d`](e21c523)]:
    -   @khanacademy/perseus-core@26.0.0
    -   @khanacademy/keypad-context@3.2.45

## @khanacademy/perseus@77.3.2

### Patch Changes

-   [#3293](#3293) [`494f287541`](494f287) Thanks [@benchristel](https://github.com/benchristel)! - Internal: remove unused default value for polygon graph point coordinates


-   [#3539](#3539) [`743ad9d5f4`](743ad9d) Thanks [@mark-fitzgerald](https://github.com/mark-fitzgerald)! - [Radio] Adjust styling to resolve an axe-core incomplete test result


-   [#3506](#3506) [`0bf97ee3b6`](0bf97ee) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (DX) | Add delay to flakey Graphie image regression test


-   [#3415](#3415) [`e21c523f5d`](e21c523) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Removing Interactive Graph Builder and refactoring tests/storybook to use more standardized generator patterns.


-   [#3521](#3521) [`e5ddaef207`](e5ddaef) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Allow the asymptote to be placed between points. Also allow for points to be on asymptote line so long as they don't overlap with the drag handle.


-   [#3567](#3567) [`ce83363534`](ce83363) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Fix interactive graph x-axis label overlapping with content below when y-range starts at 0 or higher


-   [#3435](#3435) [`dee6ce680c`](dee6ce6) Thanks [@Myranae](https://github.com/Myranae)! - Convert hardcoded color values to semantic tokens for label image


-   [#3538](#3538) [`8b95cdf6e3`](8b95cdf) Thanks [@ivyolamit](https://github.com/ivyolamit)! - Add Storybook MCP addon for AI-assisted UI development


-   [#3524](#3524) [`1dbd5742dc`](1dbd574) Thanks [@SonicScrewdriver](https://github.com/SonicScrewdriver)! - Ensure that Ray and Linear points cannot overlap

-   Updated dependencies \[[`957970dfdb`](957970d), [`e21c523f5d`](e21c523), [`896e869ef5`](896e869), [`cf5147d61c`](cf5147d), [`afc4f33090`](afc4f33)]:
    -   @khanacademy/perseus-core@26.0.0
    -   @khanacademy/perseus-linter@5.0.0
    -   @khanacademy/kmath@2.4.3
    -   @khanacademy/math-input@26.4.17
    -   @khanacademy/keypad-context@3.2.45
    -   @khanacademy/perseus-score@8.7.1

## @khanacademy/perseus-score@8.7.1

### Patch Changes

-   Updated dependencies \[[`957970dfdb`](957970d), [`e21c523f5d`](e21c523), [`cf5147d61c`](cf5147d)]:
    -   @khanacademy/perseus-core@26.0.0
    -   @khanacademy/kmath@2.4.3


Issue: LEMS-4090

Author: khan-actions-bot

Reviewers: claude[bot], jeremywiebe

Required Reviewers:

Approved By: jeremywiebe

Checks:

Pull Request URL: #3533
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants