[Image] | (UX) | Don't upscale images within explore modal if size is unknown#3413
Merged
[Image] | (UX) | Don't upscale images within explore modal if size is unknown#3413
Conversation
Contributor
🗄️ Schema Change: No Changes ✅ |
Contributor
|
Size Change: +14 B (0%) Total Size: 494 kB
ℹ️ View Unchanged
|
Contributor
🛠️ Item Splitting: No Changes ✅ |
Contributor
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (97b12b2) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3413If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3413If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3413 |
…upscale images within explore modal if size is unknown
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.
Tip: disable this comment in your organization's Code Review settings.
catandthemachines
approved these changes
Mar 30, 2026
Member
catandthemachines
left a comment
There was a problem hiding this comment.
Yay! Thanks for this fix!
Merged
anakaren-rojas
pushed a commit
that referenced
this pull request
Mar 31, 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/[email protected] ### Patch Changes - [#3429](#3429) [`41bea5fd10`](41bea5f) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Stop large images from overflowing - [#3413](#3413) [`06ac0a160d`](06ac0a1) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Don't upscale images within explore modal if size is unknown - [#3426](#3426) [`dae8b1d931`](dae8b1d) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (a11y) | Update zoom view SRUX ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`41bea5fd10`](41bea5f), [`06ac0a160d`](06ac0a1), [`dae8b1d931`](dae8b1d)]: - @khanacademy/[email protected] Author: khan-actions-bot Reviewers: claude[bot], anakaren-rojas Required Reviewers: Approved By: anakaren-rojas Checks: ⏭️ 2 checks have been skipped, ✅ 6 checks were successful Pull Request URL: #3430
catandthemachines
pushed a commit
that referenced
this pull request
Apr 1, 2026
… unknown (#3413) ## Summary: Behind our `image-widget-upgrade-scale` feature flag, if an image is an SVG, it gets scaled up at least 2x. In the case that the SVG was saved without an image, this makes the image become too big and expand beyond the size of the modal. (In the case that we do know the size of the image, this is accounted for when we divide by the scale in the `height` calculation.) Fixing this by using `scale=1` for all cases in which the size in unknown. Issue: [LEMS-4012](https://khanacademy.atlassian.net/browse/LEMS-4012) ## Test plan: Storybook - `/?path=/story/widgets-image-widget-demo--large-svg-image-with-no-size-saved-scale-flag` - Regression test (no flag, but will be useful when we remove flag): `/?path=/story/widgets-image-visual-regression-tests-interactions--long-description-clicked-state-with-no-size-large-svg-image` | Before | After | | --- | --- | | <img width="1723" height="773" alt="Screenshot 2026-03-26 at 1 09 08 PM" src="https://github.com/user-attachments/assets/fad80bba-8749-41f1-9300-461bc25f171b" /> | <img width="1398" height="718" alt="Screenshot 2026-03-26 at 1 18 34 PM" src="https://github.com/user-attachments/assets/5734bfc0-1464-42d5-b6de-0bfd56a5d04e" /> | [LEMS-4012]: https://khanacademy.atlassian.net/browse/LEMS-4012?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Author: nishasy Reviewers: claude[bot], catandthemachines, ivyolamit Required Reviewers: Approved By: catandthemachines Checks: ⏭️ 1 check has been skipped, ✅ 10 checks were successful Pull Request URL: #3413
catandthemachines
pushed a commit
that referenced
this pull request
Apr 1, 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/[email protected] ### Patch Changes - [#3429](#3429) [`41bea5fd10`](41bea5f) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Stop large images from overflowing - [#3413](#3413) [`06ac0a160d`](06ac0a1) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (UX) | Don't upscale images within explore modal if size is unknown - [#3426](#3426) [`dae8b1d931`](dae8b1d) Thanks [@nishasy](https://github.com/nishasy)! - [Image] | (a11y) | Update zoom view SRUX ## @khanacademy/[email protected] ### Patch Changes - Updated dependencies \[[`41bea5fd10`](41bea5f), [`06ac0a160d`](06ac0a1), [`dae8b1d931`](dae8b1d)]: - @khanacademy/[email protected] Author: khan-actions-bot Reviewers: claude[bot], anakaren-rojas Required Reviewers: Approved By: anakaren-rojas Checks: ⏭️ 2 checks have been skipped, ✅ 6 checks were successful Pull Request URL: #3430
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary:
Behind our
image-widget-upgrade-scalefeature flag, if an image is an SVG, it gets scaled up at least 2x. In the case that the SVG was saved without an image, this makes the image become too big and expand beyond the size of the modal. (In the case that we do know the size of the image, this is accounted for when we divide by the scale in theheightcalculation.)Fixing this by using
scale=1for all cases in which the size in unknown.Issue: LEMS-4012
Test plan:
Storybook
/?path=/story/widgets-image-widget-demo--large-svg-image-with-no-size-saved-scale-flag/?path=/story/widgets-image-visual-regression-tests-interactions--long-description-clicked-state-with-no-size-large-svg-image