| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Follow release versions and highlight diffs (#3284) ## Description Website installation examples and asset API links still named Kit 0.6 after the 0.7 release, and diff blocks in release notes did not distinguish additions from deletions. Pass `GPUI_KIT_VERSION` to each versioned website build, deriving it from the release tag or the Kit manifest for main. Resolve `{{gpui_kit_version}}` in the affected English and Chinese pages, including Markdown exports, and pass the same value to the homepage installation and clipboard snippet. Local development falls back to the checkout's manifest. Existing release-tag snapshots retain their original content; future tags include the variable-based pages. Enable diff highlighting in the shared documentation and release-notes renderer, with green additions, red deletions and blue headers in both light and dark themes. ## How to Test - `bun test --cwd website --timeout 60000` — 39 tests passed. - `GPUI_KIT_VERSION=0.8.1 PUBLIC_SITE_VERSION=v0.8.1 bun run --cwd website build` — passed; verified homepage HTML, hydration props, Markdown exports and asset links use 0.8.1 despite the local Cargo version being 0.7.0. - Verified generated release-notes HTML includes diff colors for both themes. - `bash -n script/build-website-versions` and `git diff --check` — passed. ## Checklist - [x] Read CONTRIBUTING and followed repository conventions. - [x] AI-assisted changes reviewed and verified with focused regression tests and the website build. - [x] English and Chinese documentation synchronized. Native Story and platform performance checks are not applicable to this website change. | 12 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
docs: expand GPUI core guides and improve documentation UI (#3225) ## Description Expand the English and Chinese GPUI guides into a source-checked reference for GPUI Kit users. The new and revised pages cover entity ownership, render lifecycles, custom elements and painting, actions and events, tasks, globals, styling, text, accessibility, animation, WebAssembly, and related APIs. Examples use practical module boundaries and distinguish API guarantees from design guidance. Improve documentation navigation, cross-links, and code examples. Add an animated memory diagram to the SharedString guide. Make article links visibly identifiable and give long tables a distinct header and alternating row backgrounds. Add a CC BY 4.0 attribution notice for eligible GPUI Kit documentation prose and original illustrations, while preserving the repository's existing Apache-2.0 permissions for software and code examples. ## Screenshot The documentation UI changes are visible in the built site: links have blue text and underlines, table headers have a filled background, and alternate body rows have a subtle tint. The SharedString guide contains a responsive SVG comparison with reduced-motion support. ## How to Test From `website/`: ```sh bun run build bun run test:seo bun run test:showcases bun run test:versioned-examples ``` All commands passed. `git diff --check` passed as well. ## Checklist - [x] Reviewed the documentation and code examples against the current GPUI and GPUI Kit APIs. - [x] Verified the English and Chinese guides and the generated documentation site. - [x] No Rust public API or platform-specific runtime behavior changed. | 15 天前 | |
webview: Support Linux on X11 and rename the crate to gpui-webview (#3395) ## Summary `gpui-webview` (formerly `gpui-wry`) now supports macOS, Windows and Linux: | Platform | Engine | GPUI overlays above the page (`gpui-fast`) | | --- | --- | --- | | macOS | WKWebView | Supported | | Windows | WebView2 | Not yet; the WebView covers overlays | | Linux (X11 / XWayland) | WebKitGTK | Supported | | Linux (Wayland) | — | Not supported; run on XWayland | `gpui-wry` did not work on Linux: GPUI's X11 backend reports an `XcbWindowHandle`, which Wry's `build_as_child` rejects (it accepts only Xlib), and the example never initialized GTK or drove its main loop. - Add `WebView::build`, which attaches the Wry view as a child of the GPUI window and performs the platform setup Wry needs. - On Linux (`crates/webview/src/linux.rs`): - Check the window is X11 first; a Wayland window returns an error naming the fix. - Initialize GTK once on its X11 backend and dispatch pending GTK events from a GPUI task. - Pass the window ID to Wry as an `XlibWindowHandle`. - Send bounds in device pixels, because Wry scales by GDK's factor, not GPUI's. - Wayland is not supported: GTK cannot embed into another client's `wl_surface`. Applications start with `gpui_kit::platform::linux(WindowingModes::X11)`, which runs on XWayland in a Wayland session. The example does this. - Match the page zoom to GPUI's scale factor: GTK only scales by integers, so with `GDK_SCALE=2` and a GPUI scale of 1.67 pages rendered about 20% larger than the surrounding UI. - With `gpui-fast` on Linux, build the Wry view in a window composition surface so popovers, menus and dialogs render above the page. Update GPUI Fast to 0.1.3, which draws shadows and translucent backdrops over the page into an X11 overlay window that the compositing manager blends (longbridge/gpui-fast#42). - Forward clicks on the page to GPUI, so popovers and menus that close on an outside click close when the page is clicked, and block GPUI input under the native view. - Example: enable `gpui-webview/gpui-fast` from the example's `gpui-fast` feature (composition was never enabled in the example before), and add back/forward buttons, a Popover, a Menu (Reload, About dialog) and a Dialog. - Rename the crate `gpui-wry` → `gpui-webview` (the name is free on crates.io) and update `script/publish-crates`. - Docs (en + zh-CN): add a platform support table to WebView, rewrite the Linux section, and update Native Extension and the README. Tested on Linux (Hyprland, scale 1.67, XWayland): the example renders GPUI content and the page, and the WebView follows its layout slot. Starting on Wayland returns the X11 error before GTK initializes. Input inside the WebView and focus transfer were not tested yet. ## Public API ### gpui-webview - `WebView::build(builder: wry::WebViewBuilder, window: &mut Window, cx: &mut App) -> wry::Result<WebView>`: builds a child webview of `window`, performing the platform setup Wry requires (GTK and X11 on Linux). - `WebView::forward(&mut self) -> anyhow::Result<()>`: goes forward in the webview history, mirroring `back()`. ## Breaking Changes The crate is renamed from `gpui-wry` to `gpui-webview`. ```diff [dependencies] -gpui-wry = "0.7.1" +gpui-webview = "0.7.1" ``` ```diff -use gpui_wry::WebView; +use gpui_webview::WebView; ``` On Linux, applications using the WebView must start on X11: ```diff -gpui_kit::application().run(|cx| { /* ... */ }); +#[cfg(target_os = "linux")] +let app = gpui_kit::platform::linux(WindowingModes::X11); +#[cfg(not(target_os = "linux"))] +let app = gpui_kit::application(); +app.run(|cx| { /* ... */ }); ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> | 3 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Make the active sidebar item stand out (#3237) Closes #3190 ## Summary The active page in the docs sidebar was marked only by `font-weight: 650` on text that is already `--foreground`, so after scrolling a long page like `Editor` it took a moment to find again. - The active item now takes the `--sidebar-accent` fill (`#e5e5e5` light / `#262626` dark), stronger than the `--secondary` hover fill, and keeps the heavier weight. No leading-edge bar. - Each item has a 1px transparent border with the fill clipped to the padding box, so the hover and active fills of adjacent items sit 2px apart instead of merging. Padding is reduced by the same pixel, so row height (28.4px) and text alignment are unchanged. - The active link carries `aria-current="page"`. - Section root links (`/docs`, `/component`, `/shell`) prefix-matched every page in their section, so e.g. `/docs/getting-started` marked both "GPUI Kit" and "Getting Started" active. Only the longest matching link is active now. ## Design rule Design Guides → Interaction states now states that selected navigation items, list rows and tabs are shown through the item's own surface (fill, foreground, weight), never a leading-edge bar or one-sided border. Added in `website/docs/design-guides.md` and `website/zh-CN/docs/design-guides.md`. `website/DESIGN.md` no longer reserves `--brand` for an "active sidebar indicator" and states the fill-only rule. ## Verification Dev server + headless Chromium on `/component/editor`, light and dark: exactly one `.sidebar-item.active`, computed background `rgb(229,229,229)` / `rgb(38,38,38)`. Checked `/docs`, `/docs/getting-started`, `/component`, `/zh-CN/component/editor` and `/shell` each resolve to a single active item. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
docs: Explain recovering focus when the focused element stops rendering (#3386) | 3 天前 | |
website: Keep box-drawing glyphs in the gallery font subsets (#3305) ## Description The web gallery's welcome story renders `README.md` through `include_str!`, but `crates/story-web/scripts/subset-fonts.py` only collected characters from `.rs` sources. The README's `├──` / `└──` crate tree lost its glyphs from the JetBrains Mono subset, and the `EmojiAndCjk` Canvas fallback does not cover box-drawing characters, so https://gpui-kit.com/gallery/ draws them as tofu. Desktop builds are unaffected: they use complete system monospace fonts with platform fallback. - `subset-fonts.py` now also reads every file a scanned source pulls in with `include_str!` (README, fixtures, theme JSON, `examples/fixtures/test.md`). - FontTools 4.66 keeps the input flavor when `--flavor` is not given, which wrote `Inter-Regular.ttf` as WOFF2. The script passes `--flavor=none` and pins `fonttools[woff]==4.66.0` so reruns produce the same files. - Regenerated the four subsets. They were also behind the current story sources: Noto Sans SC gains 70+ Han characters the stories already use (such as 探索 and 继续编辑), and `▸ ▾ ○`, no longer used anywhere, drop out. - Updated the Noto Sans SC subset size and the subset description in `webassembly.md` and `fonts.md` (`en` and `zh-CN`). | Font file | Before (bytes) | After (bytes) | | --- | ---: | ---: | | `Inter-Regular.ttf` | 88,036 | 94,432 | | `JetBrainsMono-Regular.ttf` | 84,160 | 89,508 | | `NotoSansSC-Regular-subset.ttf` | 25,484 | 42,092 | | `IBMPlexSans-Regular.ttf` | 48,676 | 49,124 | ### Before <img alt="before" src="https://github.com/user-attachments/assets/2e3628d9-3a76-465f-94b9-d9bec1eabebd" /> ### After <img alt="after" src="https://github.com/user-attachments/assets/ab84a9ec-77c3-42cf-8cb8-91cdfdd722d2" /> ## How to Test - Run `bun run --cwd crates/story-web/www fonts` twice: the generated files are byte-identical, and all four start with the TrueType `00010000` header. - Run `make dev` in `crates/story-web` and open `/gallery/`. The Introduction page draws the crate tree with box-drawing lines; the live site shows tofu in the same place. The script change, regenerated fonts and documentation edits in this PR were AI-generated. Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: 李波 <bo.li@longbridge-inc.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 11 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
kit: Add optional gpui-fast backend (#3375) Add an optional `gpui-fast` feature across GPUI Kit’s existing crates: ```toml gpui-kit = { version = "0.7", features = ["gpui-fast"] } ``` No new crates. Preserve the existing `gpui-pre-*` workspace dependencies and default backend; optional Fast dependencies and internal conditional aliases select the engine. Existing application imports and macros continue to work. This is additive, with no breaking changes. Upstream packages still compile because Cargo features are additive. ## Public API - **gpui-kit:** `gpui-fast` selects Fast for core, platforms, and enabled layers. - **gpui-base, gpui-component, gpui-kit-assets, gpui-fps, gpui-wry, gpui-shell, gpui-component-shell:** `gpui-fast` selects the matching backend for standalone consumers. - **gpui-component-macros:** `#[derive(IntoPlot)]` additionally recognizes direct Fast dependencies. - Gallery and examples expose the same feature for comparisons. ## Validation 27 focused UI/macro/assets tests and 9 documentation tests pass. Default/Fast configurations, examples, WebView, Shell, benchmarks, and nightly WebAssembly compile. Clippy, formatting, dependency, and snapshot-pin checks pass. CI adds native and WebAssembly coverage. AI-assisted with Codex. | 4 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
website: Follow release versions and highlight diffs (#3284) ## Description Website installation examples and asset API links still named Kit 0.6 after the 0.7 release, and diff blocks in release notes did not distinguish additions from deletions. Pass `GPUI_KIT_VERSION` to each versioned website build, deriving it from the release tag or the Kit manifest for main. Resolve `{{gpui_kit_version}}` in the affected English and Chinese pages, including Markdown exports, and pass the same value to the homepage installation and clipboard snippet. Local development falls back to the checkout's manifest. Existing release-tag snapshots retain their original content; future tags include the variable-based pages. Enable diff highlighting in the shared documentation and release-notes renderer, with green additions, red deletions and blue headers in both light and dark themes. ## How to Test - `bun test --cwd website --timeout 60000` — 39 tests passed. - `GPUI_KIT_VERSION=0.8.1 PUBLIC_SITE_VERSION=v0.8.1 bun run --cwd website build` — passed; verified homepage HTML, hydration props, Markdown exports and asset links use 0.8.1 despite the local Cargo version being 0.7.0. - Verified generated release-notes HTML includes diff colors for both themes. - `bash -n script/build-website-versions` and `git diff --check` — passed. ## Checklist - [x] Read CONTRIBUTING and followed repository conventions. - [x] AI-assisted changes reviewed and verified with focused regression tests and the website build. - [x] English and Chinese documentation synchronized. Native Story and platform performance checks are not applicable to this website change. | 12 天前 | |
docs: add an Images guide covering img, svg and HTTP caching (#3239) ## Description Add an **Images** guide under `docs/` (`website/docs/image.md` and `website/zh-CN/docs/image.md`), and shorten the Image component page to the patterns applications use most, linking to the guide for details. The guide covers: - **Sources**: how each `ImageSource` conversion loads its bytes (URL through the App's `HttpClient`, asset key, file path, `Arc<Image>`, `Arc<RenderImage>`, custom loader), and that native apps must install an `HttpClient` before URL images load. - **Loading, decoding, and failures**: the 200 ms loading delay, why `with_loading` and animated images need an `.id(...)`, what triggers the fallback, format detection from bytes, and SVG rasterization in `img()`. - **Size and fit**: how `auto` dimensions and `aspect_ratio` come from the decoded image, and `ObjectFit`. - **`svg()`**: `path`, `external_path`, `data`; why it needs its own text color and an explicit size; paint-only transformations. - **`img()` or `svg()`**: a comparison table. - **Caches for decoded images**: the App asset cache, scoped caches with `image_cache(retain_all(...))`, and a custom `ImageCache` example that keeps the most recently drawn images. - **Cache remote images over HTTP**: wrap the App's `HttpClient` in a client that follows HTTP caching rules (`Cache-Control`, `ETag`/`Last-Modified` revalidation, shared-cache restrictions, redirect policy in the cache key, size bounds, authorization before the request), with an example that adapts [http-cache-reqwest](https://crates.io/crates/http-cache-reqwest) middleware (disk store) to GPUI's `HttpClient`. It builds one client that follows redirects and one that does not, each with its own cache, so a caller that requests `RedirectPolicy::NoFollow` still receives the `3xx`. The approach follows a production GPUI application that installs a global caching client. - **Troubleshooting**. `docs/assets.md` now links to the guide. English and Chinese pages are kept in sync. No public API changes. ## How to Test - The `ImageCache` and `svg()` examples compile against this branch's `gpui-kit`; the HTTP cache example was compiled and run against a local server: a repeated request is answered from the cache, `NoFollow` receives the `302`, and a following request reaches the final `200`. - `typos`, `astro build`, and `bun test tests/seo.test.ts` pass; heading anchors used by cross-page links resolve. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Follow release versions and highlight diffs (#3284) ## Description Website installation examples and asset API links still named Kit 0.6 after the 0.7 release, and diff blocks in release notes did not distinguish additions from deletions. Pass `GPUI_KIT_VERSION` to each versioned website build, deriving it from the release tag or the Kit manifest for main. Resolve `{{gpui_kit_version}}` in the affected English and Chinese pages, including Markdown exports, and pass the same value to the homepage installation and clipboard snippet. Local development falls back to the checkout's manifest. Existing release-tag snapshots retain their original content; future tags include the variable-based pages. Enable diff highlighting in the shared documentation and release-notes renderer, with green additions, red deletions and blue headers in both light and dark themes. ## How to Test - `bun test --cwd website --timeout 60000` — 39 tests passed. - `GPUI_KIT_VERSION=0.8.1 PUBLIC_SITE_VERSION=v0.8.1 bun run --cwd website build` — passed; verified homepage HTML, hydration props, Markdown exports and asset links use 0.8.1 despite the local Cargo version being 0.7.0. - Verified generated release-notes HTML includes diff colors for both themes. - `bash -n script/build-website-versions` and `git diff --check` — passed. ## Checklist - [x] Read CONTRIBUTING and followed repository conventions. - [x] AI-assisted changes reviewed and verified with focused regression tests and the website build. - [x] English and Chinese documentation synchronized. Native Story and platform performance checks are not applicable to this website change. | 12 天前 | |
kit: Add optional gpui-fast backend (#3375) Add an optional `gpui-fast` feature across GPUI Kit’s existing crates: ```toml gpui-kit = { version = "0.7", features = ["gpui-fast"] } ``` No new crates. Preserve the existing `gpui-pre-*` workspace dependencies and default backend; optional Fast dependencies and internal conditional aliases select the engine. Existing application imports and macros continue to work. This is additive, with no breaking changes. Upstream packages still compile because Cargo features are additive. ## Public API - **gpui-kit:** `gpui-fast` selects Fast for core, platforms, and enabled layers. - **gpui-base, gpui-component, gpui-kit-assets, gpui-fps, gpui-wry, gpui-shell, gpui-component-shell:** `gpui-fast` selects the matching backend for standalone consumers. - **gpui-component-macros:** `#[derive(IntoPlot)]` additionally recognizes direct Fast dependencies. - Gallery and examples expose the same feature for comparisons. ## Validation 27 focused UI/macro/assets tests and 9 documentation tests pass. Default/Fast configurations, examples, WebView, Shell, benchmarks, and nightly WebAssembly compile. Clippy, formatting, dependency, and snapshot-pin checks pass. CI adds native and WebAssembly coverage. AI-assisted with Codex. | 4 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Follow release versions and highlight diffs (#3284) ## Description Website installation examples and asset API links still named Kit 0.6 after the 0.7 release, and diff blocks in release notes did not distinguish additions from deletions. Pass `GPUI_KIT_VERSION` to each versioned website build, deriving it from the release tag or the Kit manifest for main. Resolve `{{gpui_kit_version}}` in the affected English and Chinese pages, including Markdown exports, and pass the same value to the homepage installation and clipboard snippet. Local development falls back to the checkout's manifest. Existing release-tag snapshots retain their original content; future tags include the variable-based pages. Enable diff highlighting in the shared documentation and release-notes renderer, with green additions, red deletions and blue headers in both light and dark themes. ## How to Test - `bun test --cwd website --timeout 60000` — 39 tests passed. - `GPUI_KIT_VERSION=0.8.1 PUBLIC_SITE_VERSION=v0.8.1 bun run --cwd website build` — passed; verified homepage HTML, hydration props, Markdown exports and asset links use 0.8.1 despite the local Cargo version being 0.7.0. - Verified generated release-notes HTML includes diff colors for both themes. - `bash -n script/build-website-versions` and `git diff --check` — passed. ## Checklist - [x] Read CONTRIBUTING and followed repository conventions. - [x] AI-assisted changes reviewed and verified with focused regression tests and the website build. - [x] English and Chinese documentation synchronized. Native Story and platform performance checks are not applicable to this website change. | 12 天前 | |
webview: Support Linux on X11 and rename the crate to gpui-webview (#3395) ## Summary `gpui-webview` (formerly `gpui-wry`) now supports macOS, Windows and Linux: | Platform | Engine | GPUI overlays above the page (`gpui-fast`) | | --- | --- | --- | | macOS | WKWebView | Supported | | Windows | WebView2 | Not yet; the WebView covers overlays | | Linux (X11 / XWayland) | WebKitGTK | Supported | | Linux (Wayland) | — | Not supported; run on XWayland | `gpui-wry` did not work on Linux: GPUI's X11 backend reports an `XcbWindowHandle`, which Wry's `build_as_child` rejects (it accepts only Xlib), and the example never initialized GTK or drove its main loop. - Add `WebView::build`, which attaches the Wry view as a child of the GPUI window and performs the platform setup Wry needs. - On Linux (`crates/webview/src/linux.rs`): - Check the window is X11 first; a Wayland window returns an error naming the fix. - Initialize GTK once on its X11 backend and dispatch pending GTK events from a GPUI task. - Pass the window ID to Wry as an `XlibWindowHandle`. - Send bounds in device pixels, because Wry scales by GDK's factor, not GPUI's. - Wayland is not supported: GTK cannot embed into another client's `wl_surface`. Applications start with `gpui_kit::platform::linux(WindowingModes::X11)`, which runs on XWayland in a Wayland session. The example does this. - Match the page zoom to GPUI's scale factor: GTK only scales by integers, so with `GDK_SCALE=2` and a GPUI scale of 1.67 pages rendered about 20% larger than the surrounding UI. - With `gpui-fast` on Linux, build the Wry view in a window composition surface so popovers, menus and dialogs render above the page. Update GPUI Fast to 0.1.3, which draws shadows and translucent backdrops over the page into an X11 overlay window that the compositing manager blends (longbridge/gpui-fast#42). - Forward clicks on the page to GPUI, so popovers and menus that close on an outside click close when the page is clicked, and block GPUI input under the native view. - Example: enable `gpui-webview/gpui-fast` from the example's `gpui-fast` feature (composition was never enabled in the example before), and add back/forward buttons, a Popover, a Menu (Reload, About dialog) and a Dialog. - Rename the crate `gpui-wry` → `gpui-webview` (the name is free on crates.io) and update `script/publish-crates`. - Docs (en + zh-CN): add a platform support table to WebView, rewrite the Linux section, and update Native Extension and the README. Tested on Linux (Hyprland, scale 1.67, XWayland): the example renders GPUI content and the page, and the WebView follows its layout slot. Starting on Wayland returns the X11 error before GTK initializes. Input inside the WebView and focus transfer were not tested yet. ## Public API ### gpui-webview - `WebView::build(builder: wry::WebViewBuilder, window: &mut Window, cx: &mut App) -> wry::Result<WebView>`: builds a child webview of `window`, performing the platform setup Wry requires (GTK and X11 on Linux). - `WebView::forward(&mut self) -> anyhow::Result<()>`: goes forward in the webview history, mirroring `back()`. ## Breaking Changes The crate is renamed from `gpui-wry` to `gpui-webview`. ```diff [dependencies] -gpui-wry = "0.7.1" +gpui-webview = "0.7.1" ``` ```diff -use gpui_wry::WebView; +use gpui_webview::WebView; ``` On Linux, applications using the WebView must start on X11: ```diff -gpui_kit::application().run(|cx| { /* ... */ }); +#[cfg(target_os = "linux")] +let app = gpui_kit::platform::linux(WindowingModes::X11); +#[cfg(not(target_os = "linux"))] +let app = gpui_kit::application(); +app.run(|cx| { /* ... */ }); ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> | 3 天前 | |
webview: Support Linux on X11 and rename the crate to gpui-webview (#3395) ## Summary `gpui-webview` (formerly `gpui-wry`) now supports macOS, Windows and Linux: | Platform | Engine | GPUI overlays above the page (`gpui-fast`) | | --- | --- | --- | | macOS | WKWebView | Supported | | Windows | WebView2 | Not yet; the WebView covers overlays | | Linux (X11 / XWayland) | WebKitGTK | Supported | | Linux (Wayland) | — | Not supported; run on XWayland | `gpui-wry` did not work on Linux: GPUI's X11 backend reports an `XcbWindowHandle`, which Wry's `build_as_child` rejects (it accepts only Xlib), and the example never initialized GTK or drove its main loop. - Add `WebView::build`, which attaches the Wry view as a child of the GPUI window and performs the platform setup Wry needs. - On Linux (`crates/webview/src/linux.rs`): - Check the window is X11 first; a Wayland window returns an error naming the fix. - Initialize GTK once on its X11 backend and dispatch pending GTK events from a GPUI task. - Pass the window ID to Wry as an `XlibWindowHandle`. - Send bounds in device pixels, because Wry scales by GDK's factor, not GPUI's. - Wayland is not supported: GTK cannot embed into another client's `wl_surface`. Applications start with `gpui_kit::platform::linux(WindowingModes::X11)`, which runs on XWayland in a Wayland session. The example does this. - Match the page zoom to GPUI's scale factor: GTK only scales by integers, so with `GDK_SCALE=2` and a GPUI scale of 1.67 pages rendered about 20% larger than the surrounding UI. - With `gpui-fast` on Linux, build the Wry view in a window composition surface so popovers, menus and dialogs render above the page. Update GPUI Fast to 0.1.3, which draws shadows and translucent backdrops over the page into an X11 overlay window that the compositing manager blends (longbridge/gpui-fast#42). - Forward clicks on the page to GPUI, so popovers and menus that close on an outside click close when the page is clicked, and block GPUI input under the native view. - Example: enable `gpui-webview/gpui-fast` from the example's `gpui-fast` feature (composition was never enabled in the example before), and add back/forward buttons, a Popover, a Menu (Reload, About dialog) and a Dialog. - Rename the crate `gpui-wry` → `gpui-webview` (the name is free on crates.io) and update `script/publish-crates`. - Docs (en + zh-CN): add a platform support table to WebView, rewrite the Linux section, and update Native Extension and the README. Tested on Linux (Hyprland, scale 1.67, XWayland): the example renders GPUI content and the page, and the WebView follows its layout slot. Starting on Wayland returns the X11 error before GTK initializes. Input inside the WebView and focus transfer were not tested yet. ## Public API ### gpui-webview - `WebView::build(builder: wry::WebViewBuilder, window: &mut Window, cx: &mut App) -> wry::Result<WebView>`: builds a child webview of `window`, performing the platform setup Wry requires (GTK and X11 on Linux). - `WebView::forward(&mut self) -> anyhow::Result<()>`: goes forward in the webview history, mirroring `back()`. ## Breaking Changes The crate is renamed from `gpui-wry` to `gpui-webview`. ```diff [dependencies] -gpui-wry = "0.7.1" +gpui-webview = "0.7.1" ``` ```diff -use gpui_wry::WebView; +use gpui_webview::WebView; ``` On Linux, applications using the WebView must start on X11: ```diff -gpui_kit::application().run(|cx| { /* ... */ }); +#[cfg(target_os = "linux")] +let app = gpui_kit::platform::linux(WindowingModes::X11); +#[cfg(not(target_os = "linux"))] +let app = gpui_kit::application(); +app.run(|cx| { /* ... */ }); ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> | 3 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 | |
kit: Extend UI testing with semantic queries and Linux rendering (#3402) UI tests can now discover observed controls by accessible label or role, inspect individual pointer/key transitions, and exercise text composition through an explicit input-handler bridge. Ordinary pointer helpers preserve held modifiers instead of resetting them. The real offscreen pixel suite now runs on Linux WGPU as well as macOS Metal, with Linux rendering required in CI. A new nested context-menu regression exposed both ancestor and child menus opening on one right click; listener registration order and event consumption now ensure the innermost menu wins. Adds regressions for Unicode composition, scoped and invisible observations, repeat keys, resize/display scale, cross-window clipboard and Link URL requests. English/Chinese guides and vendored testing references describe the new APIs and native-platform limits. Existing styled controls now use these helpers in 13 additional interaction tests: Button release cancellation, Checkbox held-key activation, Switch disabling during a gesture, Slider live changes/release events, scoped RadioGroup controlled selection, List release modifiers/navigation/cancellation, and Textarea/Editor multiline composition undo and readonly transitions. Two additional light/dark real-renderer cases verify that a controlled Checkbox's pixels follow its value after pointer release. The input regression script includes composition-bridge workflows. ## Public API ### gpui-kit All additions are under `gpui_kit::test`, gated by `test-support`. - `pub trait TestQueryExt` (implemented for `Window`) — native accessibility queries. - `TestQueryExt::elements(&self) -> Vec<ElementSnapshot>` — enumerate observed elements. - `TestQueryExt::find_by_label(&self, label: &str) -> ElementSnapshot` — require a unique exact accessible label. - `TestQueryExt::try_find_by_label(&self, label: &str) -> Option<ElementSnapshot>` — allow absence while diagnosing ambiguity. - `TestQueryExt::find_all_by_label(&self, label: &str) -> Vec<ElementSnapshot>` — enumerate exact label matches. - `TestQueryExt::find_all_by_role(&self, role: Role) -> Vec<ElementSnapshot>` — enumerate native role matches. - `ScopedWindow::elements(&self) -> Vec<ElementSnapshot>` — enumerate strict observed descendants. - `ScopedWindow::find_by_label(&self, label: &str) -> ElementSnapshot` — require a unique descendant label. - `ScopedWindow::try_find_by_label(&self, label: &str) -> Option<ElementSnapshot>` — optional unique descendant query. - `ScopedWindow::find_all_by_label(&self, label: &str) -> Vec<ElementSnapshot>` — enumerate descendant label matches. - `ScopedWindow::find_all_by_role(&self, role: Role) -> Vec<ElementSnapshot>` — enumerate descendant role matches. - `pub trait TestEventExt` (implemented for `Window`) — individual native input events with frame completion. - `TestEventExt::pointer_move(&mut self, position: Point<Pixels>, pressed_button: Option<MouseButton>, cx: &mut App)` — move with explicit held-button state. - `TestEventExt::pointer_down(&mut self, position: Point<Pixels>, button: MouseButton, cx: &mut App)` — press a pointer button. - `TestEventExt::pointer_up(&mut self, position: Point<Pixels>, button: MouseButton, cx: &mut App)` — release a pointer button. - `TestEventExt::change_modifiers(&mut self, modifiers: Modifiers, cx: &mut App)` — dispatch modifier changes while preserving caps lock. - `TestEventExt::key_down(&mut self, key: &str, is_held: bool, cx: &mut App)` — press/repeat a key without synthetic text. - `TestEventExt::key_up(&mut self, key: &str, cx: &mut App)` — independently release a key. - `pub struct TestInput<'a>` — owned explicit handler plus borrowed window for protocol tests. - `TestInput::new(handler: impl InputHandler, window: &'a mut Window) -> Self` — construct the handler bridge. - `TestInput::commit_text(&mut self, text: &str, cx: &mut App)` — commit one whole-text insertion. - `TestInput::compose_text(&mut self, replacement: Option<Range<usize>>, text: &str, selection: Option<Range<usize>>, cx: &mut App)` — update UTF-16 marked text. - `TestInput::unmark_text(&mut self, cx: &mut App)` — retain text while ending composition. - `TestInput::marked_text_range(&mut self, cx: &mut App) -> Option<Range<usize>>` — inspect the UTF-16 marked range. - `TestInput::selected_text_range(&mut self, cx: &mut App) -> Option<UTF16Selection>` — inspect selection and direction. - `pub use events::TestEventExt`, `pub use input::TestInput`, `pub use query::TestQueryExt` — expose the additions through the existing testing seam. - Existing `TestWindowExt::{click, click_at, right_click, double_click, hover, scroll, drag, drag_to}` and corresponding scoped pointer methods — retain current window modifiers; signatures unchanged. ### gpui-component - `ContextMenuExt::context_menu(self, build: impl Fn(PopupMenu, &mut Window, &mut Context<PopupMenu>) -> PopupMenu + 'static) -> ContextMenu<Self>` — existing signature unchanged; nested right clicks now open only the innermost menu. ## Breaking Changes Existing pointer helpers now retain held modifiers. Callers that deliberately require an unmodified click while modifiers are held can request it explicitly; ordinary calls and signatures remain valid. ```diff - window.click("save", cx); // previously reset held modifiers implicitly + window.click_with_options("save", ClickOptions::new(), cx); // explicitly unmodified, then restores held state ``` Nested context-menu callers keep the same construction. The corrected interaction is: ```diff - window.right_click("inner-trigger", cx); // both inner and ancestor menus opened + window.right_click("inner-trigger", cx); // only the innermost menu opens ``` ## Validation - Targeted Kit interaction, observation, composition and environment tests on Linux. - Kit tests without default features for the portable helpers. - Clippy with warnings denied for the library and new test targets. - Changed Rust files formatted; `git diff --check`. - Website documentation checks: 9 passed. - Latest component workflow targets: 15 tests passed (including two previously existing composition cases). - Linux WGPU offscreen rendering: all 12 real pixel cases passed. - Kit menu regressions: 7 passed, including nested context-menu precedence. - Component context-menu regressions: 4 passed. This verifies in-process test-platform behavior. Native OS IME/candidate windows, operating-system clipboard services and pixels require separate native evidence. Implementation and documentation were AI-assisted. | 2 天前 | |
menu: Open a context menu with a long press on touch (#3393) Closes #3392 ## Description A finger has no right button, so `ContextMenuExt` could not be opened on a touch-only device. A long press on the trigger now opens the same menu at the press position, using GPUI's `LongPressEvent` the same way the plot tooltip (#3078) and touch selection (#3073) do. - The body of the right-click handler moved into `open_menu`, which both listeners call; the only edit is `event.position` becoming a `position` parameter. With whitespace changes hidden in Files changed, the change to `context_menu.rs` is small. Since the moved body is no longer nested, `paint` now reads `shared_state` from `request_layout` (the same `Rc` that `with_element_state` returned). - The long-press listener is registered **before** the trigger's children paint, so in the bubble phase it runs after theirs. An `Input` inside the trigger claims the long press first (`prevent_default`), keeps its word selection and edit menu, and the context menu stays shut. - Right-click is unchanged. A selectable `TextView` inside a context-menu trigger keeps its long-press word selection, drag handles, and edit menu. Before claiming a long press, the trigger queries the existing window selection geometry through `TextSelection::is_selectable_at`; a press over blank space still opens the object menu. The query uses the active selection scope and existing hitboxes rather than treating the whole TextView bounds as text. ## Public API ### gpui-base - `TextSelection::is_selectable_at(position: Point<Pixels>, window: &Window, cx: &mut App) -> bool`: reports whether the press hits selectable text in the active selection scope, so a containing control can yield to window-level touch selection without starting or changing a selection. Call this query during pointer dispatch with the event position; hitboxes reflect the current event. No existing API signatures change. ## Screenshot Physical Android phone (OnePlus CPH2581, Android 16), the lab's context-menu demo: a long press on the dashed box, then a tap on the first item. Kit 0.7.0 with and without this diff (backported). **Before**  **After**  Before: nothing happens. After: the menu opens on the long press, and tapping Copy fires its `on_click` (`context: Copy` in the event log). On the same build, a long press inside an `Input` still selects the word with handles and the Cut/Copy/Paste/Select All menu. Builds: [demo-pr3393](https://github.com/Bombatomica64/Gpui-android/releases/tag/demo-pr3393). ## How to Test - `cargo test -p gpui-kit --features test-support,component --test menu --test touch_selection`: 10 menu tests + 13 touch-selection tests passed locally on macOS. - The new `long_press_on_text_in_a_context_menu_trigger_selects` regression test failed against the original PR head (empty selection instead of `quick`) and passes with the fix; it also checks that touch-selection handles remain available and no object context menu opens. - `long_press_on_blank_space_in_a_text_trigger_opens_the_menu` verifies that blank space in the same selectable text row still opens the object menu. - Existing right-click, nested-menu, Input selection, Copy/Select All, handle dragging, cached-view selection, and scrolling tests remain covered by the two integration test targets. - `cargo fmt --all --check` and `git diff --check`: clean. - `cargo clippy -p gpui-base -p gpui-component -p gpui-kit --features gpui-kit/test-support,gpui-kit/component --tests -- -D warnings`: clean. - The physical Android recordings above demonstrate the original long-press opening path. The TextView-priority follow-up has automated macOS coverage; it has not been rechecked on a physical Android device. ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] 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. (Not run: no desktop session here; see How to Test.) - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) (not run on desktop; the new path is touch-only, and right-click is covered by the existing tests) Thanks for taking the time to review this. 🤖 Generated with [Claude Code](https://claude.com/claude-code) The follow-up text-selection fix and its regression tests were generated with Codex and validated with the checks above. --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Jason Lee <huacnlee@gmail.com> | 3 天前 | |
docs: deepen GPUI manual and add release guides (#3232) ## Description Deepen the bilingual GPUI Kit documentation into a practical framework manual. The guides now include runnable exercises for state, rendering, custom elements, painting, text, focus, accessibility, and animation, with clearer expected results and troubleshooting. Clarify what the 120 Hz frame budget means, when GPUI requests frames, and how immediate, retained, and hybrid describe different layers. Preserve the five core layers and explain `gpui-pre` as version-aligned GPUI publication. Add focused packaging and Auto Update guides, including a user-level Linux installer, and expand the asset guides for `icon_assets!`, embedded images, `svg()`, and `img()`. Keep the existing sidebar structure. The page order places WebView after Native Extensions; the new navigation labels are Packaging and Auto Update. Generated Markdown now ends with the existing CC BY 4.0 attribution notice. ## Screenshot Not attached. The interactive frame timeline and documentation pages can be reviewed in the site preview. ## How to Test - `script/check-ai docs` — passed (9 recipe fragments and 6 script tests). - `cargo fmt --all -- --check` and `git diff --check` — passed. - `cargo test -p gpui-kit --test ui --features 'test-support component' --locked` — passed (1 test). - Compiled the new runnable documentation examples in existing example packages; temporary verification files were removed. - Checked the affected English and Chinese pages in the local Astro preview, including sidebar order and Markdown license output. - `bun run build` reached static route generation but stopped because the adjacent `gpui-kit-showcases/scripts/validate.ts` checkout is absent locally. The docs CI workflow checks out showcases separately. ## Checklist - [x] I have read the contributing guide and followed the relevant documentation guidance. - [x] Reviewed the AI-assisted examples against the pinned GPUI APIs and compiled the new complete snippets. - [ ] Story app manual tests (not run for this documentation change). - [ ] macOS, Windows, and Linux performance tests (no platform rendering implementation changed). | 15 天前 | |
website: Keep box-drawing glyphs in the gallery font subsets (#3305) ## Description The web gallery's welcome story renders `README.md` through `include_str!`, but `crates/story-web/scripts/subset-fonts.py` only collected characters from `.rs` sources. The README's `├──` / `└──` crate tree lost its glyphs from the JetBrains Mono subset, and the `EmojiAndCjk` Canvas fallback does not cover box-drawing characters, so https://gpui-kit.com/gallery/ draws them as tofu. Desktop builds are unaffected: they use complete system monospace fonts with platform fallback. - `subset-fonts.py` now also reads every file a scanned source pulls in with `include_str!` (README, fixtures, theme JSON, `examples/fixtures/test.md`). - FontTools 4.66 keeps the input flavor when `--flavor` is not given, which wrote `Inter-Regular.ttf` as WOFF2. The script passes `--flavor=none` and pins `fonttools[woff]==4.66.0` so reruns produce the same files. - Regenerated the four subsets. They were also behind the current story sources: Noto Sans SC gains 70+ Han characters the stories already use (such as 探索 and 继续编辑), and `▸ ▾ ○`, no longer used anywhere, drop out. - Updated the Noto Sans SC subset size and the subset description in `webassembly.md` and `fonts.md` (`en` and `zh-CN`). | Font file | Before (bytes) | After (bytes) | | --- | ---: | ---: | | `Inter-Regular.ttf` | 88,036 | 94,432 | | `JetBrainsMono-Regular.ttf` | 84,160 | 89,508 | | `NotoSansSC-Regular-subset.ttf` | 25,484 | 42,092 | | `IBMPlexSans-Regular.ttf` | 48,676 | 49,124 | ### Before <img alt="before" src="https://github.com/user-attachments/assets/2e3628d9-3a76-465f-94b9-d9bec1eabebd" /> ### After <img alt="after" src="https://github.com/user-attachments/assets/ab84a9ec-77c3-42cf-8cb8-91cdfdd722d2" /> ## How to Test - Run `bun run --cwd crates/story-web/www fonts` twice: the generated files are byte-identical, and all four start with the TrueType `00010000` header. - Run `make dev` in `crates/story-web` and open `/gallery/`. The Introduction page draws the crate tree with box-drawing lines; the live site shows tofu in the same place. The script change, regenerated fonts and documentation edits in this PR were AI-generated. Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: 李波 <bo.li@longbridge-inc.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 11 天前 | |
webview: Require GPUI Fast for gpui-webview (#3398) ## Description On macOS with the default gpui-pre backend, the native `WKWebView` sits above GPUI's Metal layer, so `PopupMenu`, dialogs and tooltips that overlap the page are hidden behind it. Only GPUI Fast's window composition places deferred overlays above the native view: ```text front GPUI overlay deferred draws (PopupMenu, Dialog, Tooltip …) native surface WKWebView / X11 child window back GPUI base the root view ``` `gpui-webview` now always runs on GPUI Fast: - It depends on `gpui-kit` with `default-features = false, features = ["gpui-fast"]` instead of on GPUI directly. Feature unification turns on `gpui-fast` for the application's own `gpui-kit`, so **applications need no manifest change**. - The gpui-pre code paths and `#[cfg(feature = "gpui-fast")]` branches are removed; composition is always used on macOS and Linux. - The crate's `gpui-fast` feature is kept as a no-op so manifests that enable it still resolve. - `examples/webview` drops its `gpui-fast` feature; `cargo run -p webview` shows the menu above the page. - Because `gpui-webview` turns on `gpui-kit/gpui-fast` for every member built with it, CI's workspace lint and test, and the `bump-gpui.ts` kit check, exclude `gpui-webview` and `webview`; CI lints them in a separate step and tests `gpui-webview` in the GPUI Fast job. The rest of the workspace keeps checking gpui-pre. - README and WebView docs (en / zh-CN) updated. `cargo publish -p gpui-webview --dry-run` fails today because the published `gpui-kit` 0.7.1 has no `gpui-fast` feature; it resolves once the next `gpui-kit` release (which includes #3375) is published together with this crate. Verified on macOS: the example's "…" dropdown menu renders above the WebView on GPUI Fast. ## Breaking Changes No manifest change is needed, but an application that depends on `gpui-webview` now runs entirely on GPUI Fast instead of gpui-pre. ## Public API ### `gpui-webview` - `gpui-fast` feature — now has no effect; GPUI Fast is always used. Kept for manifest compatibility. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> | 3 天前 | |
website: Keep versioned docs links inside their version (#3243) Documentation pages read under `/versions/main` or `/versions/<tag>` linked back to the default version through site-root links (`/docs/entity`, `/component/...`), which often 404 there because the default is the latest release. ## Links stay in their version - 124 site-root links in `docs`, `component`, `base`, `shell` (en and zh-CN) now link the `.md` file relatively. zh-CN pages that linked English Base pages now link the Chinese ones. - `remarkDocLinks` prefixes any remaining site-root docs link with the build's base, so released snapshots (v0.6.6 still has such links) stay inside `/versions/<tag>` too. - Redirect destinations (`/docs/dock` → `/component/dock`, …) and the zh-CN → en language switch kept dropping the version base; both are fixed. - The 404 page, which GitHub Pages serves for every missing path, looks for the same page in the other versions and offers it ("This page is not in the v0.6.6 (latest) documentation, but it exists in main."). It also now loads the site stylesheet; it was unstyled before. ## GPUI snapshot version in one place Pages write `{{gpui_pre_version}}` in prose, code and docs.rs links. It resolves from the `gpui` entry of the workspace `Cargo.toml`; `script/build-website-versions` passes each revision's own value. The `.md` endpoints and `llms-full.txt` expand it as well. ## Maturity labels `maturity: [preview | experimental | showcase-only | platform-dependent | stable]` in frontmatter renders mono labels under the title, linking to a new Maturity section on the docs home. Marked: Mobile and WebView (Experimental, Platform-dependent), WebAssembly (Showcase only: it currently serves the component showcases, not shipped applications), all GPUI Shell pages (Preview), Native Extensions, SystemNotification and TitleBar (Platform-dependent). Unmarked pages are Stable. ## Checks - `bun run test:docs` (sources, no build): no site-root docs links; relative links resolve, in the same locale when possible; no hand-written pinned `gpui-pre` version or versioned docs.rs gpui-pre URL; known variables only; en/zh-CN maturity match. - `bun run test:links`: every `<a>` and redirect in a build reaches a built page; `test:versioned-examples` repeats it at `/versions/test/`, where leaving the version fails. - Test Docs now also runs on `Cargo.toml` changes. Verified locally with a production-shaped build (v0.6.6 at `/`, this branch at `/versions/main`): all website tests pass, the v0.6.6 snapshot passes the link check at `/versions/v0.6.6/`, and the 404 fallback works for `/docs/entity` and `/zh-CN/docs/entity`. Publishing a release that contains the new GPUI guides is what makes `/docs/` show them; this PR does not change which version is the default. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> | 15 天前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 12 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 3 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 3 天前 | ||
| 11 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 4 天前 | ||
| 15 天前 | ||
| 12 天前 | ||
| 15 天前 | ||
| 12 天前 | ||
| 4 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 12 天前 | ||
| 3 天前 | ||
| 3 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 15 天前 | ||
| 2 天前 | ||
| 3 天前 | ||
| 15 天前 | ||
| 11 天前 | ||
| 3 天前 | ||
| 15 天前 |