[Image] | (DX) | Recheck height in Graphie to stop font position flakiness#3506
[Image] | (DX) | Recheck height in Graphie to stop font position flakiness#3506
Conversation
…e regression test The `ZoomClickedWithGraphieImage` regression story keeps being reported by Chromatic as having a ~2px difference from base. This seems to be happening due to a timing issue. Adding a delay to see if it stops getting flagged by Chromatic. Issue: https://khanacademy.atlassian.net/browse/LEMS-4053 Test plan: Wait and see if anything gets reported in this PR. Continue monitoring after.
…akey Graphie image regression test
🗄️ Schema Change: No Changes ✅ |
|
Size Change: -220 B (-0.04%) Total Size: 502 kB 📦 View Changed
ℹ️ View Unchanged
|
🛠️ Item Splitting: No Changes ✅ |
There was a problem hiding this comment.
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.
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (99b3efb) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3506If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3506If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3506 |
mark-fitzgerald
left a comment
There was a problem hiding this comment.
Fingers crossed.
|
Trying something new here. This is what Claude came up with after I started a new session and mentioned that the explore image modal story wasn't flakey like the zoom view one was.
Edit: That didn't work |
…roach with an explicit isFirstCall check, and move originalLabelSize storage to after line-height: normal so it always captures the corrected height.
There was a problem hiding this comment.
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.
| // then the height used for calculations should be updated. | ||
| // This can happen when the first label in the container calls this method, | ||
| // and the line-height was different when the height measurement was originally referenced. | ||
| if (currentHeightMatchesProps && span.scrollHeight !== height) { |
There was a problem hiding this comment.
I'm having trouble seeing how this situation (line-height affecting the height) is handled by the new conditional involving just the "originnalLabelSize" data attribute, below. Can you verify the timing of this?
There was a problem hiding this comment.
It looks like in the main code, the height gets set to the scroll height only if a change in the scroll height is detected. In the new code, the height gets set to the scroll height always on the first run. The timing on the two should be the same.
mark-fitzgerald
left a comment
There was a problem hiding this comment.
Graphie is always tricky. Thanks for diving into these anomalies.
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

Summary:
The
ZoomClickedWithGraphieImageregression story keeps being reported by Chromatic ashaving a ~2px difference from base.
In this PR, we're rechecking the height after the line height is corrected to make sure we're using the appropriate height for the Graphie labels.
Explanation from Claude:
Issue: https://khanacademy.atlassian.net/browse/LEMS-4053
Test plan:
Wait and see if anything gets reported in this PR. Continue monitoring after.