Skip to content

fix(ui): host the touch sheet on gpui-base Sheet - #565

Merged
Tryanks merged 1 commit into
mainfrom
fix/sheet-on-base
Oct 1, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/sheet-on-base

Conversation

@Tryanks

@Tryanks Tryanks commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Changed behaviour

Popover::bottom_sheet rebuilt by hand what gpui_base::Sheet owns — the overlay press, Escape through its own key_context("Popover"), outside-dismissal — and had no focus trap. It now hands Sheet the scrim and the surface and keeps only presentation: the Presence fade, the grabber, the title row, the scrollable content area. Escape, overlay dismissal and the focus trap come from base.

OutsideDismissal stays, with its gap named at the site: base dismisses on the outside press, and GPUI then delivers that press's release (and the click it completes) to whatever the popup uncovered — confirmed by removing the guard from the old code, which fails the same test. The guard is now armed from the dismissal rather than from the press event, so the sheet arms it from Sheet::request_close, and it is disarmed by the next press so a dismissal by Escape or by choosing an item swallows nothing. Popover and menus keep consuming the press itself, with a comment naming base's pass-through default they depart from.

Per Principle 7 as extended in #564.

Tests

  • all_popovers_consume_dismissal_release_even_after_redraw (existing) covers the release guard for sheet, popover and dropdown.
  • New a_dismissal_without_a_press_leaves_the_next_click_alone: Escape closes the sheet and the next click lands — the contract the arm-from-dismissal design must keep.
  • tall_sheet_scrolls_below_navigation_and_above_keyboard, the pickers' sheet geometry tests and shell::tests::compact* assert the unchanged sheet/scrim bounds and that Escape reaches the sheet.

Checks run

  • cargo fmt --all --check, cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo nextest run -p tcode-ui --locked — 346 passed

Not verified visually: the computer-use tools on this machine lack Accessibility/Screen Recording permission, so I could not open the sheet in the phone example. Geometry is asserted by the tests above; the surface's styling code is unchanged.

The bottom sheet rebuilt what gpui_base::Sheet owns: the overlay press,
Escape, and it had no focus trap. It now supplies only the scrim and the
surface. OutsideDismissal keeps the release of the dismissing press from
reaching what the sheet uncovered, which base's press-time dismissal
cannot do; it is armed from the dismissal instead of the press, so the
sheet arms it from Sheet::request_close, and a new press disarms it so
an Escape costs nothing.
@Tryanks
Tryanks merged commit 9034091 into main Oct 1, 2026
7 checks passed
@Tryanks
Tryanks deleted the fix/sheet-on-base branch October 1, 2026 17:23
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.

1 participant