-
Notifications
You must be signed in to change notification settings - Fork 369
[ColorSync][math-input] Convert math-input font and colors to semantic tokens #3744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Myranae
wants to merge
13
commits into
main
Choose a base branch
from
tb/LEMS-4244/math-input-color-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e5cf48d
[tb/LEMS-4244/math-input-color-sync] Add math input related visual re…
Myranae 791e802
[tb/LEMS-4244/math-input-color-sync] Add artifacts to git ignore for now
Myranae ae8a6c5
[tb/LEMS-4244/math-input-color-sync] Merge branch 'main' into tb/LEMS…
Myranae f6c55fa
[tb/LEMS-4244/math-input-color-sync] Convert hard coded font info to …
Myranae c5f4869
[tb/LEMS-4244/math-input-color-sync] Merge branch 'main' into tb/LEMS…
Myranae 0f03965
[tb/LEMS-4244/math-input-color-sync] Fix flaky expression story
Myranae bcec41c
[tb/LEMS-4244/math-input-color-sync] Convert colors and update snapshots
Myranae dcc7cb3
[tb/LEMS-4244/math-input-color-sync] Merge branch 'main' into tb/LEMS…
Myranae 215e81d
[tb/LEMS-4244/math-input-color-sync] Convert rgba color to token
Myranae f3464d3
[tb/LEMS-4244/math-input-color-sync] docs(changeset): Convert hardcod…
Myranae 955c4d7
[tb/LEMS-4244/math-input-color-sync] Update comments and missed color
Myranae b774327
[tb/LEMS-4244/math-input-color-sync] Update one more comment
Myranae 895a39c
[tb/LEMS-4244/math-input-color-sync] Removes PR specific comments
Myranae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@khanacademy/math-input": patch | ||
| "@khanacademy/perseus": patch | ||
| --- | ||
|
|
||
| Convert hardcoded colors and fonts in math-input components to semantic tokens (cursor-handle, keypad-button, navigation-button) |
47 changes: 47 additions & 0 deletions
47
packages/math-input/src/__docs__/math-input-initial-state-regression.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import * as React from "react"; | ||
|
|
||
| import {themeModes} from "../../../../.storybook/modes"; | ||
| import CursorHandle from "../components/input/cursor-handle"; | ||
|
|
||
| import type {Meta, StoryObj} from "@storybook/react-vite"; | ||
|
|
||
| const meta: Meta<typeof CursorHandle> = { | ||
| title: "Math Input/Components/Visual Regression Tests/Initial State", | ||
| component: CursorHandle, | ||
| tags: ["!autodocs", "!manifest"], | ||
| parameters: { | ||
| docs: { | ||
| description: { | ||
| component: | ||
| "Regression tests for math-input components that do NOT " + | ||
| "need any interactions to test.", | ||
| }, | ||
| }, | ||
| chromatic: {disableSnapshot: false, modes: themeModes}, | ||
| }, | ||
| }; | ||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof CursorHandle>; | ||
|
|
||
| // This component is touch-only in production and never reached via mouse | ||
| // interactions, so it is tested here in isolation. | ||
| export const CursorHandleVisible: Story = { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think I see this in the UI Tests check on your PR? |
||
| decorators: [ | ||
| (Story) => ( | ||
| <div style={{position: "relative", height: 100, width: 100}}> | ||
| <Story /> | ||
| </div> | ||
| ), | ||
| ], | ||
| args: { | ||
| x: 50, | ||
| y: 20, | ||
| animateIntoPosition: false, | ||
| visible: true, | ||
| onTouchStart: () => {}, | ||
| onTouchMove: () => {}, | ||
| onTouchEnd: () => {}, | ||
| onTouchCancel: () => {}, | ||
| }, | ||
| }; | ||
47 changes: 47 additions & 0 deletions
47
packages/math-input/src/__docs__/math-input-interactions-regression.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import * as React from "react"; | ||
| import {action} from "storybook/actions"; | ||
|
|
||
| import {themeModes} from "../../../../.storybook/modes"; | ||
| import NavigationPad from "../components/keypad/navigation-pad"; | ||
|
|
||
| import TintedBackgroundDecorator from "./tinted-background-decorator"; | ||
|
|
||
| import type {Meta, StoryObj} from "@storybook/react-vite"; | ||
|
|
||
| const meta: Meta<typeof NavigationPad> = { | ||
| title: "Math Input/Components/Visual Regression Tests/Interactions", | ||
| component: NavigationPad, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment here but for |
||
| tags: ["!autodocs", "!manifest"], | ||
| parameters: { | ||
| docs: { | ||
| description: { | ||
| component: | ||
| "Regression tests for math-input components that DO need " + | ||
| "interactions to test.", | ||
| }, | ||
| }, | ||
| chromatic: {disableSnapshot: false, modes: themeModes}, | ||
| }, | ||
| decorators: [ | ||
| (Story) => ( | ||
| <div style={{padding: 50}}> | ||
| <Story /> | ||
| </div> | ||
| ), | ||
| TintedBackgroundDecorator, | ||
| ], | ||
| args: { | ||
| onClickKey: action("onClickKey"), | ||
| }, | ||
| }; | ||
| export default meta; | ||
|
|
||
| type Story = StoryObj<typeof NavigationPad>; | ||
|
|
||
| // NavigationPad renders inline (not a portal) so canvas queries work directly. | ||
| export const NavigationButtonPressed: Story = { | ||
| play: async ({canvas, userEvent}) => { | ||
| const button = canvas.getByRole("button", {name: "Left arrow"}); | ||
| await userEvent.pointer({target: button, keys: "[MouseLeft>]"}); | ||
| }, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this still be considered general math input initial state regression story if the main component being tested is CursorHandle? I almost feel like this should be
cursor-handle-regression.stories.tsxinstead?