Skip to content

Removes the width override for the cs-program widget #2753

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
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MikeKlemarewski
Copy link
Contributor

@MikeKlemarewski MikeKlemarewski commented Aug 1, 2025

Summary:

Remove width override for cs-program widget. This width was causing some overflow issues in KA Classroom, and after testing this in Classroom and Classic, I don't think it's needed.

Classic

Screen.Recording.2025-08-01.at.3.11.24.PM.mov

Classroom

Screen.Recording.2025-08-01.at.3.08.36.PM.mov

Issue: TUT-2719

Test plan:

  • Bump the perseus version to this PR in the frontend
  • Test content with the widget and ensure it renders correctly

Copy link
Contributor

github-actions bot commented Aug 1, 2025

🗄️ Schema Change: No Changes ✅

Copy link
Contributor

github-actions bot commented Aug 1, 2025

Size Change: -14 B (0%)

Total Size: 496 kB

Filename Size Change
packages/perseus/dist/es/index.js 207 kB -14 B (-0.01%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 20.7 kB
packages/keypad-context/dist/es/index.js 1 kB
packages/kmath/dist/es/index.js 5.98 kB
packages/math-input/dist/es/index.js 98.6 kB
packages/math-input/dist/es/strings.js 1.61 kB
packages/perseus-core/dist/es/index.item-splitting.js 13 kB
packages/perseus-core/dist/es/index.js 21.6 kB
packages/perseus-editor/dist/es/index.js 94.1 kB
packages/perseus-linter/dist/es/index.js 7.07 kB
packages/perseus-score/dist/es/index.js 9.34 kB
packages/perseus-utils/dist/es/index.js 403 B
packages/perseus/dist/es/strings.js 7.56 kB
packages/pure-markdown/dist/es/index.js 1.39 kB
packages/simple-markdown/dist/es/index.js 6.71 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Aug 1, 2025

🛠️ Item Splitting: No Changes ✅

Copy link
Contributor

github-actions bot commented Aug 1, 2025

npm Snapshot: Published

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

Example:

pnpm add @khanacademy/perseus@PR2753

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

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

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

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

@handeyeco
Copy link
Contributor

Just for context: are you saying there was no visual impact for KA Classic but it helped fix a bug in Classroom? That's nice!

My main concern then, if that's the case, is the impact on mobile...but I'm not sure how much we support CSProgram on mobile. 🤔 Might be worth taking a look though.

@MikeKlemarewski
Copy link
Contributor Author

Just for context: are you saying there was no visual impact for KA Classic but it helped fix a bug in Classroom? That's nice!

My main concern then, if that's the case, is the impact on mobile...but I'm not sure how much we support CSProgram on mobile. 🤔 Might be worth taking a look though.

Luke found a bit more context for the original override which was added almost 7 years ago. It was because some buttons were rendering off screen. I added a screen recording and some extra suggestions here in Slack.

Copy link
Member

@lsmith lsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a regression for classic CS programs embedded in articles, but that is an acceptable tradeoff to improve the new Classroom experience.

@@ -174,11 +174,6 @@ class CSProgram extends React.Component<Props> implements Widget {
}

const styles = StyleSheet.create({
// Override the inherited width from the perseus paragraph class
Copy link
Member

@lsmith lsmith Aug 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the removal of lines doesn't leave blame traces, can you include a code comment noting that removing a width override to 820px exposed a layout issue with rendering CS programs in articles, but this was preferable to leaving the override which introduced a layout issue in the new Classroom view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants