| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
text_view: Follow the container's text color so rich text reads in filled bubbles (#3329) Closes #3326 ## Description `TextView` paints its own text color on its root, so it does not inherit the color a `Bubble` sets on its content. In a `Filled` bubble, Markdown is drawn in the theme `foreground` on the `primary` surface: white on white in dark mode. Links (`primary`) disappear too, and code backgrounds (`accent`/`muted`) are tuned for the page, not for a `primary` surface. The first revision added `BubbleVariant::text_view_style(cx)`, which callers passed to every `TextView` in a bubble. That repeated the bubble's variant at each call site and would have needed the same method on every other colored container, so the fix now lives in `TextView` itself: - **Follow the container's text color.** A `TextView` without an explicit `.style()` takes the text color its container sets (`window.text_style().color`, or its own `.text_color()`). - **Same-polarity surfaces** (Secondary, Destructive, a popover): only the body text changes. Links, code and borders keep the theme colors. - **Inverted surfaces** (`Filled`, whose `primary` fill is dark on a light page and light on a dark one): when the inherited color is more than 0.6 away from the style's foreground in Oklab lightness, links, muted text (block quotes), code and inline-code backgrounds, borders, selection, the table header and body backgrounds are all derived from it. The dark flag flips, so todo checkboxes pick the right icon. The installed syntax highlighter is left out, since its colors are made for the page. - **Opt-in in Base, on in Component.** `TextViewDefaults::with_inherit_text_color(true)` enables it. Component turns it on because its Root sets the theme foreground. A Base-only window that sets no root text color would otherwise inherit GPUI's default black. `Bubble` needs no change, since it already sets each variant's text color. ## Screenshot Filled, Secondary and Destructive bubbles with a link, inline code, a block quote, a todo list, a fenced code block and a table, in the light and dark themes, read correctly. Before this change, the Filled bubble's text, link and table were invisible in dark mode. ## Public API ### gpui-base - `gpui_base::TextViewDefaults::with_inherit_text_color(self, inherit: bool) -> Self`: makes text views without an explicit style follow the text color their container sets, adapting every color on an inverted surface. - `gpui_base::TextViewDefaults::inherit_text_color(&self) -> bool`: whether that is enabled. ### gpui-component No items are added. Text views now follow the container's text color by default, because Component installs `with_inherit_text_color(true)`. ## How to Test - `cargo test -p gpui-base -p gpui-component` - `text_color_of_a_matching_surface_only_replaces_the_body_text` and `text_color_of_an_inverted_surface_derives_every_color_from_it` cover the color derivation in both themes. - `text_view_follows_the_text_color_of_its_container` checks that a view under a container with `primary_foreground` text resolves to that color with a flipped dark flag, and that an explicit `.style()` still wins. - Manually: render `Bubble::new().child(TextView::markdown("reply", text))` with links, code, quotes, todos and a table in each variant, and toggle the theme. ## 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. - [x] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) (not platform-specific) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Jason Lee <huacnlee@gmail.com> | 1 天前 | |
text_view: Follow the container's text color so rich text reads in filled bubbles (#3329) Closes #3326 ## Description `TextView` paints its own text color on its root, so it does not inherit the color a `Bubble` sets on its content. In a `Filled` bubble, Markdown is drawn in the theme `foreground` on the `primary` surface: white on white in dark mode. Links (`primary`) disappear too, and code backgrounds (`accent`/`muted`) are tuned for the page, not for a `primary` surface. The first revision added `BubbleVariant::text_view_style(cx)`, which callers passed to every `TextView` in a bubble. That repeated the bubble's variant at each call site and would have needed the same method on every other colored container, so the fix now lives in `TextView` itself: - **Follow the container's text color.** A `TextView` without an explicit `.style()` takes the text color its container sets (`window.text_style().color`, or its own `.text_color()`). - **Same-polarity surfaces** (Secondary, Destructive, a popover): only the body text changes. Links, code and borders keep the theme colors. - **Inverted surfaces** (`Filled`, whose `primary` fill is dark on a light page and light on a dark one): when the inherited color is more than 0.6 away from the style's foreground in Oklab lightness, links, muted text (block quotes), code and inline-code backgrounds, borders, selection, the table header and body backgrounds are all derived from it. The dark flag flips, so todo checkboxes pick the right icon. The installed syntax highlighter is left out, since its colors are made for the page. - **Opt-in in Base, on in Component.** `TextViewDefaults::with_inherit_text_color(true)` enables it. Component turns it on because its Root sets the theme foreground. A Base-only window that sets no root text color would otherwise inherit GPUI's default black. `Bubble` needs no change, since it already sets each variant's text color. ## Screenshot Filled, Secondary and Destructive bubbles with a link, inline code, a block quote, a todo list, a fenced code block and a table, in the light and dark themes, read correctly. Before this change, the Filled bubble's text, link and table were invisible in dark mode. ## Public API ### gpui-base - `gpui_base::TextViewDefaults::with_inherit_text_color(self, inherit: bool) -> Self`: makes text views without an explicit style follow the text color their container sets, adapting every color on an inverted surface. - `gpui_base::TextViewDefaults::inherit_text_color(&self) -> bool`: whether that is enabled. ### gpui-component No items are added. Text views now follow the container's text color by default, because Component installs `with_inherit_text_color(true)`. ## How to Test - `cargo test -p gpui-base -p gpui-component` - `text_color_of_a_matching_surface_only_replaces_the_body_text` and `text_color_of_an_inverted_surface_derives_every_color_from_it` cover the color derivation in both themes. - `text_view_follows_the_text_color_of_its_container` checks that a view under a container with `primary_foreground` text resolves to that color with a flipped dark flag, and that an explicit `.style()` still wins. - Manually: render `Bubble::new().child(TextView::markdown("reply", text))` with links, code, quotes, todos and a table in each variant, and toggle the theme. ## 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. - [x] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) (not platform-specific) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Jason Lee <huacnlee@gmail.com> | 1 天前 | |
docs: Document macOS font-kit requirement (#3339) ## Summary - Document the macOS `font-kit` requirement next to the Getting Started dependency setup, in English and Chinese. - Keep the recommended `gpui-kit` single-dependency setup: Kit already enables `gpui-pre-platform/font-kit`. - Give direct GPUI users copyable dependency entries with the correct feature owner and matching exact snapshot pins, using the site's version variables. - Explain the `NoopTextSystem` failure mode and add a feature-inspection command plus Installation troubleshooting links. Related to #3337. This documents the verified feature wiring; the reporter's manifest and macOS reproduction have not been inspected. ## Verification - `bun run test:docs`: 8 passed, 0 failed. - `python3 script/check-ai docs`: 9 published recipe fragments checked; 6 script tests passed. - `bun script/check-gpui-pin.ts`: passed. - Parsed both locales' TOML examples after version expansion and checked them against the workspace's exact GPUI pins. - Verified `gpui-kit` → `gpui-pre-platform/font-kit` → `gpui-pre-macos/font-kit` against the workspace and released 0.3.7 manifests; inspected the matching upstream macOS backend and `NoopTextSystem` implementation. - Rendered both edited page pairs with the site's Markdown processor; verified expanded versions and both troubleshooting anchors. - `cargo metadata --no-deps` accepted the extracted direct-GPUI manifest. - `git diff --check`: passed. Docs-only change. A full native Rust build, macOS visual reproduction, and complete site build were not run in this Linux environment. AI-assisted documentation change prepared with OpenAI Codex. Co-authored-by: Jason Lee <5518+huacnlee@users.noreply.github.com> | 1 天前 | |
docs: Pace radius hierarchy animation in distinct phases (#3212) ## Summary - Pace the radius hierarchy illustration in distinct outer, inner, and combined stages, with eased transitions and brief holds. - Add a phase label in both light and dark SVGs while retaining a static reduced-motion view. - Shorten the full loop from 14 to 11 seconds. ## Test Plan - Parsed both SVGs and validated animation keyframe counts, durations, and spline segments. - Rendered both SVGs and reviewed a contact sheet of the 11-second, 1920×840 MP4 export. - Ran `git diff --check`. --------- Co-authored-by: Codex <codex@openai.com> | 8 天前 | |
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. | 4 天前 | |
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. | 4 天前 | |
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. | 4 天前 | |
text_view: Follow the container's text color so rich text reads in filled bubbles (#3329) Closes #3326 ## Description `TextView` paints its own text color on its root, so it does not inherit the color a `Bubble` sets on its content. In a `Filled` bubble, Markdown is drawn in the theme `foreground` on the `primary` surface: white on white in dark mode. Links (`primary`) disappear too, and code backgrounds (`accent`/`muted`) are tuned for the page, not for a `primary` surface. The first revision added `BubbleVariant::text_view_style(cx)`, which callers passed to every `TextView` in a bubble. That repeated the bubble's variant at each call site and would have needed the same method on every other colored container, so the fix now lives in `TextView` itself: - **Follow the container's text color.** A `TextView` without an explicit `.style()` takes the text color its container sets (`window.text_style().color`, or its own `.text_color()`). - **Same-polarity surfaces** (Secondary, Destructive, a popover): only the body text changes. Links, code and borders keep the theme colors. - **Inverted surfaces** (`Filled`, whose `primary` fill is dark on a light page and light on a dark one): when the inherited color is more than 0.6 away from the style's foreground in Oklab lightness, links, muted text (block quotes), code and inline-code backgrounds, borders, selection, the table header and body backgrounds are all derived from it. The dark flag flips, so todo checkboxes pick the right icon. The installed syntax highlighter is left out, since its colors are made for the page. - **Opt-in in Base, on in Component.** `TextViewDefaults::with_inherit_text_color(true)` enables it. Component turns it on because its Root sets the theme foreground. A Base-only window that sets no root text color would otherwise inherit GPUI's default black. `Bubble` needs no change, since it already sets each variant's text color. ## Screenshot Filled, Secondary and Destructive bubbles with a link, inline code, a block quote, a todo list, a fenced code block and a table, in the light and dark themes, read correctly. Before this change, the Filled bubble's text, link and table were invisible in dark mode. ## Public API ### gpui-base - `gpui_base::TextViewDefaults::with_inherit_text_color(self, inherit: bool) -> Self`: makes text views without an explicit style follow the text color their container sets, adapting every color on an inverted surface. - `gpui_base::TextViewDefaults::inherit_text_color(&self) -> bool`: whether that is enabled. ### gpui-component No items are added. Text views now follow the container's text color by default, because Component installs `with_inherit_text_color(true)`. ## How to Test - `cargo test -p gpui-base -p gpui-component` - `text_color_of_a_matching_surface_only_replaces_the_body_text` and `text_color_of_an_inverted_surface_derives_every_color_from_it` cover the color derivation in both themes. - `text_view_follows_the_text_color_of_its_container` checks that a view under a container with `primary_foreground` text resolves to that color with a flipped dark flag, and that an explicit `.style()` still wins. - Manually: render `Bubble::new().child(TextView::markdown("reply", text))` with links, code, quotes, todos and a table in each variant, and toggle the theme. ## 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. - [x] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) (not platform-specific) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: Jason Lee <huacnlee@gmail.com> | 1 天前 | |
website: Publish versioned website builds (#3159) ## Summary - publish the latest release at `/` and keep `main` at `/versions/main` - publish release documentation under `/versions/<tag>` with version switching - keep App Stories only on the latest site and mark non-latest versions `noindex` - cache historical version builds by release tag and website build fingerprint Closes #3157 ## Test Plan - `bun run build` with latest-release environment - `bun run test:seo` - `bunx --bun astro build` with `/versions/main/` and `noindex` environment - `bun test website/tests/showcases.test.ts website/tests/showcase-browser.test.ts` - `bash -n script/build-website-versions` --------- Co-authored-by: Codex <codex@openai.com> | 10 天前 | |
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> | 6 天前 | |
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> | 6 天前 | |
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> | 6 天前 | |
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. | 4 天前 | |
website: migrate from VitePress to Astro (#2926) 🤖 Auto-generated by Endless task [#3](https://endless.longbridge-inc.com/projects/gpui-component/tasks/3). Initiated by: huacnlee@longbridge-inc.com Worker agent: Claude Code (claude_code · lboneapi · claude-sonnet-5) ## Commits - **website: migrate from VitePress to Astro 5** Replace the VitePress 2 alpha documentation site with a full Astro 5.x implementation. Preserves all content, routes, CSS design tokens (58 tokens light + dark), dual-language support (EN / zh-CN), and functionality. Key changes: - Astro 5 static output with @astrojs/vue for Vue islands - Tailwind v4 via @tailwindcss/vite (no PostCSS) - 6 Content Collections (docs, shell, base x EN/zh-CN) with dynamic routes - Custom TypeScript sidebar generator replacing vitepress-sidebar - All Vue components ported: useData/withBase/VPFlyout removed, props added - HomeApp.vue: self-contained Vue island (nav + sections + EN/ZH copy) - AppsApp/ContributorsApp/SkillsApp: lightweight Vue islands - Pagefind search (build-time index) with CmdK modal trigger - llms-full.txt static endpoint at /gpui-component/llms-full.txt - WASM dev server middleware ported from VitePress config.mts - 58 CSS tokens copied verbatim, .vp-doc renamed to .doc-content - **chore(website): remove residual .vitepress directory after Astro migration** The .vitepress/ directory was retained from the pre-migration VitePress source. Per PRD §6.3 (maintainability), it must not appear in the migrated website/. 32 files removed. - **feat(review): remove legacy Vue website pages and unused data files** - **feat(dev): update website/, base/[...slug], docs/[...slug]** - **website: update GitHub repo links from gpui-component to gpui-kit** Repo was renamed on GitHub; update all website content and Vue/Astro components that link back to it. - **website: restore a mobile fallback for the docs nav links** The mobile media query hid .site-nav__links (Components/Shell/Base/App Stories plus the entire Resources dropdown) with no replacement, dead-ending phone users in violation of DESIGN.md's own no-hide-without-fallback rule. Add a burger button that toggles a drawer, flatten the Resources dropdown into stacked items on mobile, and drop an unused import/variable found while in the file. - **website: derive the nav language-switch path from base, not a literal** langSwitchHref hardcoded /gpui-component/ in a regex instead of using the base import.meta.env already exposes, so it would silently break if the base path ever changes. - **website: de-duplicate the SITE_URL constant into one module** BaseLayout.astro and DocsLayout.astro each hardcoded the same https://longbridge.github.io/gpui-component literal, so a domain change would need to be edited in two places and could drift. - **website: update DESIGN.md for the Astro file layout** DESIGN.md still described the VitePress theme (.vitepress/theme/style.css, index.vue, apps.vue, the .VPNavBar/.VPNav blur split, repo.data.js, the transformPageData OG hook) after the migration replaced all of it. Point every reference at the real Astro files and describe the docs nav's actual 767px drawer behavior, restored by the previous commit. - **website: fix stale token comment in global.css** The header comment pointed at .vitepress/theme/style.css (deleted) and claimed 58 tokens; the file actually carries 64 (chart-1..5 and shadow-dialog were never in the PRD's manual count, but both existed in the pre-migration source and are correctly present here). - **website: derive base-path literals from BASE_URL instead of hardcoding** sidebar.ts and llms.ts each hardcoded `/gpui-component` as a literal base path, duplicating astro.config.mjs's `base` value. Derive both from import.meta.env.BASE_URL so a future base-path change only needs to touch the config. - **website: pass base path into the favicon inline script via define:vars** The script looked up document.querySelector('base')?.href, but no <base> element exists in the page, so that lookup always failed and the hardcoded /gpui-component/ fallback was the only path ever taken. Pass the already-computed `base` value through define:vars instead of duplicating it as a second literal. - **website: pass the site base path into the WASM dev-server middleware** wasmExamplesDevServer() hardcoded /gpui-component as a third copy of astro.config.mjs's base value. Pass it in as a parameter instead. - **website: derive the contributors-page background image from BASE_URL** The public/contributors.svg background was referenced by a hardcoded /gpui-component/ literal in a Vue SFC <style> block. Compute the URL from import.meta.env.BASE_URL in <script setup> and bind it in with v-bind() instead. - **website: remove unused LanguageSwitcher.vue** Nav.astro implements language switching inline; this component was not imported anywhere and had drifted out of sync (it still used the brittle /gpui-component/ regex replacement that Nav.astro's version was already fixed to avoid). - **website: port the GPUI Kit rebrand (main #2927) into the Astro site** main's rebrand PR landed on VitePress before this branch's Astro migration merged, so port its website-facing substance by hand instead of a literal rebase: base path -> `/`, site domain -> gpui-kit.com with a CNAME, and every "GPUI Component" -> "GPUI Kit" brand mention that the original commit swapped (nav/footer/titles, docs/index intro's new three-crate layout summary, component doc examples, logo/architecture SVGs, OG template). Sentences about the gpui-component crate itself are left untouched, matching upstream's own distinction. Also fixes the WASM dev-server middleware and the two example vite configs for the new empty base prefix, and the docs/index.astro fallback literal that would otherwise have pointed at the old base path. --------- Co-authored-by: Huacnlee (Li Huashun) <huacnlee@longbridge-inc.com> Co-authored-by: Jason Lee <huacnlee@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Codex <codex@openai.com> | 28 天前 |
GPUI Kit website
To install dependencies:
bun install
To run:
bun run dev
This project was created using bun init in bun v1.2.23. Bun is a fast all-in-one JavaScript runtime.
App Stories data
Clone the reviewed app catalog alongside the GPUI Kit checkout:
git clone https://github.com/longbridge/gpui-kit-showcases.git ../../gpui-kit-showcases
Run this command from website/. Alternatively, set SHOWCASES_DIR to the
absolute path of an existing Showcase checkout. Builds read its manifests and
pin image URLs to its current commit. Install the catalog’s locked Bun dependencies
with bun install --frozen-lockfile --cwd ../../gpui-kit-showcases before building. Commit and push new images before publishing.
bun run test:showcases tests catalog validation, grouping, filtering, and sorting.
The release workflow fetches the latest approved catalog automatically; see the
Showcase contribution guide
for app submissions and full-window screenshot instructions.
Writing documentation
The site is published once per version: the latest release at /, main at
/versions/main, and older releases at /versions/<tag>. Pages must keep the
reader in the version they are reading.
- Link to the Markdown file with a relative path, such as
[Entity](./entity.md)or[Dialog](../component/dialog.md). The build resolves it inside the current version. A site-root path such as/docs/entitypoints at the default version and is rejected bybun run test:docs. A Chinese page links the Chinese page when one exists. - Write
{{gpui_pre_version}}for the GPUI snapshot version, in prose, code and links alike, for examplehttps://docs.rs/gpui-pre/{{gpui_pre_version}}/gpui/struct.Window.html. The value comes from thegpuientry in the workspaceCargo.toml, so a snapshot bump updates every page in both locales.bun run test:docsrejects the pinned version written out by hand; a deliberate reference to another snapshot is listed intests/doc-sources.test.ts. - Mark maturity in the frontmatter of a page whose capability is not on
the stable desktop path:
maturity: [preview],[experimental],[showcase-only], or[platform-dependent], combined as needed. Unmarked pages are Stable. The labels render under the title and link to their definitions on the documentation home. Both locales must carry the same value.
bun run test:links checks every link in a finished build, and
bun run test:versioned-examples repeats that check for a build at
/versions/test/, where a link that leaves the version fails.