Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Zed 6 min read Case study mediumAdept

Zed Weekly: #25

Zed is rewriting its UI framework as GPUI 2 and porting the whole editor onto it before open-sourcing, trading feature work for better ergonomics while keeping GPUI 1's performance. All state lives in an AppContext that acts like an application-specific heap: Model<T> handles are dereferenced through a context, and models emit and subscribe to events. View<T> wraps models whose types implement a Render trait that returns element trees. Components, Tailwind-style styling helpers, a color-scale-based theme system and a new layout engine and executor round out the design. Bottleneck crates (project, workspace, editor) made the port largely serial, so the team leaned on Rust's type system and Zed's collaborative editing to pair on it, with roughly a third to half of the app ported after two weeks.

Assumes: Rust traits and genericsUI framework concepts

Related posts

  • Why the big rewrite?

    Zed easyNovice

    Zed rewrote its Rust UI framework from GPUI 1 to GPUI 2 because the original design blocked fast UI work: a Flutter-style constraints-down/sizes-up layout model, styles split between Rust element code and TypeScript-generated JSON "themes" loaded at runtime, model code entangled with presentation (a legacy of an early Electron/JSON architecture), and weakly typed geometry (raw f32s and usizes). GPUI 2 adopts a Tailwind/Flexbox-inspired Rust DSL with stronger types and one-directional ownership. The migration ran incrementally: GPUI 2 first ran as a prototype on top of GPUI 1, then crates were duplicated (e.g. project_panel2) with the old copies frozen except for bug fixes, which kept the option of sharing code until the final switch.

  • This Week at Zed Industries: #16

    Zed mediumAdept

    Zed has started using its new channels feature internally, where members can message, talk, share screens and co-edit projects, and plans to use it to stream development and host office hours once the editor is open-sourced. Alongside this, GPUI layout and styling are being reworked with the taffy layout engine and Tailwind-like style methods. Antonio proposes `auto` and `prettier` options for the formatter setting. Mikayla walks through a new composable Component primitive for GPUI in Rust: a builder-style trait consumed into an Element, a StylableComponent trait with associated Style/Output types, and the Typestate pattern using `()` as an unbound style, so wrappers like Hover and Toggle compose type-safely and rendering an unstyled component fails at compile time.

  • Zed Weekly: #22

    Zed easyNovice

    Zed team members report weekly progress: GPUI is being rewritten with a ported Metal renderer that uses plane-split for primitive draw ordering, multi-threaded entity access, and a MainThread<T: Context> wrapper so native UI APIs are only called from the main thread. Channels are being reworked to separate chat-style communication from DAG-structured project notes, with unread indicators, notifications, public channels and deep links on the way. Julia split markdown parsing from rendering for completion documentation, avoiding flicker when grammars load late and speeding up rendering. Other work covers Vue LSP and tree-sitter support, CPU and memory telemetry, and a fix for a follow-loop bug in collaboration.

  • This Week at Zed Industries: #8

    Zed easyNovice

    Zed's weekly team update covers work on the AI assistant panel (multi-cursor, message splitting, saved conversations), voice collaboration via GPUI, and inlay hint latency and caching. Performance fixes include lazily loading gitignored and out-of-project symlinked directories to cut memory, CPU and collaboration sync costs, and only updating the mouse cursor style when it changes, which removes an expensive per-frame cursor rasterization in the immediate-mode GPUI. The team also started work on an embedding and indexing engine for semantic navigation, and is considering moving GPUI from Flutter-style specialized elements to an HTML/CSS-like single element with runtime styling to shorten Rust compile feedback loops.

  • Zed Weekly: #27

    Zed mediumAdept

    GPUI, Zed's UI framework, settled on its core view traits: `Render` builds a view from a mutable reference each frame, `RenderOnce` builds composable elements by consuming them, and `#[derive(IntoElement)]` lets custom components be passed straight to `div().child(...)`. gpui2 now sizes UI in `rem` units tied to a new `ui_font_size` setting (default 16px, on a 4px grid), so the interface scales independently of buffer font size, though sub-pixel sizes remain unresolved. On the worktree side, a `file_scan_exclusions` setting now hides files like `.DS_Store`, and project search can reach gitignored files. Extending the fuzzy file finder to gitignored trees is still open, because eagerly scanning and watching huge `node_modules` or `target` directories is costly.

The quest for software engineering knowledge.

Look:
Layout: