← Overview Stage 3 / Workspace & Project
Stage 3 of 7

Workspace & Project

The Workspace manages the visual shell — panes, docks, tabs. The Project owns all persistent state: buffers, language servers, worktrees, and collaboration state.

Window Layout Structure

A Zed window is a Workspace. Inside it, docks hold panels (file tree, terminal, AI panel) and the center holds a tree of Panes, each of which can be split horizontally or vertically.

Left Dock
Status Bar / Toolbar
PaneGroup (center)
Pane | Pane
tabs of Editor items
Right Dock
Bottom Dock (terminal, diagnostics…)
Workspace Struct
Workspace workspace.rs:1353
pub struct Workspace { center: PaneGroup, // recursive pane layout left_dock: Entity<Dock>, bottom_dock: Entity<Dock>, right_dock: Entity<Dock>, panes: Vec<Entity<Pane>>, active_pane: Entity<Pane>, // currently focused project: Entity<Project>, status_bar: Entity<StatusBar>, modal_layer: Entity<ModalLayer>, notifications: Notifications, }

Actions dispatched from GPUI arrive at the active pane, which forwards them to its active item. If the item handles the action, it stops there; otherwise it bubbles back up to the Workspace.

Pane — Tab Container

A Pane (pane.rs) is a tab strip backed by a list of items — anything that implements the Item trait: Editor, terminal views, diff views, etc. The active item fills the pane's content area.

Routing rule: when GPUI dispatches an action, the focus chain is: focused element inside active item → active item → pane → workspace → global handlers. The first handler wins.
Project Struct
Project project.rs:213
pub struct Project { worktree_store: Entity<WorktreeStore>, // file system trees buffer_store: Entity<BufferStore>, // loaded buffers cache lsp_store: Entity<LspStore>, // language server manager git_store: Entity<GitStore>, task_store: Entity<TaskStore>, languages: Arc<LanguageRegistry>, fs: Arc<dyn Fs>, // real or fake FS (tests) collaborators: HashMap<PeerId, Collaborator>, }
File-Open Data Flow

When a user opens a file (e.g. from the file tree or command palette), here is the path from disk to rendered text:

1
Workspace::open_path()
The workspace resolves the path against its Project and asks for a buffer.
2
Project::open_buffer()
project.rsBufferStore::get_or_load(). If the buffer is already cached, it's returned immediately; otherwise the file is read from Fs, a new Buffer entity is created, and language detection runs.
3
Language server notified
LspStore receives a BufferOpened event and sends textDocument/didOpen to each applicable language server.
4
Editor created & placed in Pane
Workspace wraps the buffer in a MultiBuffer, creates an Editor entity, and adds it to the active Pane. The pane activates it, GPUI renders the editor.
Code References