From 104918a0781fae8730fc726cfbe311d6f6d36e47 Mon Sep 17 00:00:00 2001 From: kirillDevPro <113171057+kirillDevPro@users.noreply.github.com> Date: Fri, 25 Sep 2026 07:14:46 +0200 Subject: [PATCH] docs(gpui): point examples at the moon-gpui package The examples index still said to run them from a Zed checkout with `cargo run -p gpui`. That package is not in this workspace, so the command fails. The index also omitted a11y and gpu_canvas, which cargo lists as examples. The same wrong package name was in three example module comments. --- crates/moon-gpui/examples/README.md | 9 +++++++-- crates/moon-gpui/examples/a11y.rs | 4 ++-- crates/moon-gpui/examples/move_entity_between_windows.rs | 2 +- crates/moon-gpui/examples/testing.rs | 4 ++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/crates/moon-gpui/examples/README.md b/crates/moon-gpui/examples/README.md index 7fc75e0..f6cd414 100644 --- a/crates/moon-gpui/examples/README.md +++ b/crates/moon-gpui/examples/README.md @@ -1,9 +1,10 @@ # GPUI Examples -Examples can be run from the Zed repository root: +Examples can be run from the MoonUI repository root. The package name is +`moon-gpui`; there is no package named `gpui`. ```sh -cargo run -p gpui --example hello_world +cargo run -p moon-gpui --example hello_world ``` ## Where to start @@ -15,6 +16,8 @@ cargo run -p gpui --example hello_world - `uniform_list` shows how to render a simple virtualized list. - `testing` demonstrates `#[gpui::test]`, `TestAppContext`, actions, focus, and window-based tests. +- `a11y` demonstrates AccessKit roles and actions on a heading, a spin button, + a switch, and a list. ## Layout and styling @@ -47,6 +50,8 @@ cargo run -p gpui --example hello_world - `image_gallery` demonstrates image caching and loading remote images. - `image_loading` shows image loading states and asset loading. - `painting` demonstrates custom drawing with paths and canvas. +- `gpu_canvas` shows a `gpu_canvas` element that requests a present on a timer + without dirtying the view. - `svg` shows SVG rendering. ## Windows and application behavior diff --git a/crates/moon-gpui/examples/a11y.rs b/crates/moon-gpui/examples/a11y.rs index c406f4d..e52e6d6 100644 --- a/crates/moon-gpui/examples/a11y.rs +++ b/crates/moon-gpui/examples/a11y.rs @@ -1,8 +1,8 @@ //! Accessibility (AccessKit) demo app. //! -//! Run with: `cargo run -p gpui --example a11y` +//! Run with: `cargo run -p moon-gpui --example a11y` //! -//! Or on Linux: `cargo run -p gpui --features gpui_platform/wayland,gpui_platform/x11 --example a11y` +//! Or on Linux: `cargo run -p moon-gpui --features gpui_platform/wayland,gpui_platform/x11 --example a11y` //! //! This app uses GPUI's accessibility APIs to attach structured information to //! the element tree, which allows assistive technology to see and interact with diff --git a/crates/moon-gpui/examples/move_entity_between_windows.rs b/crates/moon-gpui/examples/move_entity_between_windows.rs index 6ad3c8f..3b0a542 100644 --- a/crates/moon-gpui/examples/move_entity_between_windows.rs +++ b/crates/moon-gpui/examples/move_entity_between_windows.rs @@ -4,7 +4,7 @@ //! entity's *current* window rather than the window it was in at //! registration time. //! -//! To run: cargo run -p gpui --example move_entity_between_windows +//! To run: cargo run -p moon-gpui --example move_entity_between_windows #![cfg_attr(target_family = "wasm", no_main)] diff --git a/crates/moon-gpui/examples/testing.rs b/crates/moon-gpui/examples/testing.rs index f6e1579..312bec0 100644 --- a/crates/moon-gpui/examples/testing.rs +++ b/crates/moon-gpui/examples/testing.rs @@ -4,8 +4,8 @@ //! When run normally, this displays an interactive counter window. //! The tests below demonstrate various GPUI testing patterns. //! -//! Run the app: cargo run -p gpui --example testing -//! Run tests: cargo test -p gpui --example testing --features test-support +//! Run the app: cargo run -p moon-gpui --example testing +//! Run tests: cargo test -p moon-gpui --example testing --features test-support use gpui::{ App, Bounds, Context, FocusHandle, Focusable, Render, Task, Window, WindowBounds,