zed/crates/gpui
Eric Holk 8eeff17e96
Cherry picks for v0.233.x preview release (#54368)
Cherry picks for the next v0.233.x preview release, focused on sidebar
and agent panel fixes and improvements. Built incrementally so CI can
validate as we go.

### Cherry-picked PRs

Listed in the order they were applied (chronological merge order on
`main`). `[x]` = applied on this branch; `[ ]` = todo; `[-]` = skipped.

- [x] #53956 — sidebar: Remove View More batched thread expansion
- [x] #53998 — Make flexible dock widths more closely match full-height
pane splits
- [x] #54006 — agent: Inline worktree info fetching to remove expects in
agent_panel
- [x] #53854 — Simplify parallel agents onboarding
- [x] #54025 — sidebar: Add some UI adjustments
- [-] #53982 — sidebar: Refactor thread time storage (skipped — paired
with revert #54078, net zero)
- [-] #54078 — Revert "sidebar: Refactor thread time storage (#53982)"
(skipped — paired with #53982, net zero)
- [x] #54090 — agent_ui: Do not show token limit callout for external
agents
- [x] #54126 — agent_ui: Adjust thread item component and fix thread
switcher
- [x] #54075 — Rename Archive view to Thread History
- [x] #54125 — agent: Auto-select user model when there's no default
- [x] #54128 — sidebar: Fix cmd-click in the header not taking to the
last workspace
- [x] #54178 — agent_ui: Fix UI issues with activity bar
- [x] #54187 — agent_ui: Only surface the regenerate title item for the
Zed agent
- [x] #54205 — agent: Clean up old remove worktree manage folder code
- [x] #54207 — Add list of open workspaces to the project group menu in
the sidebar
- [x] #54198 — Fix remote projects not appearing in the sidebar after
adding them to the window
- [x] #54206 — Feature flag overrides
- [-] #53100 — workspace: Skip read-only paths when choosing default
save location (skipped for this release)
- [-] #54183 — Move the worktree picker to the title bar + make it
always visible (skipped — very large refactor, deferred to a future
release)
- [x] #54314 — agent_ui: Add `show thread metadata` action
- [x] #54317 — sidebar: Open project header ellipsis menu on right-click
- [x] #54316 — agent_ui: Add setting for turning off content max-width
- [x] #54256 — Add support for Netpbm image previews
- [x] #54320 — sidebar: Consistently set `interacted_at`
- [x] #54318 — agent: Respect favorite model settings and sync UI
changes back to settings
- [x] #54348 — Always use `ArchiveSelectedThread` action for archiving
threads
- [x] #54353 — agent: When opening a remote thread check that the linked
worktree path exists
- [x] #54365 — Avoid constantly scrolling thread history to top as agent
generates

### Conflict resolution notes

- **#53956** — On `v0.233.x`, `sidebar_tests.rs` still contained
`test_search_finds_threads_hidden_behind_view_more`, which exercised
behavior #53956 removes. Deleted the test along with the rest of the
View More functionality; no changes to the substance of the
cherry-picked patch.
- **#53998** — Supersedes standalone cherry-pick PR #54366 (which can be
closed).
- **#53982 / #54078** — Skipped both. They form a refactor-and-revert
pair on `main` with net zero change. Since `v0.233.x` already has #54173
("sidebar: Fix sidebar thread times") applied on top of the pre-#53982
state, pulling both in would be churn with no end-state difference.
- **#54025** — `crates/ui/src/components/ai/thread_item.rs`: accepted
incoming side for the `worktree_tooltip_title` removal and converted the
patch's `match (wt.kind, wt.branch_name)` structure back to `v0.233.x`'s
`match wt.kind` structure (the #54067 tuple match isn't on this branch).
Dropped the `linked_worktree_count` local after it became unused.
- **#54207** — `crates/sidebar/src/sidebar.rs`: accepted incoming side
for the project group menu restructure. This removes the
`show_multi_project_entries` gate around the "Remove Project" entry that
#54025 added — matching `main`'s state at #54207's parent.
- **#54314** — `crates/agent_ui/src/agent_panel.rs`: merged both sides
of two import conflicts, adding `ShowAllSidebarThreadMetadata` and
`ShowThreadMetadata` alongside the
`CreateWorktree`/`NewWorktreeBranchTarget`/`SwitchWorktree`/`ToggleWorktreeSelector`
imports that remain on `v0.233.x` (#54183 isn't here). Also merged the
`anyhow` and `chrono` `use` lines.
- **#54183** — Skipped. It's a 3,379/4,702-line refactor that moves the
worktree picker from the agent panel to the title bar. Too risky for a
preview release; should be handled as a dedicated PR if/when we want it
on `v0.233.x`.

Release Notes:

- Fixed a bug where flexible docks resized incorrectly in certain cases.
([#53998](https://github.com/zed-industries/zed/pull/53998))
- Fixed an issue where resizing a flexible-width panel in the left dock
would also resize fixed-width panels.
([#53998](https://github.com/zed-industries/zed/pull/53998))
- Agent: Fixed worktree and branch labels not showing up in the thread
switcher. ([#54126](https://github.com/zed-industries/zed/pull/54126))
- Agent: Fixed the thread switcher not selecting on hover.
([#54126](https://github.com/zed-industries/zed/pull/54126))
- Renamed the threads Archive view to Thread History and updated its
icon to a clock.
([#54075](https://github.com/zed-industries/zed/pull/54075))
- Agent: Automatically select a model when there's no selected model or
configured default.
([#54125](https://github.com/zed-industries/zed/pull/54125))
- Agent: Fixed a bug where cmd-clicking on the project header wouldn't
actually take you to the last active workspace.
([#54128](https://github.com/zed-industries/zed/pull/54128))
- Agent: Added a new `limit_content_width` setting in the agent panel
that allows turning off the content max-width limit.
([#54316](https://github.com/zed-industries/zed/pull/54316))
- Added support for PNM image previews (`.pbm`, `.ppm`, `.pgm`).
([#54256](https://github.com/zed-industries/zed/pull/54256))
- Agent favorite models now remember and restore per-model thinking,
effort level, and fast mode preferences.
([#54318](https://github.com/zed-industries/zed/pull/54318))

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
Co-authored-by: Vinícius Dutra <dutravinisousa2@usp.br>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-04-20 17:05:51 -07:00
..
docs docs: Change render function's return type (#27229) 2025-03-20 22:48:22 -06:00
examples gpui: Implement audible system bell (#47531) 2026-04-01 02:50:01 +00:00
resources/windows Adjust Windows fusion manifests (#41408) 2025-10-28 20:21:31 -04:00
src Cherry picks for v0.233.x preview release (#54368) 2026-04-20 17:05:51 -07:00
tests Use serde 1.0.221 instead of serde_derive hackery (#38137) 2025-09-14 14:01:04 +02:00
build.rs GPUI on the web (#50228) 2026-02-26 18:36:50 +01:00
Cargo.toml Unify dirs dependency (#53775) 2026-04-13 13:55:29 +03:00
LICENSE-APACHE chore: Add crate licenses. (#4158) 2024-01-23 16:56:22 +01:00
README.md Revert "Fix link for Ownership and data flow in GPUI's README.md" (#47630) 2026-01-26 08:30:33 +00:00

Welcome to GPUI!

GPUI is a hybrid immediate and retained mode, GPU accelerated, UI framework for Rust, designed to support a wide variety of applications.

Getting Started

GPUI is still in active development as we work on the Zed code editor, and is still pre-1.0. There will often be breaking changes between versions. You'll also need to use the latest version of stable Rust and be on macOS or Linux. Add the following to your Cargo.toml:

gpui = { version = "*" }

Everything in GPUI starts with an Application. You can create one with Application::new(), and kick off your application by passing a callback to Application::run(). Inside this callback, you can create a new window with App::open_window(), and register your first root view. See gpui.rs for a complete example.

Dependencies

GPUI has various system dependencies that it needs in order to work.

macOS

On macOS, GPUI uses Metal for rendering. In order to use Metal, you need to do the following:

  • Install Xcode from the macOS App Store, or from the Apple Developer website. Note this requires a developer account.

Ensure you launch Xcode after installing, and install the macOS components, which is the default option.

  • Install Xcode command line tools

    xcode-select --install
    
  • Ensure that the Xcode command line tools are using your newly installed copy of Xcode:

    sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    

The Big Picture

GPUI offers three different registers depending on your needs:

  • State management and communication with Entity's. Whenever you need to store application state that communicates between different parts of your application, you'll want to use GPUI's entities. Entities are owned by GPUI and are only accessible through an owned smart pointer similar to an Rc. See the app::context module for more information.

  • High level, declarative UI with views. All UI in GPUI starts with a view. A view is simply an Entity that can be rendered, by implementing the Render trait. At the start of each frame, GPUI will call this render method on the root view of a given window. Views build a tree of elements, lay them out and style them with a tailwind-style API, and then give them to GPUI to turn into pixels. See the div element for an all purpose swiss-army knife of rendering.

  • Low level, imperative UI with Elements. Elements are the building blocks of UI in GPUI, and they provide a nice wrapper around an imperative API that provides as much flexibility and control as you need. Elements have total control over how they and their child elements are rendered and can be used for making efficient views into large lists, implement custom layouting for a code editor, and anything else you can think of. See the element module for more information.

Each of these registers has one or more corresponding contexts that can be accessed from all GPUI services. This context is your main interface to GPUI, and is used extensively throughout the framework.

Other Resources

In addition to the systems above, GPUI provides a range of smaller services that are useful for building complex applications:

  • Actions are user-defined structs that are used for converting keystrokes into logical operations in your UI. Use this for implementing keyboard shortcuts, such as cmd-q. See the action module for more information.

  • Platform services, such as quit the app or open a URL are available as methods on the app::App.

  • An async executor that is integrated with the platform's event loop. See the executor module for more information.,

  • The [gpui::test] macro provides a convenient way to write tests for your GPUI applications. Tests also have their own kind of context, a TestAppContext which provides ways of simulating common platform input. See app::test_context and test modules for more details.

Currently, the best way to learn about these APIs is to read the Zed source code or drop a question in the Zed Discord. We're working on improving the documentation, creating more examples, and will be publishing more guides to GPUI on our blog.