gpui-ai

Navigation

Command search

Keyboard-first command discovery backed by stable application IDs.

Command search — gpui-ai

Starts when it scrolls into view

Pop out

NORD FROST · DARK · RADIUS 6/10 · BASE 16PX · SHADOW

Running the real component, compiled to WebAssembly. The frame is 387 px tall, which is what this story measures at the demo width in the default type size — a narrower column or a theme that changes that size will wrap it differently.
Story
command-search
Demo height
387 px
Events
CommandSearchEvent

Code

Cut from the gallery story this page runs. The states above change what the demo is given rather than how it is built, so they share this code.

crates/gallery/src/gallery.rsOpen in the galleryImplementation
let ready = cx.new(|cx| CommandSearch::new("gallery-command-ready", window, cx));
ready.update(cx, |search, cx| {
    search.set_items(
        [
            CommandSearchItem::new("supplier-report", "Open report")
                .subtitle("Supplier pricing and margin summary")
                .keywords(["cost", "margin"])
                .shortcut("Ctrl+R"),
            CommandSearchItem::new("delivery-calendar", "Open delivery calendar")
                .subtitle("Review upcoming supplier windows")
                .keywords(["schedule", "dates"])
                .shortcut("Ctrl+D"),
            CommandSearchItem::new("duplicate-report", "Open report")
                .subtitle("Inventory risk summary")
                .keywords(["stock", "risk"]),
            CommandSearchItem::new("offline-sync", "Sync offline catalog")
                .subtitle("Unavailable while disconnected")
                .disabled(true),
        ],
        window,
        cx,
    );
});

Events and ownership

Who owns the state
CommandSearch renders state supplied by the application; it does not own durable work.
What it emits
Interactive intent is reported through the typed CommandSearchEvent contract and stable application IDs.
What it means
Keyboard-first command discovery backed by stable application IDs.
Overflow and motion
Growing content remains reachable in a bounded vertical surface; reduced motion preserves a useful state.

Event types

  • CommandSearchEvent

What the demo does and does not show

The demo above is the same Rust as the native component, compiled to WebAssembly and drawn on a WebGPU canvas — not a mock-up, a recording, or a re-implementation. What it paints is what the component paints: layout, colour from the live theme, and motion.

The live browser specimen requires WebGPU; the native component remains the authoritative runtime.

A canvas cannot stand in for the platform, so treat everything that goes through the operating system as unproven here: keyboard handling and shortcuts, screen reader semantics, text input and IME, the clipboard, file drops, and the frame rate you would get on your own GPU. Judge those in a native build. If your browser has no WebGPU, the frame says so rather than showing an empty box.