Skip to content

Show thread title and status in sidebar workspace entries#48645

Merged
mikayla-maki merged 9 commits intonew-multi-workspacefrom
sidebar-info
Feb 8, 2026
Merged

Show thread title and status in sidebar workspace entries#48645
mikayla-maki merged 9 commits intonew-multi-workspacefrom
sidebar-info

Conversation

@rtfeldman
Copy link
Contributor

@rtfeldman rtfeldman commented Feb 6, 2026

Summary

Adds per-workspace thread info display to the multi-workspace sidebar, showing the last active agent thread's title and current status below each workspace entry.

Changes

  • Thread status icons: Spinning LoadCircle for running, blue checkmark for completed, red X for errored
  • Thread title: Shown in smaller muted text below each workspace name
  • Top-aligned folder icons: Folder icons now align to the top of the entry rather than centering vertically
  • Close workspace button: X button appears on hover to remove a workspace from the window
  • Real-time updates: AgentDiff subscribes to AcpThread events (Stopped, Error, TitleUpdated, NewEntry) and pushes status updates to MultiWorkspace, which the sidebar observes

Architecture

  • AgentThreadStatus and AgentThreadInfo types live on MultiWorkspace (workspace crate)
  • Sidebar reads thread info from MultiWorkspace during entry rebuild (no new cross-crate deps for sidebar)
  • AgentDiff::handle_acp_thread_event pushes thread info to MultiWorkspace via window.root::<MultiWorkspace>()

Visual test

$ cargo run -p zed --bin zed_visual_test_runner --features visual-tests

Then, to see it:

$ open target/visual_tests/multi_workspace_sidebar_open.png

Here's how it looks:

multi_workspace_sidebar_open

Release Notes:

  • Changed the Agent Panel so that the Active Thread is restored on restart.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 6, 2026
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Feb 6, 2026
@mikayla-maki mikayla-maki self-assigned this Feb 6, 2026
rtfeldman and others added 7 commits February 7, 2026 16:32
Adds a visual test that renders the MultiWorkspace sidebar open with:
- Two active workspaces (private-test-remote, zed)
- Four recent projects (tiny-project, font-kit, ideas, tmp)

Changes:
- sidebar: Add test-support feature with set_test_recent_projects helper
- zed Cargo.toml: Add sidebar/test-support to visual-tests feature
- visual_test_runner: Add run_multi_workspace_sidebar_visual_tests
- Add AgentThreadStatus (Running/Completed/Errored) and AgentThreadInfo
  to MultiWorkspace for per-workspace thread tracking
- Render thread info below each active workspace in the sidebar:
  spinning LoadCircle for running, blue check for completed, red X for errored
- Top-align folder icons in workspace entries
- Add close workspace button (X) on hover for each workspace entry
- Add remove_workspace method to MultiWorkspace
- Subscribe to AcpThread events in AgentDiff to push real-time thread
  status updates (title, stopped, error) to MultiWorkspace
- Update visual test with Completed and Running thread states
- Remove AgentThreadInfo/AgentThreadStatus types and workspace_thread_infos
  HashMap from MultiWorkspace
- Remove push_thread_info_to_multi_workspace and
  push_thread_error_to_multi_workspace from AgentDiff
- Add acp_thread and agent_ui dependencies to sidebar crate
- Sidebar now queries AgentPanel.active_agent_thread() directly to read
  thread title and status from AcpThread
- Add AgentPanelEvent::ActiveViewChanged so sidebar subscribes to targeted
  events instead of observing all panel notifications
- Sidebar subscribes to AcpThread entities (via cx.observe_in) for status
  changes and to AgentPanel events for thread switches
- Move visual test thread info setup to sidebar.set_test_thread_info()
When an agent thread is active in a workspace, its title is now persisted
to the KVP store under a single key ('sidebar-last-thread-titles') as a
JSON map keyed by sorted worktree paths. When loading recent projects in
the sidebar, thread titles are looked up from this map and displayed as
a muted subtitle beneath the project name.

- Add db and serde_json dependencies to sidebar crate
- Add sorted_paths_key() helper for canonical path-based map keys
- persist_thread_titles() writes on every queue_refresh when thread info changes
- set_recent_projects() reads the map and populates recent_project_thread_titles
- Extract render_project_row() shared by workspace and recent project entries
- Add set_test_recent_project_thread_title() for visual test injection
- Update visual test to show thread titles on two recent project entries
AgentPanel now observes the active AcpServerView entity. When the server
connection completes and the view transitions from Loading to Connected,
the AcpServerView calls cx.notify(). The AgentPanel's observation picks
this up and re-emits AgentPanelEvent::ActiveViewChanged, which the
sidebar subscribes to. This closes the timing gap where the sidebar
would refresh before the AcpThread existed and never learn about it.
@mikayla-maki mikayla-maki marked this pull request as ready for review February 8, 2026 02:47
@mikayla-maki mikayla-maki merged commit 4feeffc into new-multi-workspace Feb 8, 2026
6 checks passed
@mikayla-maki mikayla-maki deleted the sidebar-info branch February 8, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants