Bump gpui-kit to 0.7.0 and gpui-pre to 0.3.7 - #548
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
gpui-kit 0.7.0 pins the whole
gpui-pre-*family to=0.3.7and moves window hosting into a Base-ownedRoot(release notes).What changes
Version bump and compile fixes
gpui-pre-*goes to 0.3.7.Themehas a new requiredplotfield;theme.rssets it toPlotTheme::default().gpui-pre-wgpu,WgpuRenderer::gpu_specsnow returnsOption. The iOS and Android window code passes it through instead of wrapping it inSome.Windows are hosted on
gpui_base::RootOverlayHostbecomes theOverlaysRootPlugin. It is registered intheme::init_with_jsonand owns dialogs, notifications and the window touch edit menu. Itsstylehook sets the canvas background, text colour and font.TextSelectionLayerand the macOS hit-test forwarder now come fromRoot, and tcode's copies of them are gone.OverlayExt::detach_viewandreplace_vieware removed: they had no callers andRootcannot swap its content view.run_shellreturnsAnyWindowHandle, like upstream'sopen_window.Copybinding and handler are removed; they duplicatedRoot's exactly.Keys that
Rootwould otherwise take. GPUI dispatches bindings beforeon_key_downlisteners, soRoot'stab/shift-tab/copy bindings would have taken keys that the terminal and composer read raw:Terminalkey context in which those keys are bound toNoAction. Tab and, off macOS, Ctrl-C (interrupt) still reach the PTY even while a chat selection exists.ToggleInteractionModeaction bound in aComposercontext. It propagates when the composer is not interactive.Upstream fixes applied to tcode's copies of the same code
widgets/menu.rs: the subscriptions inContextMenuandmenu_popovernow capture weak handles. This is the same cycle 0.7.0 fixed inPopoverState: a menu whose host unmounted while it was open was never freed, and its deferred-popover registration keptis_in_deferred_contexttrue.Selectable::open/is_open.Buttonkeeps the default, so behaviour is unchanged.TextSelectionRegistration::with_rendered_element, as upstream's adapter does.Tests
shortcut::tests::root_focus_traversal_leaves_terminal_and_composer_their_keys. Under a realRoot, Tab/Shift-Tab reach aTerminallistener without moving focus, and Shift-Tab inComposerdispatchesToggleInteractionModewithout moving focus. Each half fails when its binding is removed.gpui_base::Rootand reach the plugin throughRoot::plugin.a_remote_project_root_is_judged_by_the_hostnow runstheme::initlike its siblings, because the plugin must be registered before the window opens.Checks run locally:
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo nextest run --workspace --locked: 947 passedcargo-machetecargo checkwith-D warningsgpui-androidchecked foraarch64-linux-android; the fulltcode-androidcheck 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:
@file/$skill//commandmentions.offset.