Skip to content

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

Open
Myranae wants to merge 22 commits intomainfrom
tb/testing-font-color-conversion
Open

[ColorSync] Convert color values to semantic tokens in label-image#3435
Myranae wants to merge 22 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: +33 B (+0.01%)

Total Size: 497 kB

📦 View Changed
Filename Size Change
packages/perseus-core/dist/es/index.js 25.2 kB +42 B (+0.17%)
packages/perseus/dist/es/index.js 194 kB -9 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.5 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 11.9 kB
packages/perseus-editor/dist/es/index.js 102 kB
packages/perseus-linter/dist/es/index.js 9.3 kB
packages/perseus-score/dist/es/index.js 9.7 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/strings.js 8.27 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 (840cd30) 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

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.

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