Skip to content
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

[LEMS-2880] Bugfix the close button focus outline on hover in keypad and other style issues #2296

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

ivyolamit
Copy link

@ivyolamit ivyolamit commented Mar 11, 2025

Summary:

This PR will fix the MathInput keypad close button's focus outline on hover. It also includes fixing the backspace keypad background color and overall padding for consistency with mobile.

Issue: LEMS-2880

Test plan:

  1. Navigate to the Perseus Expression Widget in Storybook
  2. Open the keypad by clicking the math input
  • Confirm the close button will now have the focus outline when hovering over the close button
  • Confirm the close button works as expected
  • Confirm the accessibility tabs to navigate to the close button works properly
  • Confirm the backspace button now looks the same as the other buttons above it
  • Confirm the padding of the popover is now consistent with mobile
  1. Navigate to the MathInput v2 Keypad With Mathquill in Storybook.
  2. Click "open keypad" button
  • Confirm the backspace button is now consistent with the previous view
  • Confirm the padding of the popover is now consistent with the previous view

Affected UI

Before After
image image
image image

@ivyolamit ivyolamit self-assigned this Mar 11, 2025
Copy link
Contributor

github-actions bot commented Mar 11, 2025

Size Change: +4 B (0%)

Total Size: 735 kB

Filename Size Change
packages/math-input/dist/es/index.js 77.5 kB +2 B (0%)
packages/perseus/dist/es/index.js 369 kB +2 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 39.7 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 11.1 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 31.9 kB
packages/perseus-editor/dist/es/index.js 136 kB
packages/perseus-linter/dist/es/index.js 22.8 kB
packages/perseus-score/dist/es/index.js 20.6 kB
packages/perseus/dist/es/strings.js 6.73 kB
packages/pure-markdown/dist/es/index.js 4.14 kB
packages/simple-markdown/dist/es/index.js 13.1 kB

compressed-size-action

Copy link
Contributor

github-actions bot commented Mar 11, 2025

npm Snapshot: Published

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

Example:

pnpm add @khanacademy/perseus@PR2296

If you are working in Khan Academy's webapp, you can run:

./dev/tools/bump_perseus_version.sh -t PR2296

@ivyolamit ivyolamit requested a review from a team March 12, 2025 16:44
@ivyolamit ivyolamit marked this pull request as ready for review March 12, 2025 16:45
Copy link
Member

@catandthemachines catandthemachines left a comment

Choose a reason for hiding this comment

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

Looks good to me! Just one question on the implementation.

opened={this.state.keypadOpen}
onClose={() => this.closeKeypad()}
Copy link
Member

Choose a reason for hiding this comment

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

Interesting why remove the onClose event? How was this effecting the style of the close button?

Copy link
Author

Choose a reason for hiding this comment

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

onClose event was remove and used the showDismiss props of the keypad component. The onClose event is something that the Popover component handles which is the outer component which has a different position of the close button, but by leveraging the showDismiss props it will correctly align in the TabBar which the icons are position as part of the inner component.

@ivyolamit ivyolamit added the project agnostic PRs reviewable by any Perseus team member label Mar 17, 2025
"@khanacademy/perseus": patch
---

[LEMS-2880] Bugfix the close button focus outline on hover in keypad and other style issues
Copy link
Collaborator

Choose a reason for hiding this comment

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

Two things:

  • let's avoid JIRA ticket numbers in the changelog entries. This is an open project and JIRA is closed so not everyone will be able to reference the ticket.
  • Regarding wording, what exactly was fixed with the outline? and what are the other styling issues? Basically, if I read this in the changelog of the new release, how do I know what specifically was fixed? :)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @jeremywiebe for your comment, i'll keep that in mind moving forward 😉 I also updated the wording to properly reflect the changes I made. Please let me know if there are other changes I need.

@@ -77,7 +77,7 @@ export function V2KeypadWithMathquill() {
content={
<PopoverContentCore
style={{
padding: 10,
padding: 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Given this is in a Story... did you also test this fix in webapp? Just want to make sure we aren't fixing this style issue for a story only.

Copy link
Author

Choose a reason for hiding this comment

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

That's a good call! I'll do that. Base on code search we might also need to update the webapp side. Let me get back to you on this after i'm fully setup with the webapp and have a separate PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project agnostic PRs reviewable by any Perseus team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants