Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Mentioned in #47258
Release Notes:
- Added hotkey options and actions for toggling light and dark theme.
- Add default keymap as `cmd/ctrl+k cmd/ctrl+shift+t`
Follow up to https://github.com/zed-industries/zed/pull/49807
This PR fixes the merge conflict notification by making it appear only
once per a given set of conflicted paths, as opposed to showing every
time the `ConflictsUpdated` or `StatusesChanged` even would fire.
Release Notes:
- N/A
* [x] Put back persistence of sidebar open state
* [x] when agent panel is docked right, put sidebar on the right side
* [x] remove stale entries from `SidebarsByWindow`
Release Notes:
- N/A
---------
Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This PR makes the "Open Project" button in the sidebar also open the
"Recent Projects" popover, while also anchoring that popover to the the
button on the sidebar instead.
Release Notes:
- N/A
Fixes#50835
### Problem :
The "View AI Settings" button on the Welcome page was always rendered
regardless of the disable_ai setting. This made it visible (and
non-functional) for users who had AI disabled, which was confusing.
### Fix :
- Adds an optional visibility: Option<fn(&App) -> bool> predicate field
to SectionEntry
- At render time, Section::render uses filter_map to skip entries whose
predicate returns false.
- The "View AI Settings" entry is given a predicate that checks
!DisableAiSettings::get_global(cx).disable_ai, matching the same pattern
used in `title_bar.rs` and `quick_action_bar.rs`.
- All other entries have visibility: None, meaning they are always shown
— no behaviour change for them.
### Video :
[Screencast from 2026-03-06
20-18-43.webm](https://github.com/user-attachments/assets/cbfab423-3ef3-41dd-a9ab-cbae055eef6e)
Release Notes:
- Fixed the "View AI Settings" button being visible on the Welcome page
despite AI features being disabled in settings.
This will help with test times (in some cases), as nextest cannot figure
out whether a given rdep is actually an alive edge of the build graph
Closes #ISSUE
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Before the panel resize wouldn't take into account the width of the
sidebar and the right dock could push the left dock on resize too.
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Co-authored-by: Cameron \<cameron.studdstreet@gmail.com\>
Release Notes:
- N/A
Closes#49800
Adds `handle_drop` to Item & ItemHandle, which allows an active item in
a pane to consume drop events before the pane does.
Release Notes:
- terminal: Fix drag-and-drop not working in vertical terminal panels
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
---------
Co-authored-by: Eric <eric@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: John Tur <john-tur@outlook.com>
Fixes#50526
Fixes https://github.com/zed-industries/zed/issues/42841
Fixes https://github.com/zed-industries/zed/issues/49875
### Summary
Fix `autosave: on_focus_change` not firing reliably when leaving editors
with nested focus targets (e.g. multibuffer/search flows).
### Root cause
Autosave on focus change was wired to `on_blur` of the item focus
handle.
`on_blur` only fires when that exact handle is the focused leaf, which
misses common descendant-to-outside focus transitions.
## Fix
In `crates/workspace/src/item.rs`, switch autosave subscription from:
- `cx.on_blur(&self.read(cx).focus_handle(cx), ...)`
to:
- `cx.on_focus_out(&self.read(cx).focus_handle(cx), ...)`
Autosave behavior and guards remain unchanged:
- only for `AutosaveSetting::OnFocusChange`
- only when focus truly left the item (`!contains_focused`)
- skipped when modal is active (`!has_active_modal`)
### Impact
- Fixes missed autosaves when moving focus from item descendants to
other UI (terminal, file tree, search inputs, etc.).
- No behavior change for other autosave modes (`off`, `after_delay`,
`on_window_change`).
### Video
[Screencast from 2026-03-04
15-23-07.webm](https://github.com/user-attachments/assets/81135999-320f-40f3-9673-7c0460e5a14a)
Release Notes:
- Fixed an issue where `"autosave": "on_focus_change"` would not
reliably work in multibuffers.
---------
Co-authored-by: MrSubidubi <finn@zed.dev>
Closes#50624
The empty bottom section of the project panel showed a horizontal
scrollbar on hover, but scrolling didn't work there. Added a scroll
wheel handler to the blank area that forwards scroll events to the
uniform list's scroll handle, making both horizontal and vertical
scrolling work from anywhere in the panel.
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zedindustries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- Fixed project panel empty area showing a non-functional scrollbar;
scrolling now works from anywhere in the panel
---------
Co-authored-by: MrSubidubi <finn@zed.dev>
Closes#50701
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
When pinned tabs are present, activating an unpinned tab passed the
absolute tab index to the scroll handle, which only contains unpinned
tabs. This caused the scroll-into-view to silently fail.
Subtract `pinned_tab_count` from the index so it maps to the correct
child in the unpinned tabs scroll container.
Release Notes:
- Fixed tab bar not reliably scrolling to the active tab when pinned
tabs are present.
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Now that MultiWorkspace is the root view, actions bound to the
`Workspace` key context wouldn't be dispatched when `Workspace` is not
in the key context stack (e.g. when the sidebar is focused). To fix
this, the `Workspace` key context and action handlers are moved up to
the MultiWorkspace rendering layer. This avoids introducing a new key
context and the keymap migration that would require.
This PR also moves modal rendering up a layer so modals are centered
within the window (MultiWorkspace element) instead of the Workspace
element.
### Before
<img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/233a0b75-47a1-423a-8394-c6a1b50fb991"
/>
### After
<img width="3248" height="2122" alt="image"
src="https://github.com/user-attachments/assets/9c51c839-e524-4ef8-afc9-9429b028def0"
/>
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
---------
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
We don't want to show the sidebar to users if they have `disable_ai`
enabled because it's an AI focused feature. In the future if we add non
AI functionality to the sidebar we'll reenable it.
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Fixes ZED-596
Release Notes:
- Fixed a panic in editor::GoToDefinitionSplit if you managed to close
the current pane before the definitions were resolved
## Summary
Add `workspace::ActivateLastPane` so users can bind a shortcut (for
example `cmd-9`) to focus the last pane.
## Why
Today, the closest option is `workspace::ActivatePane` with an index
(for example `8`), but that has side effects: when the index does not
exist, it creates/splits panes (`activate_pane_at_index` fallback).
`ActivateLastPane` gives a stable, no-surprises target: focus the
rightmost/last pane in current pane order, never create a new pane.
## Context
This capability has been requested by users before:
- https://github.com/zed-industries/zed/issues/17503#event-22959656321
## Prior art
VS Code exposes explicit editor-group focus commands and index-based
focus patterns (e.g. `workbench.action.focusSecondEditorGroup` ...
`focusEighthEditorGroup`) in its workbench commands:
-
https://github.com/microsoft/vscode/blob/main/src/vs/workbench/browser/parts/editor/editorCommands.ts#L675-L724
Zed already follows numbered pane focus in default keymaps
(`ActivatePane` 1..9 on macOS/Linux/Windows), so adding a dedicated
"last pane" action is a small, natural extension:
- `assets/keymaps/default-macos.json`
- `assets/keymaps/default-linux.json`
- `assets/keymaps/default-windows.json`
## Change
- Added `workspace::ActivateLastPane`
- Implemented `Workspace::activate_last_pane(...)`
- Wired action handler in workspace listeners
- Added `test_activate_last_pane`
## Validation
- `cargo test -p workspace test_activate_last_pane -- --nocapture`
- `cargo test -p workspace test_pane_navigation -- --nocapture`
- `cargo fmt --all -- --check`
## Risk
Low: focus-only behavior, no layout/data changes, no default keymap
changes.
Release Notes:
- Added `workspace::ActivateLastPane` action for keybindings that focus
the last pane.
---------
Co-authored-by: xj <gh-xj@users.noreply.github.com>
Closes#40602
### Summary
This PR ensures that active debug lines only open in a single pane and
new active debug lines are added to the most recent pane that contained
an active debug line. This fixes a bug where Zed could go to the active
debug line file and location in every pane a user had open, even if that
pane was focused on a different file.
I fixed this by storing the `entity_id` of the pane containing the most
recently active debug line on `BreakpointStore`, this is consistent with
where the selected stack frame is stored. I used an `entity_id` instead
of a strong type to avoid circular dependencies. Whenever an active
debug line is being set in the editor or by the debugger it now checks
if there's a specific pane it should be set in, and after setting the
line it updates `BreakpointStore` state.
I also added a new method on the `workspace::Item` trait called `fn
pane_changed(&mut self, new_pane_id: EntityId, cx: &mut Context<Self>)`
To enable `Editor` to update `BreakpointStore`'s active debug line pane
id whenever an `Editor` is moved to a new pane.
### PR review TODO list
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- debugger: Fix bug where active debug lines could be set in the wrong
pane
The OpenFiles action was always using the system file picker dialog,
ignoring the use_system_path_prompts setting. This adds a
workspace-level handler that calls prompt_for_open_path, which respects
the setting, instead of falling through to the global handler.
Closes#46386
Release Notes:
- Fixed "workspace: open files" not respecting "use_system_path_prompts"
setting
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Add `agent_worktree_directory` to `GitSettings` for configuring where
agent worktrees are stored (default: Zed data dir). Remove `Copy` derive
from `GitSettings`/`GitContentSettings` (incompatible with String field)
and fix downstream `.as_ref().unwrap()` call sites.
Define `AgentGitWorktreeInfo` (branch, worktree_path, base_ref) and add
it to `DbThread` + `DbThreadMetadata` for persistence and session list
display.
Closes AI-33
Release Notes:
- N/A
Fix several issues with multi-workspace serialization and restoration
that caused sidebar workspaces to not fully restore after Zed restart.
## Changes
### 1. Resilient restoration — don't let one failing workspace kill the
rest
In `restore_multiworkspace`, the loop restoring each workspace in a
group used `?` on every `.await`. If any single workspace failed (e.g. a
DB read error, item deserialization failure), all remaining workspaces
were silently abandoned. Changed to log-and-continue so each workspace
is attempted independently. `restore_multiworkspace` now returns a
`MultiWorkspaceRestoreResult` containing both the window handle and a
list of errors, which the caller logs individually.
### 2. Proper serialization at lifecycle events
- **`create_workspace`** now assigns a database ID (via `next_id()`) and
writes a `session_id`/`window_id` binding so newly-created workspaces
can be persisted and restored.
- **`remove_workspace`** now deletes the removed workspace from the DB
(preventing zombie restoration) and serializes the updated
multi-workspace state.
- **`activate`** now only serializes when the active workspace actually
changes, and uses the new `set_active_workspace` helper to keep the
ordering correct (set index *then* serialize, not the other way around).
- The `serialize` method now stores its task in `_serialize_task`
instead of fire-and-forget detaching, enabling `flush_serialization` to
await it.
### 3. Flush serialization on quit
The quit handler now calls `flush_serialization` on every workspace and
multi-workspace before `cx.quit()`, bypassing the 200ms throttle to
ensure all `session_id`/`window_id` values are written to the database
before the process exits.
### 4. Await pending tasks on app quit
`MultiWorkspace` now registers an `on_app_quit` handler that awaits all
in-flight serialization, creation, and removal tasks within GPUI's
shutdown timeout. The existing `on_release` handler continues to detach
tasks as a safety net for non-quit window closes, matching the pattern
used by `Room`.
### 5. Track workspace serialization task
`Workspace::serialize_workspace` now stores the actual serialization
task in `_serialize_workspace_task` instead of detaching it, so
`flush_serialization` can cancel any pending throttle *and* await the
in-flight write.
### 6. New persistence helper
Added `set_session_binding` query to update a workspace's `session_id`
and `window_id` in one shot, used by `create_workspace` to bind
newly-created workspaces to the current session.
### 7. Tests
Added tests covering:
- `flush_serialization` completing before quit
- `create_workspace` assigning a DB ID and serializing the active
workspace ID
- Removal of a workspace deleting it from the DB and updating
multi-workspace state
- Restoration resilience when individual workspaces fail
Closes AI-37
(No release notes because this is still feature-flagged.)
Release Notes:
- N/A
---------
Co-authored-by: Anthony Eid <anthony@zed.dev>
Refreshing the queue was causing hangs on debug builds, so this is a
short term fix until we rework how the sidebar gets its data.
Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for
functions where this is the sole generic parameter.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Before this PR we wouldn't always serialize workspaces when a
mutliworkspace adds/removes a workspace. This PR fixes this by adding a
test and calling serialization in remove
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- N/A
Re-lands https://github.com/zed-industries/zed/pull/48891, which was
reverted due to conflicts with multi-workspace.
Before you mark this PR as ready for review, make sure that you have:
- [X] Added a solid test coverage and/or screenshots from doing manual
testing
- [X] Done a self-review taking into account security and performance
aspects
Release Notes:
- N/A
Closes https://github.com/zed-industries/zed/issues/46926
## Description:
- Fixes the missing right border on pinned tabs when
`show_pinned_tabs_in_separate_row` is enabled.
The two-row tab bar layout was missing the border element that visually
separates the pinned tabs row. This border was present in the single-row
layout but was not added when implementing the two-row layout.
## Steps to reproduce
1. Enable `"tab_bar": { "show_pinned_tabs_in_separate_row": true }` in
settings
2. Open multiple files
3. Pin at least one tab (right-click → Pin Tab)
4. Notice pinned tabs are missing right-hand side border
**Before (bug):**
<img width="1060" height="186" alt="image"
src="https://github.com/user-attachments/assets/7d18f24d-a51b-4f13-8410-a15fa92e1bb3"
/>
**After (fixed):**
<img width="863" height="69" alt="image"
src="https://github.com/user-attachments/assets/3354e809-b298-49a1-b16a-871caef67176"
/>
## Test plan
- [x] Follow reproduction steps above and verify the border now appears
- [x] Verify border appears immediately (not just after drag-and-drop)
- [x] Verify single-row layout still works correctly when setting is
disabled
- [x] Added automated test `test_separate_pinned_row_has_right_border`
### Additional fix: Drag-and-drop to pinned tabs bar
During implementation, discovered that we couldn't drag tabs to the end
of the pinned tabs bar. This PR also adds:
- A drop target at the end of the pinned tabs row
- Proper pinning behavior when dropping unpinned tabs to the pinned area
- Keeps the dragged tab active after drop
Release Notes:
- Fixed the missing right border on pinned tabs when
`show_pinned_tabs_in_separate_row` is enabled.
- Fixed drop target at the end of the pinned tabs row
- Fixed pinning behavior when dropping unpinned tabs to the pinned area
- Fixed case when the dragged tab was not active after drop (when enable
`"tab_bar": { "show_pinned_tabs_in_separate_row": true }` in settings)
---------
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Derive collapsed state from `Editor.has_any_buffer_folded` instead of
tracking it separately, removing redundant `ResultsCollapsedChanged` event
and stale `is_collapsed`/`results_collapsed` fields.
Closes#48734
Release Notes:
- Fixed collapse/expand all button in buffer search and project search
not syncing correctly when toggling individual file sections
---------
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Closes#49083
This issue was caused by remote projects on the welcome page sharing the
same ID, as they all used the "Remote Project" label. Additionally, the
tab size was hardcoded to 10, which caused the tab navigation to break.
This PR assigns unique IDs and removes the hardcoded limitation.
- [x] locally checked the click behavior
- [x] self-review done
Release Notes:
- Fixed Welcome page remote projects not responding correctly when
clicked.
Closes https://github.com/zed-industries/zed/issues/33430
Two changes:
1. Fix `observe_global_in` to not permanently remove observers when the
window is transiently unavailable (e.g. temporarily taken during a
nested update). Previously this returned false and silently removed the
observer from the subscriber set. Now it checks whether the entity is
actually dropped before removing — if the entity is alive but the window
is just unavailable, it keeps the observer alive.
2. Extend `dock_to_preserve` in `handle_pane_focused` to also preserve
docks whose active panel has focus, not just docks whose panel's inner
pane matches the focused pane. Panels like `AgentPanel` don't implement
`pane()` (only panels like `TerminalPanel` that contain panes do), so
the existing preservation logic never identified the agent panel's dock
as needing protection. This meant that when the agent panel was zoomed
and a center pane received focus (e.g. during macOS window activation
events), `dismiss_zoomed_items_to_reveal` would close the dock, making
the panel disappear unexpectedly.
Closes AI-16
Release Notes:
- Fixed agent panel unexpectedly closing when zoomed and the window
regains focus.
When the agent panel (or any dock panel) is open and
fullscreened/zoomed, switching to a different workspace in the sidebar
and then switching back caused the panel to close. It should remain both
open and zoomed.
The root cause was in `MultiWorkspace::focus_active_workspace()` — it
always focused the center pane of the active workspace. This triggered
`dismiss_zoomed_items_to_reveal(None)`, which closed any zoomed dock
panel (the same behavior as when a user intentionally clicks away from a
zoomed panel).
The fix checks if any dock has a zoomed panel before deciding what to
focus. If a zoomed panel exists, it focuses that panel instead of the
center pane, preventing the dismiss logic from firing.
Closes AI-22
Release Notes:
- Fixed panels losing their fullscreen state when switching between
workspaces.
Remove the `AgentsPanel` (from the `agent_ui_v2` crate) and the utility
pane infrastructure from the codebase.
The Agents Panel was a separate panel gated behind the `agent-v2`
feature flag that was redundant with the existing Agent Panel. Utility
panes were a layout concept (secondary panes next to the editor,
separate from dock panels) whose only consumer was `AgentThreadPane` in
the Agents Panel.
### Changes
- Deleted the entire `agent_ui_v2` crate (`agents_panel.rs`,
`agent_thread_pane.rs`)
- Deleted `workspace/src/utility_pane.rs`
- Removed `UtilityPane`, `UtilityPaneHandle`, `UtilityPanePosition`,
`MinimizePane`, `ClosePane` from `workspace/src/dock.rs`
- Removed all utility pane fields, methods, and render blocks from
`workspace.rs`
- Removed all aside toggle code from `pane.rs` and `pane_group.rs`
- Removed `agents_panel_dock` setting from agent settings and
`default.json`
- Removed all `agent_ui_v2` references from `main.rs`, `zed.rs`, and
Cargo.toml files
- Cleaned up test code in `tool_permissions.rs` and `agent_ui.rs`
Closes AI-17
(No release notes because this was all feature-flagged.)
Release Notes:
- N/A