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

Fixing resize behavior for Expression Widget #1548

Merged
merged 14 commits into from
Aug 27, 2024

Conversation

catandthemachines
Copy link
Member

@catandthemachines catandthemachines commented Aug 22, 2024

Summary:

Enabling rootBoundary mode for Popover implementation in Expression Widget. This ensures the popover container does not snap depending on the viewport and instead positions it's contend based on where there is room in the page document. This change is needed an intended to ensure the Expression Widget is accessible to users in 400% or very small screen sizes.

Issue: LEMS-2085

Test plan:

  1. Viewing disabled viewport functionality.
    • Go to /?path=/docs/perseus-widgets-expression--docs and open an expression widget keypad.
    • Notice that the keypad does not move to stay in the viewport when scrolling up and down the document.
  2. Viewing improved 400% zoom experience
    • Go to /iframe.html?args=&id=perseus-widgets-expression--desktop&viewMode=story
    • Increase screen zoom to 400% or minimize screen size to 320 x 256.
    • Notice that you can open the keypad and it does not move outside the page and you can scroll and reach content within the keypad even if it's larger the they viewport size.

@catandthemachines catandthemachines self-assigned this Aug 22, 2024
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Aug 22, 2024

Gerald

Required Reviewers
  • @Khan/perseus for changes to yarn.lock, .changeset/quiet-news-relate.md, dev/package.json, packages/math-input/package.json, packages/perseus/package.json, packages/perseus-editor/package.json, packages/perseus/src/components/math-input.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 22, 2024 23:22
Copy link
Contributor

github-actions bot commented Aug 22, 2024

Size Change: +16 B (0%)

Total Size: 860 kB

Filename Size Change
packages/perseus/dist/es/index.js 417 kB +16 B (0%)
ℹ️ 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.67 kB
packages/simple-markdown/dist/es/index.js 12.4 kB

compressed-size-action

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.97%. Comparing base (873f107) to head (f5346d5).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1548      +/-   ##
==========================================
+ Coverage   70.38%   70.97%   +0.58%     
==========================================
  Files         521      524       +3     
  Lines      107315   107349      +34     
  Branches     7796    11652    +3856     
==========================================
+ Hits        75538    76192     +654     
+ Misses      31587    31157     -430     
+ Partials      190        0     -190     

Impacted file tree graph

Files Coverage Δ
packages/perseus/src/components/math-input.tsx 82.06% <100.00%> (+0.21%) ⬆️

... and 146 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 873f107...f5346d5. Read the comment docs.

@catandthemachines catandthemachines changed the title Moving dependencies into dev and peer dependencies. Fixing resize behavior for Expression Widget Aug 22, 2024
Copy link
Contributor

github-actions bot commented Aug 23, 2024

npm Snapshot: Published

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

Example:

yarn add @khanacademy/perseus@PR1548

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

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

Copy link
Contributor

@handeyeco handeyeco 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. My only concerns:

  • Failing TS check
  • I wonder if we need to update all WB/WS at the same time?

@catandthemachines
Copy link
Member Author

Looks good to me. My only concerns:

  • Failing TS check
  • I wonder if we need to update all WB/WS at the same time?

Yeah the weird failing type check made me think I needed to update all of them at the same time. Will keep digging into why it's mis-behaving, and see if it's needed.

@catandthemachines
Copy link
Member Author

catandthemachines commented Aug 26, 2024

Looks good to me. My only concerns:

  • Failing TS check
  • I wonder if we need to update all WB/WS at the same time?

Yeah the weird failing type check made me think I needed to update all of them at the same time. Will keep digging into why it's mis-behaving, and see if it's needed.

Okay after wrangling with the typing I can summarize why it's there. The update to tooltip also appears to have included a dependency update to the color object Tooltip accepts. So to fix this I just needed to update the tokens package version. So the only packages updated are tooltip, popover, and tokens. 😊

@catandthemachines catandthemachines merged commit 21a908e into main Aug 27, 2024
11 checks passed
@catandthemachines catandthemachines deleted the catjohnson/expression-resize branch August 27, 2024 22:26
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