Skip to content

Bump gpui-kit to 0.7.0 and gpui-pre to 0.3.7 - #548

Merged
Tryanks merged 1 commit into
mainfrom
chore/gpui-base-0.7.0
Sep 28, 2026
Merged

Tryanks merged 1 commit into
mainfrom
chore/gpui-base-0.7.0

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Why

gpui-kit 0.7.0 pins the whole gpui-pre-* family to =0.3.7 and moves window hosting into a Base-owned Root (release notes).

What changes

Version bump and compile fixes

  • gpui-base, gpui-kit-assets, gpui-component-macros and gpui-wry go to 0.7.0; every gpui-pre-* goes to 0.3.7.
  • The Base Theme has a new required plot field; theme.rs sets it to PlotTheme::default().
  • In gpui-pre-wgpu, WgpuRenderer::gpu_specs now returns Option. The iOS and Android window code passes it through instead of wrapping it in Some.

Windows are hosted on gpui_base::Root

  • OverlayHost becomes the Overlays RootPlugin. It is registered in theme::init_with_json and owns dialogs, notifications and the window touch edit menu. Its style hook sets the canvas background, text colour and font.
  • Tab traversal (including focus traps), selection copy, TextSelectionLayer and the macOS hit-test forwarder now come from Root, and tcode's copies of them are gone.
  • OverlayExt::detach_view and replace_view are removed: they had no callers and Root cannot swap its content view.
  • run_shell returns AnyWindowHandle, like upstream's open_window.
  • The Markdown Copy binding and handler are removed; they duplicated Root's exactly.

Keys that Root would otherwise take. GPUI dispatches bindings before on_key_down listeners, so Root's tab/shift-tab/copy bindings would have taken keys that the terminal and composer read raw:

  • The terminal content has a Terminal key context in which those keys are bound to NoAction. Tab and, off macOS, Ctrl-C (interrupt) still reach the PTY even while a chat selection exists.
  • Composer Shift-Tab is now a ToggleInteractionMode action bound in a Composer context. It propagates when the composer is not interactive.

Upstream fixes applied to tcode's copies of the same code

  • widgets/menu.rs: the subscriptions in ContextMenu and menu_popover now capture weak handles. This is the same cycle 0.7.0 fixed in PopoverState: a menu whose host unmounted while it was open was never freed, and its deferred-popover registration kept is_in_deferred_context true.
  • The popover trigger uses the new Selectable::open/is_open. Button keeps the default, so behaviour is unchanged.
  • Markdown selection registration uses TextSelectionRegistration::with_rendered_element, as upstream's adapter does.

Tests

  • New: shortcut::tests::root_focus_traversal_leaves_terminal_and_composer_their_keys. Under a real Root, Tab/Shift-Tab reach a Terminal listener without moving focus, and Shift-Tab in Composer dispatches ToggleInteractionMode without moving focus. Each half fails when its binding is removed.
  • Overlay tests mount gpui_base::Root and reach the plugin through Root::plugin. a_remote_project_root_is_judged_by_the_host now runs theme::init like its siblings, because the plugin must be registered before the window opens.

Checks run locally:

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo nextest run --workspace --locked: 947 passed
  • cargo-machete
  • iOS-sim and wasm32 cargo check with -D warnings
  • gpui-android checked for aarch64-linux-android; the full tcode-android check needs an NDK, which is not available locally, so that is left to CI.

Visual check: macOS, light theme, wide window only. Main window, update toast and Add Project dialog. Dark theme and narrow widths were not checked.

Not adopted

These are product or UX decisions rather than replacements:

  • Inline tokens for composer @file/$skill//command mentions.
  • Popover offset.
  • Porting upstream's TextView layout cache and inline-code line-height fix into tcode's Markdown fork.

Host every window on gpui-base's Root: tcode's dialogs, notifications and
touch edit menu become a RootPlugin, and Root owns focus traversal,
selection copy and the selection layer. The terminal unbinds Root's Tab and
copy keys so they still reach the PTY, and Shift-Tab in the composer is a
ToggleInteractionMode action in its own context.

Also adopt the upstream fixes that apply to tcode's copies: weak captures in
the menu subscriptions (the PopoverState leak), Selectable::open for popover
triggers, and with_rendered_element for Markdown selection registrations.
@Tryanks
Tryanks merged commit faa4dc8 into main Sep 28, 2026
19 of 21 checks passed
@Tryanks
Tryanks deleted the chore/gpui-base-0.7.0 branch September 28, 2026 05:25
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