Put the left and right sides of the editor in separate scroll areas.#3832
Conversation
|
Size Change: -12 B (0%) Total Size: 517 kB 📦 View Changed
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (b748a73) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3832If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3832If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3832 |
…ok more like the original width
There was a problem hiding this comment.
These overflows were causing nested scroll bars within the preview iframe.
|
I noticed that the new styling sort of broke this in the Article editor, so I made sure to update that. Can anyone think of other editors that I need to double check before finalizing this? |
|
Posting the before/after here instead of the description because I don't want the checks to rerun: BeforeScreen.Recording.2026-06-25.at.3.25.19.PM.movAfterScreen.Recording.2026-06-25.at.3.25.47.PM.mov |
| table-layout: fixed; | ||
| } | ||
| .perseus-editor-row { | ||
| display: table-row; |
There was a problem hiding this comment.
Since you are removing the table-based styling for the row and cell, you should also remove the display: table for the .perseus-editor-table container.
| // Set the overflow to hidden on the body within the iframe | ||
| // to prevent nested scrollbars from appearing. | ||
| React.useEffect(() => { | ||
| document.body.style.overflow = "hidden"; |
There was a problem hiding this comment.
I'm not really thrilled with setting the <body> of the iFrame to overflow: hidden. I think that the container <div> shouldn't have the scroll, but that the internal document within the iframe should be the scrollable item. However, I think we can put that on a different PR (especially if we can get away from using an iFrame). So, I'm good with keeping this as-is for now.
There was a problem hiding this comment.
I'm good with revisiting it another time. I'm not sure the best way to revisit the nested scroll bars otherwise.
Did you check the Hint editor? |
|
@mark-fitzgerald I believe the Hint Editor is already included inside EditorPage, so I'd say I did check it there. |
| * the vertical scrollbar appears. */ | ||
| overflow-x: hidden; | ||
| /* Keep the left cell scroll area within the viewport. */ | ||
| max-height: 90vh; |
There was a problem hiding this comment.
I recommend the following, so that the scroll area fits better (accounting for the header items above the editor):
max-heght: calc(95vh - 244px);
Same for the right cell, below.
There was a problem hiding this comment.
I know this isn't part of your change, but this width setting can probably be removed. The 500px was for something that is no longer in place, or is already accounted for. I did a quick test and removing it doesn't alter anything in the exercise editor.
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@30.1.0 ### Minor Changes - [#3854](#3854) [`4306c90`](4306c90) Thanks [@benchristel](https://github.com/benchristel)! - The Grapher widget is now marked **accessible** if it has a single available function type that is not `quadratic`, and no background image. ### Patch Changes - [#3859](#3859) [`eec5371`](eec5371) Thanks [@benchristel](https://github.com/benchristel)! - The now-unused feature flag "input-number-to-numeric-input" has been removed. - [#3855](#3855) [`8d25dbd`](8d25dbd) Thanks [@benchristel](https://github.com/benchristel)! - The `grapher-to-interactive-graph` feature flag has been removed. Graphers now render as Interactive Graphs if they have a single available function type that is not `quadratic`. ## @khanacademy/keypad-context@3.2.71 ### Patch Changes - Updated dependencies \[[`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd)]: - @khanacademy/perseus-core@30.1.0 ## @khanacademy/kmath@2.4.30 ### Patch Changes - Updated dependencies \[[`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd)]: - @khanacademy/perseus-core@30.1.0 ## @khanacademy/math-input@26.4.44 ### Patch Changes - Updated dependencies \[[`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd)]: - @khanacademy/perseus-core@30.1.0 - @khanacademy/keypad-context@3.2.71 ## @khanacademy/perseus@79.1.2 ### Patch Changes - [#3847](#3847) [`855f36d`](855f36d) Thanks [@Evelas78](https://github.com/Evelas78)! - Regression tests for sorter - [#3802](#3802) [`45feb6d`](45feb6d) Thanks [@Evelas78](https://github.com/Evelas78)! - Added multiple regression tests for the radio widget - [#3812](#3812) [`53b4221`](53b4221) Thanks [@nishasy](https://github.com/nishasy)! - [ColorSync][numeric input] Add more regression stories for the Numeric Input widget - [#3859](#3859) [`eec5371`](eec5371) Thanks [@benchristel](https://github.com/benchristel)! - The now-unused feature flag "input-number-to-numeric-input" has been removed. - [#3855](#3855) [`8d25dbd`](8d25dbd) Thanks [@benchristel](https://github.com/benchristel)! - The `grapher-to-interactive-graph` feature flag has been removed. Graphers now render as Interactive Graphs if they have a single available function type that is not `quadratic`. - [#3835](#3835) [`e5c4c92`](e5c4c92) Thanks [@jandrade](https://github.com/jandrade)! - Migrate Wonder Blocks font sizing from the deprecated `font.size` / `--wb-font-size` tokens to the newer `font.body.size` / `--wb-font-body-size` tokens. Sizes that have no `body` equivalent (`large`) now use the matching `font.heading.size` token. - Updated dependencies \[[`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd)]: - @khanacademy/perseus-core@30.1.0 - @khanacademy/keypad-context@3.2.71 - @khanacademy/kmath@2.4.30 - @khanacademy/math-input@26.4.44 - @khanacademy/perseus-linter@5.1.11 - @khanacademy/perseus-score@8.12.3 ## @khanacademy/perseus-editor@34.1.2 ### Patch Changes - [#3832](#3832) [`4f11360`](4f11360) Thanks [@nishasy](https://github.com/nishasy)! - Put the left and right sides of the editor in separate scroll areas - [#3828](#3828) [`ffc1dcd`](ffc1dcd) Thanks [@catandthemachines](https://github.com/catandthemachines)! - [Interactive Graph][editor] Fix invariant error in interactve graph editor. - [#3835](#3835) [`e5c4c92`](e5c4c92) Thanks [@jandrade](https://github.com/jandrade)! - Migrate Wonder Blocks font sizing from the deprecated `font.size` / `--wb-font-size` tokens to the newer `font.body.size` / `--wb-font-body-size` tokens. Sizes that have no `body` equivalent (`large`) now use the matching `font.heading.size` token. - Updated dependencies \[[`855f36d`](855f36d), [`45feb6d`](45feb6d), [`53b4221`](53b4221), [`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd), [`e5c4c92`](e5c4c92)]: - @khanacademy/perseus@79.1.2 - @khanacademy/perseus-core@30.1.0 - @khanacademy/keypad-context@3.2.71 - @khanacademy/kmath@2.4.30 - @khanacademy/math-input@26.4.44 - @khanacademy/perseus-linter@5.1.11 ## @khanacademy/perseus-linter@5.1.11 ### Patch Changes - Updated dependencies \[[`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd)]: - @khanacademy/perseus-core@30.1.0 - @khanacademy/kmath@2.4.30 ## @khanacademy/perseus-score@8.12.3 ### Patch Changes - Updated dependencies \[[`eec5371`](eec5371), [`4306c90`](4306c90), [`8d25dbd`](8d25dbd)]: - @khanacademy/perseus-core@30.1.0 - @khanacademy/kmath@2.4.30 Author: khan-actions-bot Reviewers: benchristel Required Reviewers: Approved By: benchristel Checks: ✅ 11 checks were successful Pull Request URL: #3861
Summary:
It's hard for content authors to view the preview when working in the editor that's
gone way past the preview vertically.
Making it easier for content authors to view different vertical points between the
left and right cells in the editor by giving the left and right sides separate
scroll areas.
Issue: https://khanacademy.atlassian.net/browse/LEMS-4305
Test plan:
Storybook
/?path=/story/editors-editorpage--with-all-widgets/?path=/story/editors-articleeditor--demoUse the local dev server to test the behavior in