Repository navigation
root: Add Base window hosting and a single Kit startup entry point - #3152
Merged
Merged
Conversation
huacnlee
force-pushed
the
root-auto-layers
branch
from
September 21, 2026 08:28
8918e7c to
dfa4a3b
Compare
Root, and add open_windowRoot, add open_window and a default quit key
huacnlee
force-pushed
the
root-auto-layers
branch
from
September 21, 2026 09:14
dfa4a3b to
b44db5e
Compare
Root, add open_window and a default quit keyRoot, add open_window and default window keys
…fault window keys A window's dialogs, sheets and notifications live on its `Root`, but `Root` only stored them: the application's first view had to call `Root::render_dialog_layer` and its two siblings, or `open_dialog` did nothing at all. Every downstream application learned this by watching a dialog not appear, wrote it into its own guide and grew a wrapper view for it. Getting a window up also took three nested closures around `Root::new` that told a newcomer nothing about why, and every example bound the platform's quit shortcut by hand. `Root` now places the layers itself, after the view. A `RootLayers` element laid out as the view's next sibling reads which layers the view already rendered this frame — the public `render_*_layer` functions record that — and renders the rest, so an application that positions a layer under its own title bar keeps it there and gets no second copy. `gpui_kit::open_window(options, cx, build)` is `cx.open_window` with the window made ready for the kit: a `Root` wraps the view when the `component` feature is on, the view is the root otherwise, and both the window and the view come back. `gpui_base::init` binds `cmd-q` on macOS and `alt-f4` elsewhere to a `Quit` action, and `cmd-w` on macOS to `CloseWindow`; a later binding to the app's own action still wins. The examples, recipes and docs move to all of this, and the two panics for a window without a `Root` now say what to do. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
huacnlee
force-pushed
the
root-auto-layers
branch
from
September 21, 2026 09:18
b44db5e to
9a3354d
Compare
Remove manual layer APIs and default lifecycle shortcuts, migrate consumers, and document the pending 0.7.0 changes. Co-authored-by: Codex <codex@openai.com>
Root, add open_window and default window keysCo-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Add version switching with latest release at the site root, keep main under /versions/main, and cache historical release builds. Co-authored-by: Codex <codex@openai.com>
This reverts commit c471f4e.
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
Co-authored-by: Codex <codex@openai.com>
dwander
added a commit
to dwander/gpui-component
that referenced
this pull request
Sep 22, 2026
build/chore: 업스트림 GPUI Kit 병합 — 충돌 해결 + 중복된 포크 패치 걷어내기 - Cargo.toml: 상류가 gpui 계열을 crates.io `gpui-pre-*` 핀으로 되돌리는 것을 매번처럼 zed git 참조로 복구(안 하면 gpui 가 두 벌 링크된다). sum-tree·reqwest 는 상류 범프를 따른다. - styled.rs: 상류가 링 그리기를 `focus_ring()` 자유 함수로 뽑았다. 우리 `focus_ring_style_always` 를 그 위에 다시 얹어 중복 본문 60줄을 걷어냈다. - dialog/alert_dialog: 상류 longbridge#3126 이 `button_props` 를 덮어쓰기가 아니라 병합으로 바꿔, on_close 유실을 막으려던 우리 패치(AlertDialog 전용 button_props + DialogButtonProps::on_close 빌더)가 불필요해졌다 — 걷어내고 상류 구조를 쓴다. overlay_dim 은 그대로 유지. - root.rs/lib.rs: 상류 longbridge#3152 로 `Root` 가 Base 소유가 되고 `WindowState` 는 크레이트 내부 타입이 됐다. 앱에서 쓰던 툴팁 억제를 `suppress_tooltip`/`restore_tooltip` 자유 함수로 노출. - popover.rs: 병합이 만든 중복 import 정리.
4 tasks
huacnlee
pushed a commit
that referenced
this pull request
Sep 28, 2026
## Description The README examples use `gpui_kit::open_window`, which was added in 0.7.0 (#3152). The install snippets next to them still say `gpui-kit = "0.6"`. For 0.x crates, Cargo treats `"0.6"` as `>=0.6.0, <0.7.0`, so anyone who copies the README gets 0.6.6. The example then fails to compile: ``` error[E0425]: cannot find function `open_window` in crate `gpui_kit` ``` This PR changes every hardcoded `gpui-kit` requirement in Markdown from `0.6` to `0.7`: - `README.md` - `README.zh-CN.md` - `crates/kit/README.md` (the crates.io readme; the published page updates with the next release) - `crates/base/README.md` - `examples/app_assets/README.md` - `skills/gpui-kit/references/usage.md` The website docs are not affected because they use `{{gpui_kit_version}}`. `script/bump-version.sh` only runs `cargo set-version`, which does not touch Markdown. These snippets will need a manual update again on the next minor release. ## How to Test - `git grep -nE 'gpui-kit = (\{ *version = )?"[0-9]' -- '*.md'` lists only `0.7`. - A new project with `gpui-kit = "0.7"` and the README example resolves to 0.7.0 and calls `gpui_kit::open_window`. ## Checklist - [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [ ] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [ ] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 7, 2026
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.
Summary
Window startup now always mounts a
gpui_base::Root, regardless of Cargo feature unification. Base owns application content, overlay hosting, keyboard traversal, and text-selection copying. Component initialization registers its per-window presentation state as a Root plugin, so dialogs, sheets, notifications, menus, tooltips, touch selection, and window chrome remain automatic without making Base depend on Component.gpui_kit::open_windowas the standard Kit application entry point. It always mounts Base Root and returns both the window handle and content entity.gpui-base;gpui_component::Rootis now a re-export. Root now renders sheet, dialog, and notification layers automatically.RootPlugininterface. Plugins are registered before window creation, instantiated independently per window, rendered in registration order, and can prepare, style, and decorate the root surface.WindowStateRoot plugin while application-facing operations remain onWindowExt.window_border()solely responsible for client-side window chrome. Server-decorated windows pass content through unchanged; client-decorated windows receive borders, shadow inset, rounded corners, and resize hit zones.Root::borderedandRoot::window_shadow_size, plus the obsoleteroot_borderlessexample.Public API
gpui-base
Rootalso implementsStyled. Instance style refinements are applied after plugin defaults and therefore take precedence:Register plugins during explicit application initialization, before creating windows. Re-registering a plugin type replaces its factory for future windows rather than mounting it twice. Registration does not retrofit existing roots.
gpui-kit
The builder returns application content, not a Root. Kit mounts Base Root around it.
gpui-component
pub use gpui_base::Root;replaces the former Component-owned Root.gpui_component::init(cx)registers ComponentWindowStateas a Root plugin.Manual layer-rendering and Root-owned dialog, sheet, and notification operations are removed. In particular,
Root::render_sheet_layer,Root::render_dialog_layer, andRoot::render_notification_layerno longer exist because Root hosts those layers automatically. Use the existingWindowExtoperations to open and update them.Breaking Changes
Targeted for 0.7.0; package versions remain unchanged.
Use the Kit window entry point and return application content instead of constructing
Rootmanually. Retain the returned content entity when direct content access is needed, because the window root is nowgpui_base::Root:Delete manual overlay placement.
Root::render_sheet_layer,Root::render_dialog_layer, andRoot::render_notification_layerare removed becauseRootnow hosts these layers automatically:Root window-chrome configuration is removed. Decoration policy comes from GPUI
WindowOptions;window_border()applies client chrome only forDecorations::Client:The Root- and WindowExt-owned text-selection methods are removed in favor of
gpui_base::TextSelection:The remaining Component-owned Root operations are removed in favor of the corresponding
WindowExtmethods:Test Plan
cargo test -p gpui-base --lib— 993 passed.cargo test -p gpui-component --lib— 559 passed.cargo test -p gpui-kit --features test-support,component,assets --test root— 6 passed.cargo test -p gpui-kit --features test-support,component,assets --tests— 114 passed during the window-startup migration.cargo test -p gpui-kit --features test-support,component,assets --test rendering— 2 Metal pixel checks passed.cargo clippy -p gpui-base -p gpui-component -p gpui-kit --all-targets --features gpui-kit/test-support -- --deny warnings— passed.cargo check -p gpui-kit --no-default-features— passed.cargo fmt --all --check— passed.git diff --check— passed.script/check-ai-recipes— 9 published recipe fragments passed.AI-assisted changes prepared with Codex.