Pack
GPUI desktop apps in Rust
Rules and findings for building desktop user interfaces in Rust with GPUI through the gpui-kit crates: project setup, application structure, styling, async work, performance, Windows specifics, embedding in a host, testing, packaging and how to check what is current. Written against gpui-kit 0.7.0 on gpui-pre 0.3.7.
- Id
gpui- For
- AI coding agents and developers working on a Rust desktop application built with GPUI, stand-alone or embedded in a host application's window, on Windows in particular.
- Roots
- 16
- Pinned roots
gpui/overview,gpui/working-method- Version
Content
The 16 roots in the pack
Each root is listed with its key, title, kind and first two sentences. The full text is saved in the biome at installation, and an agent reads it with the root's key.
- gpui/overviewKind: knowledgePinned
GPUI starter pack, overview
This pack holds the rules and findings for building desktop user interfaces in Rust with GPUI (the UI framework from the Zed editor) through the gpui-kit crates. Load this root first, then only the roots the task needs.
- gpui/working-methodKind: rulePinned
Working method for agents in a GPUI project
These rules apply to every session in a GPUI repository. The reason for each rule stands in the same sentence.
- gpui/project-setupKind: architecture
GPUI project setup, workspace and Cargo configuration
How to set up a GPUI project: the dependency, the toolchain, the workspace layout and the build profiles. Depend on gpui-kit from crates.io.
- gpui/application-structureKind: architecture
GPUI application structure, windows, views, state, actions and key bindings
API names below are those of gpui-kit 0.7.0 on gpui-pre 0.3.7. On another version, check gpui/staying-current first.
- gpui/ui-stylingKind: design
GPUI UI and styling conventions
Conventions for components, tokens, layout and element ids in a GPUI app. Where a convention depends on the size of the app, the section says so.
- gpui/interactionKind: practice
GPUI interaction rules, focus, keys, drags, popups and menus
Rules for focus, keys, drags, popups and menus, written against gpui-kit 0.7.0. GPUI's div already turns Enter and Space into a click on a focused element.
- gpui/canvas-drawingKind: practice
GPUI canvas, measuring, paths, images and CPU rasterising
API shapes below are as used on gpui-pre 0.3.7. Argument lists changed between versions before, so check gpui/staying-current when the version differs.
- gpui/async-backgroundKind: practice
GPUI async and background work
The UI thread draws the window. Everything that waits (a backend call, decoding, another process, a slow renderer) runs elsewhere and hands its result back to the view.
- gpui/performanceKind: rule
GPUI performance rules
Rules for keeping a GPUI app responsive. Measure per phase before changing anything.
- gpui/platform-windowsKind: knowledge
GPUI on Windows, platform notes
How GPUI behaves on Windows 11 and how to work with it. GPUI draws with DirectX 11 through DirectComposition by default.
- gpui/embedding-in-a-hostKind: architecture
GPUI embedded in a host application's window
How to run GPUI inside a window that a host application owns. The host owns the window and pumps the message loop, and GPUI draws into a child window of it.
- gpui/testingKind: practice
GPUI testing, image tests and verification levels
Most of this root applies to an app with a test suite and a design-system crate. A small tool without a test suite can have a --selftest flag that goes through its functions with the same functions the buttons use and writes a log beside the exe.
- gpui/live-rigKind: practice
Driving a running GPUI app, automation channel and window messages
Two ways to try the real app without taking the user's mouse and keyboard: an automation channel built into the app, and window messages posted to its window. An app with an automation channel keeps the window-message functions as a reserve for what depends on Windows' own path.
- gpui/packaging-releaseKind: operations
GPUI packaging and release
Three ways to ship, by what is handed over. A single-window tool can be handed over as a folder that is copied to another Windows computer as it is.
- gpui/lessons-learnedKind: knowledge
GPUI lessons learned
The entries that cost the most time, on gpui-kit 0.7.0 and gpui-pre 0.3.7. Each says what holds and why it is not obvious.
- gpui/staying-currentKind: practice
Staying current with GPUI, versions and where to check
An agent's built-in knowledge of GPUI goes stale quickly. GPUI is pre-1.0 (its own crate documentation says breaking changes are common between versions), the crates in this pack are released often, and API names from memory may belong to another revision of Zed's gpui than the one the project builds.
Installing
Install the pack in a biome
- A person installs the pack in the app.
- An agent installs it with the operation
pack_installand the idgpui.
The installed roots are ordinary roots in the biome, and the pinned ones are given to every session when it starts.
Read more
- How installing, removing and exporting work: Packs.
- The pack operations: the documentation.
More packs
The other built-in packs
Full-stack web service starter
Rules and patterns for a web service built on Next.js App Router, React, TypeScript, StyleX, Prisma on PostgreSQL and Better Auth, run in Docker behind a tunnel on a server of one's own: architecture, accounts, design, legal pages for a Swedish operator, deploy and verification, backup, alerts, vendors, payments and working method.
Show the roots in the packPineMail, PineKeep and PineKey for agents
How an AI agent sends mail and manages domains and mailboxes with PineMail, stores backups and files in PineKeep buckets over S3, and uses secrets through PineKey without reading them. Includes one pattern that combines the three.
Show the roots in the pack