Skip to content

Convert Matcher widget to semantic color tokens#3550

Draft
Myranae wants to merge 4 commits intomainfrom
claude/matcher-widget-font-color-h5Uhd
Draft

Convert Matcher widget to semantic color tokens#3550
Myranae wants to merge 4 commits intomainfrom
claude/matcher-widget-font-color-h5Uhd

Conversation

@Myranae
Copy link
Copy Markdown
Contributor

@Myranae Myranae commented May 1, 2026

Summary

Converts the Matcher widget's hardcoded border color to use semantic tokens from the Wonder Blocks design system, completing the font and color tokenization workflow for this widget.

Changes Made

  • Color tokenization: Replaced hardcoded #444 border color with semanticColor.core.border.neutral.strong from @khanacademy/wonder-blocks-tokens

    • Affects both the vertical column separator (columnRight.borderLeft) and horizontal label row bottom border (columnLabel.borderBottom)
    • Added semanticColor import to matcher.tsx
  • Regression test coverage: Created comprehensive visual regression stories to verify the widget renders correctly across all visual states

    • Initial state stories: WithLabels, WithoutLabels, WithTexContent, OrderMatters, RightToLeft
    • Interaction story: GradedState (verifies appearance after "Check answer" is clicked)
    • Created matcher-renderer-decorator.tsx to support story rendering with ServerItemRendererWithDebugUI
  • Font audit: Confirmed no font tokenization needed—the single font attribute (fontWeight: "inherit") is explicitly excluded from tokenization per conversion rules

  • Test snapshots: Updated 3 snapshots to reflect the new semantic color token value

Implementation Details

  • The #444 color was the only hardcoded color value in the widget
  • No Figma design exists for the Matcher widget, so the conversion used the semantic color mapping table
  • semanticColor.core.border.neutral.strong was selected as the closest semantic match for the original darker neutral border color
  • All ESLint, TypeScript, and Jest checks pass

https://claude.ai/code/session_01PkuvVE7SdJREHt57CcRewe

Myranae and others added 3 commits May 1, 2026 09:56
Replaces hardcoded `#444` border color with `semanticColor.core.border.neutral.strong`
in the Matcher widget. Adds Chromatic regression stories (initial state + interactions)
to establish a visual baseline before and after the conversion.

https://claude.ai/code/session_01PkuvVE7SdJREHt57CcRewe
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🗄️ Schema Change: No Changes ✅

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

Size Change: +2 B (0%)

Total Size: 502 kB

📦 View Changed
Filename Size Change
packages/perseus/dist/es/index.js 198 kB +2 B (0%)
ℹ️ 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.5 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/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 May 1, 2026

npm Snapshot: Published

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

Example:

pnpm add @khanacademy/perseus@PR3550

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

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

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

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

🛠️ Item Splitting: No Changes ✅

Reorders sections into ascending numerical order as requested.

https://claude.ai/code/session_01PkuvVE7SdJREHt57CcRewe
@Myranae Myranae changed the base branch from tb/LEMS-3501/matcher-colorsync to main May 1, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants