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

Focus movable points when you click on them #1572

Merged
merged 2 commits into from
Aug 29, 2024
Merged

Conversation

benchristel
Copy link
Member

We want this behavior so you can click to select a point on a point graph with
unlimited points, and then press backspace to delete it.

Issue: https://khanacademy.atlassian.net/browse/LEMS-2204

Test plan:

View:
http://localhost:6006/?path=/story/perseuseditor-widgets-interactive-graph--interactive-graph-point

Clicking on a point should focus it (the focus ring should appear and you
should be able to move the point with the keyboard)

@benchristel benchristel self-assigned this Aug 28, 2024
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Aug 28, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/chilled-brooms-begin.md, packages/perseus/src/widgets/interactive-graphs/mafs-styles.css, packages/perseus/src/widgets/interactive-graphs/graphs/components/movable-point-view.tsx, packages/perseus/src/widgets/interactive-graphs/graphs/components/movable-point.test.tsx, packages/perseus/src/widgets/interactive-graphs/graphs/components/movable-point.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@khan-actions-bot khan-actions-bot requested a review from a team August 28, 2024 18:20
Copy link
Contributor

github-actions bot commented Aug 28, 2024

Size Change: +118 B (+0.01%)

Total Size: 860 kB

Filename Size Change
packages/perseus/dist/es/index.js 418 kB +118 B (+0.03%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.3 kB
packages/keypad-context/dist/es/index.js 760 B
packages/kmath/dist/es/index.js 4.27 kB
packages/math-input/dist/es/index.js 78 kB
packages/math-input/dist/es/strings.js 1.79 kB
packages/perseus-core/dist/es/index.js 1.48 kB
packages/perseus-editor/dist/es/index.js 277 kB
packages/perseus-linter/dist/es/index.js 22.2 kB
packages/perseus/dist/es/strings.js 3.36 kB
packages/pure-markdown/dist/es/index.js 3.66 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.76%. Comparing base (21a908e) to head (cab6cd0).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...ve-graphs/graphs/components/movable-point-view.tsx 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1572      +/-   ##
==========================================
+ Coverage   70.34%   70.76%   +0.42%     
==========================================
  Files         521      524       +3     
  Lines      107316   107371      +55     
  Branches     5513    10999    +5486     
==========================================
+ Hits        75489    75985     +496     
+ Misses      31711    31386     -325     
+ Partials      116        0     -116     

Impacted file tree graph

Files with missing lines Coverage Δ
...ractive-graphs/graphs/components/movable-point.tsx 100.00% <100.00%> (ø)
...ve-graphs/graphs/components/movable-point-view.tsx 94.08% <90.90%> (-0.59%) ⬇️

... and 128 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40d0b67...cab6cd0. Read the comment docs.

@@ -154,7 +154,7 @@
}

.MafsView
.movable-point:is(:focus-visible, .movable-point--focus)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

This change is necessary to make the focus ring appear when you click a movable point. It seems like elements that are focused programmatically get the :focus pseudoclass but not the :focus-visible pseudoclass. At least, this is true for SVG elements in Edge.

@benchristel benchristel force-pushed the benc/focus-follows-mouse branch from a6b8e0e to a741067 Compare August 28, 2024 23:03
Copy link
Contributor

github-actions bot commented Aug 28, 2024

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1572

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

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

@benchristel benchristel merged commit efced74 into main Aug 29, 2024
12 checks passed
@benchristel benchristel deleted the benc/focus-follows-mouse branch August 29, 2024 17:58
benchristel pushed a commit that referenced this pull request Sep 3, 2024
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]

### Minor Changes

-   [#1572](#1572) [`efced74db`](efced74) Thanks [@benchristel](https://github.com/benchristel)! - In the interactive graph widget, focus movable points on mouse interaction

### Patch Changes

-   [#1552](#1552) [`873f10790`](873f107) Thanks [@nishasy](https://github.com/nishasy)! - Update dependency on wonder-blocks-form


-   [#1569](#1569) [`40d0b67a8`](40d0b67) Thanks [@handeyeco](https://github.com/handeyeco)! - bump peer dependencies to match webapp


-   [#1548](#1548) [`21a908e8f`](21a908e) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Fixing resizing behavior of Expression Widget in 400% zoom.


-   [#1576](#1576) [`598f7450f`](598f745) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Small re-organization of PhET widget code - no functional changes


-   [#1567](#1567) [`070430166`](0704301) Thanks [@nicolecomputer](https://github.com/nicolecomputer)! - Add a reducer action for removing unlimited points


-   [#1573](#1573) [`50c1b19e5`](50c1b19) Thanks [@benchristel](https://github.com/benchristel)! - Internal: fix incorrect comment

-   Updated dependencies \[[`40d0b67a8`](40d0b67), [`21a908e8f`](21a908e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Minor Changes

-   [#1534](#1534) [`d446d4251`](d446d42) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Remove 'strings' prop from ContentPreview (we'll pull it from context)

### Patch Changes

-   [#1552](#1552) [`873f10790`](873f107) Thanks [@nishasy](https://github.com/nishasy)! - Update dependency on wonder-blocks-form


-   [#1569](#1569) [`40d0b67a8`](40d0b67) Thanks [@handeyeco](https://github.com/handeyeco)! - bump peer dependencies to match webapp


-   [#1548](#1548) [`21a908e8f`](21a908e) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Fixing resizing behavior of Expression Widget in 400% zoom.


-   [#1534](#1534) [`d446d4251`](d446d42) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Ensure 'React' is imported in ContentPreview component.

-   Updated dependencies \[[`efced74db`](efced74), [`873f10790`](873f107), [`40d0b67a8`](40d0b67), [`21a908e8f`](21a908e), [`598f7450f`](598f745), [`070430166`](0704301), [`50c1b19e5`](50c1b19)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   [#1569](#1569) [`40d0b67a8`](40d0b67) Thanks [@handeyeco](https://github.com/handeyeco)! - bump peer dependencies to match webapp

## @khanacademy/[email protected]

### Patch Changes

-   [#1569](#1569) [`40d0b67a8`](40d0b67) Thanks [@handeyeco](https://github.com/handeyeco)! - bump peer dependencies to match webapp


-   [#1548](#1548) [`21a908e8f`](21a908e) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Fixing resizing behavior of Expression Widget in 400% zoom.

-   Updated dependencies \[[`40d0b67a8`](40d0b67)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   Updated dependencies \[[`40d0b67a8`](40d0b67)]:
    -   @khanacademy/[email protected]

## @khanacademy/[email protected]

### Patch Changes

-   [#1569](#1569) [`40d0b67a8`](40d0b67) Thanks [@handeyeco](https://github.com/handeyeco)! - bump peer dependencies to match webapp

## @khanacademy/[email protected]

### Patch Changes

-   [#1569](#1569) [`40d0b67a8`](40d0b67) Thanks [@handeyeco](https://github.com/handeyeco)! - bump peer dependencies to match webapp


-   [#1548](#1548) [`21a908e8f`](21a908e) Thanks [@catandthemachines](https://github.com/catandthemachines)! - Fixing resizing behavior of Expression Widget in 400% zoom.

-   Updated dependencies \[[`40d0b67a8`](40d0b67), [`21a908e8f`](21a908e)]:
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]
    -   @khanacademy/[email protected]

Author: khan-actions-bot

Reviewers: benchristel

Required Reviewers:

Approved By: benchristel

Checks: ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Prime node_modules cache for primary configuration (ubuntu-latest, 20.x), ✅ codecov/project, ✅ codecov/patch, ✅ Upload Coverage (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ⏭️  Publish npm snapshot, ✅ Cypress (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x), ✅ Jest Coverage (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ gerald

Pull Request URL: #1562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants