Repository navigation
fix(core): end a mouse drag a sandboxed frame never saw released - #12349
josephfarina wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Requesting changes. The GestureHost fix itself looks right: it restores the mouse drag's release that the Slider and gesture specs require, and the two new GestureHost.test.ts end tests fail on main and pass here. Two things need fixing first:
- The release note (
.changeset/gesture-missed-mouse-lift.md) and the title say a drag released outside the page stayed held, but onmaina top-level page already ends that drag at itspointerup, so please scope both to a page in a sandboxed frame released outside the browser window (wording suggested inline). - The new sandboxed-frame test in
SliderFinePointer.interaction.browser.spec.tspasses onmainunder the config'schromiumproject, because Playwright's headless shell delivers the frame'spointerup, and fails onmain(90 vs 64) only in the full Chromium build, so please pin it to that build (for exampletest.use({channel: 'chromium'})in adescribethat skips outside Chromium) or otherwise make it fail onmainwhere CI runs it, and name the build in the description.
Optional: the new JSDoc on endMissedMouseLift could be shorter and name only the case the tests reproduce (suggestion inline).
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims:
- Release note, a drag released outside the page now ends when the pointer returns or presses: verified for a page in a sandboxed frame (
GestureHost.ts:3797,:3890-3892,:3940-3962; the new end tests); false for a top-level page, which already ends the drag onmain. - Release note, a Slider thumb, a pan or a sheet stayed held before: verified for the Slider in a sandboxed frame (full Chromium, 90 to 64) and for a pan (unit test); a sheet was not reproduced; false for a top-level page.
- Description, in a sandboxed frame the release outside the window never arrives and the thumb follows a pointer with no button down: verified in the full Chromium build; Playwright's headless shell delivers the release.
- Description, the contact ends as a lift at its last place at that event's time, with no click guarded: verified (
GestureHost.ts:3953-3960; first new unit test). - Description, mouse only, a chord keeps the press, touch and pen unchanged: verified (
GestureHost.ts:3941-3946; chord test). - Description, one private method, no new public API, no record change: verified (the built API surface of Core and the seven themes is unchanged).
- Description, pointer capture does not route the release to the frame: not checked; the gesture host sets no pointer capture.
- Description, the new unit tests fail on
mainand pass here: verified for the two end tests; the chord test passes on both, as a guard. - Description, the new browser test fails on
mainand passes here: false under the config'schromiumproject, where it passes onmain; true only in the full Chromium build. - Description, the unit suites for gestures, Slider, BottomSheet, Carousel, Drawer and List pass: verified at this head.
- Description, the Slider and gesture interaction specs pass in Chromium: verified, 117 pass and 5 skip in the config's
chromiumproject at this head.
- Release note, a drag released outside the page now ends when the pointer returns or presses: verified for a page in a sandboxed frame (
- Files:
.changeset/gesture-missed-mouse-lift.md: finding (claim scope).packages/core/src/gestures/GestureHost.ts: clear (optional comment suggestion).packages/core/src/gestures/__tests__/GestureHost.test.ts: clear.packages/core/src/Slider/__tests__/SliderFinePointer.interaction.browser.spec.ts: finding (passes onmainunder thechromiumproject).
There was a problem hiding this comment.
Requesting changes. The earlier points are fixed: the release note and title now name the sandboxed-frame case, and the new SliderFramedRelease test fails on main (Expected 90, Received 64) and passes here under CI's Chromium project. One wording fix remains:
- Miss: The release note (
.changeset/gesture-missed-mouse-lift.md) says a sheet stayed held and followed the pointer, and the description's User impact says a sheet's drag never ends, but BottomSheet's drag does not go throughGestureHostand already ends onmainwhen the pointer comes back over the frame, so please drop the sheet from both (the phrase came from the wording suggested in the earlier review; a corrected line is inline).
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claims:
- Release note, a sandboxed-frame drag released outside the window now ends when the pointer comes back or presses again: verified (
GestureHost.ts:3797,:3890-3892,:3937-3959;GestureHost.test.ts:2796,:2841;SliderFramedRelease.interaction.browser.spec.ts:27). - Release note, a Slider thumb, a pan or a sheet stayed held and followed the pointer before: verified for the Slider (99 to 30 on
main) and a pan (unit test); false for BottomSheet, which ends when the pointer returns onmainand is unchanged here. - Title, the fix ends a drag a sandboxed frame never saw released: verified.
- Description, such a drag never ends for a Slider thumb, a pan or a sheet: verified for the Slider and host pans in Chromium's full build; false for a sheet.
- Description, a top-level page already ends the drag: verified by the earlier probe; the runtime code is unchanged since apart from a comment.
- Description, the Slider keeps its value tooltip shown so Escape cannot close it: tooltip shown in the base clip; Escape not checked.
- Description, the host ends a mouse contact only on the window's pointer events and the release goes to the top page: verified (only
pointerup,pointercanceland blur end a mouse contact onmain; the frame hears nopointerupin the full build). - Description, pointer capture does not route the release to the frame: not checked; the host takes no pointer capture.
- Description, the contact ends at the next buttonless move or press, as a lift at its last place, with no click guarded: verified (
GestureHost.ts:3937-3959; first new unit test). - Description, a lost focus or a cancel already ends a press, and no record changes: verified (the cited clause covers blur and cancel; no record changed).
- Description, one private method, mouse only, a chord keeps the press, touch and pen unchanged: verified (
GestureHost.ts:3938-3943;GestureHost.test.ts:2876). - Description, 90 to 64 before and 90 kept after: verified at this head.
- Description, a normal mouse drag still ends at its
pointerup: verified (257 of 257GestureHosttests pass). - Description, the three unit tests and the full-build browser test fail on
mainand pass here: verified for the two end tests and the browser test; the chord test passes on both, as a guard. - Description, no new public API and no internal context in public text: verified (built API surface unchanged; public text scanned).
- Description, 2,079 unit tests over six folders and 1,089 over gestures and Slider pass: verified.
- Description, 117 Slider and gesture interaction tests pass in Chromium: verified (117 passed, 5 skipped).
- Release note, a sandboxed-frame drag released outside the window now ends when the pointer comes back or presses again: verified (
- Files:
.changeset/gesture-missed-mouse-lift.md: finding (names a sheet).packages/core/src/Slider/__tests__/SliderFramedRelease.interaction.browser.spec.ts: clear.packages/core/src/gestures/GestureHost.ts: clear.packages/core/src/gestures/__tests__/GestureHost.test.ts: clear.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because its run was cancelled at admission before the test, build and interaction jobs started, so please re-run CI on this head; the merge guard needs it green.
The GestureHost change ends a mouse drag whose release a sandboxed frame never hears, the new unit tests and the full-Chromium browser test fail on main and pass here, and every earlier point is fixed, including the release note, which now names only the Slider thumb and the pan that the tests reproduce.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Claims:
- Release note, a sandboxed-frame mouse drag released outside the window now ends when the pointer comes back over the frame or presses again: verified (
GestureHost.ts:3797,:3890-3892,:3937-3959;GestureHost.test.ts:2796,:2841;SliderFramedRelease.interaction.browser.spec.ts:27). - Release note, before the fix a Slider thumb or a pan stayed held and followed the buttonless pointer: verified (90 to 64 on
mainin the browser test; the pan follows the buttonless move in the first new unit test onmain). - Title, the fix ends a drag a sandboxed frame never saw released: verified.
- Description, in Chromium such a drag on a Slider thumb or a pan never ends, and the frame never receives the
pointerup: verified (full-Chromium probe; red-first tests). - Description, a top-level page already receives the
pointerupand ends the drag: verified (the probe's top page receives it;onPointerUpends the contact atGestureHost.ts:3961-4002). - Description, the thumb then follows the pointer back with no button down: verified (recording: 99 to 41 on
main, 99 kept here). - Description, the Slider keeps its value tooltip forced open, so Escape cannot close it: verified (
Slider.tsx:1653-1654forces it open during a drag; onmainthe tooltip stayed open after Escape). - Description, the host tracks a mouse press through the window's pointer events only: verified (
GestureHost.ts:2161-2164; onmainonlypointerup,pointercanceland blur end a mouse contact). - Description, the release goes to the top page alone, and pointer capture does not route it to the frame: verified (probe with and without pointer capture; the frame gets only a lost-capture event on return).
- Description, the next event shows a move with the primary button up or a new press: verified (probe: the moves back report no buttons).
- Description, the host ends the contact there as a lift at its last place, at that event's time, with no click guarded or replayed: verified (
GestureHost.ts:3950-3957). - Description, the gesture spec already ends every press a lost focus or a cancel interrupts, and no record changes: verified.
- Description, one private method called from
onPointerMoveandonPointerDown, mouse only, a chord keeps the press, touch and pen unchanged: verified (GestureHost.ts:3938-3944;GestureHost.test.ts:2876). - Description, the thumb goes from 90 to 64 before and stays at 90 after: verified at this head.
- Description, a normal mouse drag still ends at its
pointerup: verified (257 of 257GestureHosttests pass). - Description, the full-build browser test fails on
mainand passes here, and the headless shell cannot show the bug: verified (Expected 90, Received 64 onmain; the probe's headless shell delivers the release). - Description, no new public API, default or interaction model, and no internal context in public text: verified (built API surface unchanged; public text scanned).
- Description, 2,079 unit tests over six folders and 1,089 over gestures and Slider pass: verified.
- Description, 117 Slider and gesture interaction tests pass in Chromium: verified (117 passed, 5 skipped).
- Release note, a sandboxed-frame mouse drag released outside the window now ends when the pointer comes back over the frame or presses again: verified (
- Files:
.changeset/gesture-missed-mouse-lift.md: clear.packages/core/src/Slider/__tests__/SliderFramedRelease.interaction.browser.spec.ts: clear.packages/core/src/gestures/GestureHost.ts: clear.packages/core/src/gestures/__tests__/GestureHost.test.ts: clear.
- #12252 docs(cli): agent docs name the prop names that differ from other libraries Author: Joey Farina <[email protected]> - #12154 fix(core): a numeric typography weight builds through an extended base's adaptation rules Author: Joey <[email protected]> - #12092 fix(cli): theme build reads the Core it builds with for variant declarations, and names the build command alone Author: Joey Farina <[email protected]> - #12316 fix(core): a shorthand never follows its own longhand in one style merge Author: josephfarina <[email protected]> - #12357 fix(core): a Table stays the scroll region when a host scrolls every table's parent Author: Joey Farina <[email protected]> - #12349 fix(core): end a mouse drag a sandboxed frame never saw released Author: josephfarina <[email protected]> - #12425 fix(cli): use a stored doc parse only with the zod release that made it Author: Joey <[email protected]> - #12396 fix(AppShell): with the standard width points, a server-rendered shell hides its inline side nav on a phone before its script runs Author: Joey <[email protected]> - #12438 fix(charts): end dots draw whole and a thinned axis keeps its last label Author: Joey Farina <[email protected]> - #12448 fix(cli): upgrade outside a project names the project, not --from Author: Joey Farina <[email protected]> - #12459 fix(templates): the dashboard scorecard fits a phone screen Author: Joey Farina <[email protected]> - #12428 fix(core): Field labels draw in a bolder face than their description Author: Joey Farina <[email protected]> - #12435 fix(theme-matcha): dark menus, popovers and muted fills take the theme's deep gray neutral Author: Joey <[email protected]> - #12432 fix(templates): dashboard chart labels show whole instead of clipped by the chart edge Author: Joey Farina <[email protected]> - #12441 fix(cli): mark icon-set generated calls pure so apps drop unused icons Author: Joey Farina <[email protected]> - #12472 fix(MetadataListItem): a value breaks only a word longer than its line Author: Joey <[email protected]>
|
Landed in #12718. |
User impact
In Chromium, when a page is shown inside a sandboxed frame (an embed or a viewer), a mouse drag on a Slider thumb or a pan that is released outside the browser window never ends. A top-level page is not affected: it receives the
pointerupand ends the drag already. The frame never receives thepointerup, so the gesture stays held. The thumb then follows the pointer when it comes back with no button down, and the Slider keeps its value tooltip forced open, so Escape cannot close it.Problem and solution fit
pointerupto the top page alone. Pointer capture on the pressed element does not route it to the frame either.The browser still reports the truth on the next event: a
pointermovewhosebuttonsno longer has the primary button, or a newpointerdown. The host now ends the tracked mouse contact there, as a lift at its last place, at that event's time. No click follows such a lift, so none is guarded or replayed.Expected behavior and authority
A press ends with its release (the gesture host's press lifecycle;
spec:AST-094FR44 already ends every press a lost focus or a cancel interrupts). This change covers the release the document never hears. No record changes.Smallest restoration
One private method in
GestureHost, called fromonPointerMoveandonPointerDown, for mouse contacts only. A chorded second button keeps the press. Touch and pen are unchanged.Evidence
pointerupas before; a press held with a second button keeps going; touch and pen paths are untouched.GestureHost.test.ts: a missed release ends at the next button-up move, at the press's last place.GestureHost.test.ts: a missed release ends before the next press starts.GestureHost.test.ts: a chord keeps the press.SliderFramedRelease.interaction.browser.spec.ts: the sandboxed-frame Slider drag above. It runs in the full Chromium build (channel: 'chromium'), because Playwright's headless shell delivers the frame'spointerupand so cannot show the bug. In that build it fails on main and passes here.Scope
Components: GestureHost (gestures), Slider tests
Testing
vitest --project uiover gestures, Slider, BottomSheet, Carousel, Drawer, and List: 2,079 tests pass (gestures and Slider re-run on this head: 1,089).Expected: 90, Received: 64) and passes against this branch. All runs usedCI=1.