Commit graph

37876 commits

Author SHA1 Message Date
Bennet Bo Fenner
e585523c8d
agent_ui: Do not show token limit callout for external agents (#54090)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-16 18:35:39 +02:00
Peter Schilling
72a9dcd916
Add 'git: view commit' command palette action (#39009)
adds a 'git: view commit' – accepting a ref (e.g. HEAD, an sha, etc) to
more easily navigate to the git commit view.

<img width="3024" height="1888" alt="Screenshot 2025-09-26 at 21 43
09@2x"
src="https://github.com/user-attachments/assets/c001baec-66c2-46e5-b4a7-f691631f4166"
/>


if a bad ref is entered, the user is shown a generic error

<img width="2734" height="1442" alt="Screenshot 2025-09-27 at 21 04
52@2x"
src="https://github.com/user-attachments/assets/abdbd92d-ef0b-4de9-afb9-e9e52607dfdd"
/>

happy to adjust any of that. also worth noting is the `git: branch`
command UI is a bit nicer, can e.g. show you some metadata on the commit
before you select it, so happy to take it further in that direction if
desired, but thought i'd keep it simple to start.

Release Notes:

- Added view commit command palette action

---------

Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2026-04-16 12:29:58 -04:00
João Soares
11cfb9e330
Ensure language servers from extension properly start on workspace restoration (#51308)
Closes #49877

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:

- Fixed extension language servers not starting when Zed launches with
files already open from a restored session.
2026-04-16 18:26:37 +02:00
KyleBarton
7c45d93e5e
Use remote_user to execute on_create_command and update_content_command (#54020)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53995

Release Notes:

- Improved dev container remote script execution to more closely align
with the reference implementation
2026-04-16 09:00:41 -07:00
Ben Brandt
4c611e297e
agent_ui: Use root thread helpers consistently (#54070)
Replace call sites that treated the active thread as the root thread
with the dedicated `root_thread_view` and `root_thread` helpers, and
simplify `ConversationView` lookups to avoid passing `cx` when it is
not needed.

Also emit token limit telemetry when usage crosses warning or exceeded
thresholds, while avoiding duplicate events for the same session state.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-04-16 17:51:30 +02:00
Richard Feldman
4f6055e015
Hide branch name for main worktree threads in sidebar (#54067)
<img width="337" height="752" alt="Screenshot 2026-04-16 at 9 31 04 AM"
src="https://github.com/user-attachments/assets/174b1eb2-6a3a-46f1-abdf-006e13b80c7a"
/>

Release Notes:

- Agent sidebar now shows worktree and branch names only for linked
worktrees.
2026-04-16 15:48:35 +00:00
Richard Feldman
eb254be084
vim: Don't steal focus from non-pane panels for search commands (#54012)
When the Agent panel (or any dock panel without its own pane) is focused
and a file is open in the center editor, pressing `/` in vim mode would
steal focus to the buffer's search bar instead of staying on the panel.

## Root cause

`Vim::pane()` calls `workspace.focused_pane()`, which falls back to the
center pane when a dock panel without its own `pane()` method is
focused. Vim search commands then open the `BufferSearchBar` on the
center pane and focus it, stealing focus from the panel.

## Fix

Add a guard in `Vim::pane()` that returns `None` when the resolved pane
doesn't actually contain focus. This prevents all vim search/match
commands (`/`, `?`, `n`, `N`, `*`, `#`, etc.) from stealing focus from
non-pane panels.

All 497 vim tests and 253 agent_ui tests pass.

Release Notes:

- Fixed vim search (`/`) stealing focus from the Agent panel when a file
is open in the editor.
2026-04-16 11:47:59 -04:00
krisswee
75fa566511
dev_container: Detect actual buildx availability instead of assuming Docker has it (#53910)
`supports_compose_buildkit()` returned `!self.is_podman()`, assuming
every Docker install has buildx. On setups like Colima where the buildx
CLI plugin isn't installed, this causes builds to fail with "classic
builder doesn't support additional contexts" since `DOCKER_BUILDKIT=1`
alone isn't enough without the plugin.

Now probes for `docker buildx version` at construction time and caches
the result. When buildx isn't found, the existing scratch-image fallback
path (same one Podman uses) kicks in instead.

Closes #53890

Release Notes:

- Fixed dev container builds failing on Docker installations without the
buildx plugin.

---------

Co-authored-by: krisswee <krisswee@users.noreply.github.com>
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
2026-04-16 08:44:48 -07:00
Cameron Mcloughlin
5af494d455
Revert "sidebar: Refactor thread time storage (#53982)" (#54078) 2026-04-16 15:16:50 +00:00
Bennet Bo Fenner
d0fc14c2f6
agent_ui: Remove unused pending_thread_loads from agent panel (#54066)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A
2026-04-16 17:16:48 +02:00
Anthony Eid
ebf2f56a25
gpui: Make property tests deterministic by default (#54004)
### Summary

`#[gpui::property_test]` was non-deterministic because it always used a
random seed with proptest. So it generated different test cases and
scheduler seeds on every run, causing flaky failures. `#[gpui::test]`
doesn't have this problem because it defaults to fixed seeds.

This changes `#[gpui::property_test]` to match: proptest's RNG seed now
defaults to `0` instead of random, so the same cases run every time.
The`$SEED` env var overrides both the scheduler seed and case generation
seed.

Self-Review Checklist:

- [ ] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
2026-04-16 10:37:05 -04:00
Tim Vermeulen
7d365ef26c
editor: Defer rendering the git blame popover until after the markdown is parsed (#52231)
Fixes this single-frame glitch that sometimes occurs when the git blame
popover is rendered before the markdown has been parsed.


https://github.com/user-attachments/assets/d5a322c3-e46f-4597-a10f-a676da57daa7

## Self-Review Checklist

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed a visual glitch where the git blame popover could briefly appear
empty while its markdown content was being parsed
2026-04-16 14:17:39 +00:00
Nathan Sobo
3bb0b494d8
agent_ui: Fix session equality check for reloading retained threads (#53992)
## Summary

Adds three tests that exercise session disassociation ("Session not
found" after reopening a thread). The third test **fails**, reproducing
the bug.

### Root cause

A retained `ConversationView` with a `thread_error` receives
`AgentServersUpdated`, which triggers `reset()` → `close_all_sessions` →
state transitions to `Loading`. When the user then reopens the same
session via `open_thread`, `load_agent_thread`'s `has_session` check
returns `false` (because the retained view is in `Loading` state, not
`Connected`), so a **second** `ConversationView` is created for the same
session. Both views' async load tasks complete and both transition to
`Connected` with the same session ID. When the retained view is later
cleaned up, its `on_release` → `close_all_sessions` removes the session
from the connection, leaving the active view stranded with a dead
session.

### Tests

| Test | Status | What it verifies |
|------|--------|-----------------|
| `test_open_thread_on_visible_session_does_not_disassociate_it` | 
Pass | `load_agent_thread` short-circuits when session is already active
|
| `test_retained_thread_cleanup_does_not_disassociate_reopened_session`
|  Pass | Eviction + reopen cycle works (close-then-reload) |
| `test_retained_thread_reset_race_disassociates_session` |  **Fail** |
Reproduces the race described above |

cc @bennetbo @ConradIrwin

Release Notes:

- N/A

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-04-16 13:26:48 +00:00
Cole Miller
81072ebe1d
Remove flakytest_dev_container_modal_not_dismissed_on_background_click (#54062)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-16 12:57:29 +00:00
Bennet Bo Fenner
dae1b20289
action_log: Fix race condition when committing changes (#53884)
Sometimes the action log would not auto-accept agent edits when
commiting.

Gpt-5.4 identified this race condition:

This fixes a race where `keep_committed_edits` could run after
`head_commit` changed but before the new git base text had been applied,
leaving committed agent edits marked as unreviewed; `ActionLog` now
waits for an explicit `BufferDiffEvent::BaseTextChanged` instead of
inferring readiness from generic `DiffChanged` activity, so it only
accepts edits after the diff base itself is actually updated.

- `ReloadGitState` updates `head_commit` before `ReloadBufferDiffBases`
finishes loading and applying the new HEAD text.
- In that gap, an unrelated `DiffChanged` can fire from a normal diff
recalculation.
- The old logic treated that event as the commit signal and ran
`keep_committed_edits` too early.
- `keep_committed_edits` then read stale diff base text, so it failed to
match the committed agent edits.
- When the real base-text update arrived later, the HEAD had already
been overwritten (`old_head`), and the edits stayed unreviewed.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Fixed an issue where committing agent written code would sometimes not
mark edits as accepted
2026-04-16 12:54:17 +00:00
Smit Barmase
bbf087756c
language_models: Fix Mistral tool use erroring out (#54058)
Closes #52717

Mistral's streaming API sometimes sends `"id": "null"` (the literal
string, not JSON null) in continuation chunks for tool calls. Our stream
handler treated this as a valid ID, overwriting the real tool call ID
from the first chunk. When the corrupted ID was sent back in the next
request, Mistral's API rejected it with "Tool call id has to be defined
in serving mode."

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed issue where Mistral models erroring out with "Tool call id has
to be defined" when using tools.
2026-04-16 18:21:02 +05:30
Kirill Bulatov
053803099b
Show better tab tooltip for multi buffers (#54060)
Before, no tooltip was shown at all, now we show the full, not trimmed
text:

<img width="437" height="80" alt="image"
src="https://github.com/user-attachments/assets/f8220e04-e036-4175-b048-697e22504a6a"
/>


Release Notes:

- Show better tab tooltip for multi buffers
2026-04-16 15:46:33 +03:00
Bennet Bo Fenner
ff108c89d7
acp: Fix close session not found error (#54009)
Follow up to #53999

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A
2026-04-16 14:11:06 +02:00
Bennet Bo Fenner
36557bd0b5
workspace: Fix incorrect project paths on welcome page (#54056)
Fixes an issue where we would only display the first path of the project
on the welcome page

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed an issue where incorrect project paths would be displayed on the
welcome tab
2026-04-16 11:49:00 +00:00
Bennet Bo Fenner
d2639099bb
workspace: Open new projects in the same window by default (#54057)
This makes it so that `cmd-o` adds the project to the multi-workspace,
rather than opening a new window

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-16 11:48:44 +00:00
Danilo Leal
96332a2c2f
Fix click events leaking through the announcement toast (#54053)
Quick fix here to prevent any click events in the announcement toast
itself to leak through whatever is behind it.

Release Notes:

- N/A
2026-04-16 11:12:32 +00:00
Cameron Mcloughlin
db8b702921
sidebar: Refactor thread time storage (#53982) 2026-04-16 12:03:30 +01:00
Bennet Bo Fenner
ce78317a55
Fix project group not being removed from sidebar when closing project (#54052)
This fixes an issue where closing a project would not remove it from the
sidebar, e.g.


https://github.com/user-attachments/assets/286abf53-061c-4ff4-8697-41babd73191a

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-16 11:01:16 +00:00
Neel
49d3570a99
editor: Fix forward word movement over inline folds in agent panel (#53979)
Changed the offset-to-display-point conversion in `find_boundary_point`
and `find_boundary_trail` to use `Bias::Right`, so positions inside
folds map to the fold end, letting the cursor skip past folded ranges.

Closes #53978.

Release Notes:

- Fixed Ctrl+Right and related word movement shortcuts failing to skip
over folded ranges and `@mention` chips
2026-04-16 11:25:08 +01:00
Danilo Leal
579dc927cc
sidebar: Fix ellipsis menu options (#54030)
Just a quick follow up to
https://github.com/zed-industries/zed/pull/54025 where I incorrectly
wrapped the "Remove Project" button in a conditional, when it should be
available at all times.

<img width="300" height="246" alt="Screenshot 2026-04-16 at 12  00@2x"
src="https://github.com/user-attachments/assets/4218d24f-fe15-43d3-8d60-5c9d83d90d7e"
/>

Release Notes:

- N/A
2026-04-16 10:16:58 +00:00
Smit Barmase
6a3111de79
gpui_linux: Fix X11 keyboard state synchronization (#53903)
Closes #49329

This area has regressed a few times across #34514, #35361, and #44234.
The problem is that we were still mixing XKB client-side and server-side
state handling on the same `xkb::State`.

On X11, `XkbStateNotify` already keeps the client state synchronized.
But the key event path was still doing two extra things on the shared
`state.xkb`:
  - calling `update_key()`
  - rewriting the same state from `KeyPress` / `KeyRelease.state`

The libxkbcommon X11 docs say that `XkbStateNotify` is the more accurate
source of truth for X11 clients and that there is no need to call
`xkb_state_update_key()` once the client state is synchronized. This
follows the libxkbcommon X11 client model more closely by keeping
persistent state notify-driven and using event-local state only for
lookup.

This PR fixes that by:
- removing the remaining `update_key()` calls from X11 `KeyPress` /
`KeyRelease`
- keeping the long-lived `state.xkb` driven only by `XkbStateNotify` and
keymap notifications
  - creating a temporary event-local `xkb::State` for per-event lookup

I also added regression tests around the historical bugs in this area:
  - #14282: Caps Lock / Neo 2 regressions from the earlier X11 fixes
  - #31193: German key resolution
- #26468: `space` with Cyrillic and Czech layouts / non-locked layout
groups
  - #40678: macro-style shifted input like `Shift+]`

Release Notes:

- Fixed issue on Linux X11 where you coundn't input space key in some
cases.
2026-04-16 10:46:47 +03:00
Matthew Chisolm
f9662f484d
feedback: Add action for listing installed extensions (#48664)
Closes #48037

- [X] Tests or screenshots needed? <--- Let me know if tests are needed
- [ ] Code Reviewed
- [X] Manual QA

Release Notes:

- Added action to copy installed extensions to clipboard

<details><summary>Picture of Action</summary><img width="1924"
height="1044" alt="Screenshot from 2026-03-03 01-00-22"
src="https://github.com/user-attachments/assets/6abe9587-968d-48e9-a3b7-80602d26375d"
/></details>
<details><summary>Picture of Modal</summary>
<img width="1920" height="1080" alt="Screenshot from 2026-03-03
01-00-35"
src="https://github.com/user-attachments/assets/b30a743d-3324-4b01-a92c-a0476908e050"
/>
</details>
<details><summary>Picture of Docs</summary>
<img width="1936" height="1066" alt="Screenshot from 2026-03-03
01-19-53"
src="https://github.com/user-attachments/assets/40dab840-c5e2-4248-b7a6-1924f0b6610c"
/>
</details>

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-04-16 07:45:38 +00:00
David Alecrim
0ddc7d0666
Fix crash and enable GIF animation in markdown preview (#53459)
Closes #53426

Fixes a crash when previewing markdown with GIFs, and enables GIF
animation in the preview panel.

Two issues: a partially-decoded GIF could crash the preview, and GIFs in
markdown previews never animated.

The fix for GIFs with empty comment extensions (`21 fe 00`) was
implemented upstream in the `image-gif` crate (image-rs/image-gif#228)
and released as `gif 0.14.2`. This PR bumps the dependency so those GIFs
now render correctly in the markdown preview without any further changes
to Zed itself.

## Screenshot
Left=VS Code
Right=Zed


https://github.com/user-attachments/assets/7950abbc-1a79-4f01-a425-9595aa688325

Release Notes:

- Fixed a crash in certain scenarios when opening Markdown Preview with
GIFs.
- Added GIF animation support for Markdown Preview.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-04-16 10:44:00 +03:00
Pablo Soares
920ead54b7
docs: Exemplify a Django app debug configuration (#53545)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
2026-04-16 07:05:25 +00:00
Ægir
c2b61de873
themes: Make One Dark syntax.link_text.font_style italic (#53220)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53219 

Updates the built-in **One Dark** theme so `syntax.link_text.font_style`
is `italic`, matching other built-in themes.

Release Notes:

- Fixed One Dark `link_text` not italic
2026-04-16 09:12:04 +03:00
Justin Su
5101b3aa6a
Revert "Add ctrl-enter keybind (macOS) to type newline in search bars" (#52436)
Reverts #50420

This was made redundant by
https://github.com/zed-industries/zed/pull/50783.

According to [this
comment](https://github.com/zed-industries/zed/pull/50783#issuecomment-4002827488),
the ctrl-enter keybind from the `Editor && mode == auto_height` context
applies to the search bars now.

Release Notes:

- N/A
2026-04-16 09:11:51 +03:00
Pratik Karki
b6b2b63370
Gate Format Selections on whether the active formatter can actually format ranges (#53178)
## What Changed

- compute range-format support from formatter configuration and
language-server capabilities
- show `Format Selections` only when at least one selected buffer has a
range-capable formatter
- keep Prettier-supported range formatting available without depending
on LSP support
- hide the action for formatter modes that cannot honor selections, such
as external-command and code-action formatters
- keep the action handler safe by rechecking support and returning early
when range formatting is unavailable
- restrict capability checks to the servers actually registered for the
current buffer
- add regression coverage for supported, unsupported, and mixed-server
cases
- document when `Format Selections` is available in both action docs and
user docs


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #25796

Release Notes:
- Improved `Format Selections` so it is only shown when the active
formatter supports range formatting.

Testing I did:

Here are the formatters I used:
<img width="829" height="434" alt="Screenshot_20260405_102047"
src="https://github.com/user-attachments/assets/cae4a238-277e-4188-873f-189e9f098699"
/>

Note: I've chosen three formatters:
1. Prettier, which supports range formatting
2. clangd (LSP) which also supports range formatting
3. gopls which do not support range formatting


[Screencast_20260405_102431.webm](https://github.com/user-attachments/assets/69ce3f95-0b73-46a0-853d-3b5be6329dde)

---------

Signed-off-by: Pratik Karki <pratik@prertik.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-04-16 09:11:22 +03:00
Eric Holk
a9a77f1c6e
agent_ui: Replace stale draft thread when selected agent changes (#54023)
## Problem

When creating a new agent thread from the sidebar's **+** button (or via
the `NewThread` / `NewThreadInGroup` actions), the panel always returned
the cached draft thread — even if the user had since switched to a
different agent. This meant the new thread would use the wrong agent
(typically the default Zed Agent instead of the last-used external
agent).

The root cause was in `ensure_draft()`: it cached the draft and returned
it unconditionally on subsequent calls without checking whether its
agent
matched the current `selected_agent`.

Meanwhile, **cmd-n from within the agent panel** dispatched
`NewExternalAgentThread`, which calls `create_thread()` — this always
creates a fresh thread with the correct `selected_agent`, so it worked
fine.

## Fix

`ensure_draft()` now compares the cached draft's agent against the
desired agent. When they differ and the draft's editor is empty, the
stale draft is discarded and a new one is created with the correct
agent.
If the draft has user-typed content, it is preserved to avoid losing
work.

## Test

Added `test_draft_replaced_when_selected_agent_changes` which verifies:
1. A draft created with `NativeAgent` gets replaced when
`selected_agent`
   changes to a custom agent
2. The replacement draft uses the correct agent
3. Calling `activate_draft` again with the same agent reuses the cached
   draft (no unnecessary replacement)

The test fails without the fix (returns the stale `NativeAgent` draft)
and passes with it.

Release Notes:

- N/A
2026-04-15 22:47:25 -07:00
Chris Biscardi
3a897d940c
Taffy nightly lint updates (#54037)
Fixes a new lint on nightly, which crops up in gpui's taffy integration
[error logs from main's
build](https://github.com/zed-industries/zed/actions/runs/24491477164/job/71577226631).

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- N/A
2026-04-15 22:17:22 -07:00
Hamza Paracha
f722e2fb2f
Respect proxy settings when fetching JSON schemas (#53954)
This fixes #53819.

JSON schema downloads were still going through the JSON language server
without picking up Zed's configured proxy. On networks that require the
proxy, that made schema fetches fail even though the rest of the app
could connect normally.

This passes the proxy setting through to the JSON language server
configuration so schema requests follow the same network path as the
rest of Zed.

## Test plan
- `rustfmt --edition 2024 crates/languages/src/json.rs`
- `git diff --check -- crates/languages/src/json.rs`

Release Notes:

- Fixed JSON schema downloads ignoring Zed's proxy setting.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-04-15 21:06:21 -07:00
Danilo Leal
d066ff0ae5
sidebar: Add some UI adjustments (#54025)
- Don't ever swap to the ellipsis menu with the close icon button; we
now always have it
- Promote the "focus the last workspace" feature through the ellipsis
menu
- Add a unified tooltip for the thread item to show relevant thread
metadata
- Use a different icon for accessing the now "all threads" view
- Simplifies how we display archived threads
- Bonus: Don't display the "open in new window" button in currently
active worktrees (in dedicated picker)
- Bonus: Use the "main worktree" label for whenever we're mentioning the
original worktree

Release Notes:

- N/A
2026-04-15 22:08:28 -03:00
Danilo Leal
74de476364
Simplify parallel agents onboarding (#53854)
- Adds a status toast to the announcement banner for surfacing the
layout revert option
- Removes the agent panel banner

A good chunk of the diff here was because I touched up the status toast
component API a little bit.

Release Notes:

- N/A
2026-04-15 21:51:15 -03:00
Eric Holk
41b6d9333c
Make cross-channel import tests work on any release channel branch (#54022)
The cross-channel import tests from #54002 hardcoded
`ReleaseChannel::Preview` and `ReleaseChannel::Nightly` as source
channels. When those tests run on a release branch (where the current
channel is Preview or Nightly), the import skips the current channel,
causing test failures.

This adds a `foreign_channels` helper that dynamically picks two
channels that are neither the current one nor Dev, making the tests work
on main, preview, nightly, or any other branch.

Discovered while cherry-picking #54002 to v0.233.x (#54021).

Release Notes:

- N/A
2026-04-15 17:19:59 -07:00
Eric Holk
a8decbea13
agent: Add ability to import threads from other channels (#54002)
Users have been testing the threads sidebar on Nightly and Preview but
once we release the feature we expect many of these users to move back
to Stable. As it stands right now, they would lose the threads they'd
been working on. This PR adds a way to import these threads.

- [x] Add `agent: import threads from other channels` action to the
command palette.
- This can be always available for users that switch between channels
regularly.
- [x] Add tests for import behavior
- [x] Add a button that disappears after using it to make importing more
discoverable for when users first switch.

Release Notes:

- Added an action to the command palette that imports threads from other
Zed release channels into the current one.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-04-15 23:25:44 +00:00
Max Brunsfeld
443c7c1cb1
Avoid showing draft threads in the sidebar or storing them in the database (#54014)
Release Notes:

- N/A
2026-04-15 15:23:43 -07:00
Anthony Eid
d60b55675b
agent: Support remote archive thread git operations (#54001)
### Summary

This PR implements remote support for git store operations that the
sidebar's archive thread checkpoint/restore featured relied on. This was
the second to last blocker for remote usage of this feature.

I also made a shared backend between `update_ref` and `delete_ref`
called `edit_ref` because they run the same git command and this allowed
for some code unification.

#### Remote Git Operations 
- `Repository::update_ref`
- `Repository::delete_ref`
- `Repository::repair_worktrees`
- `Repository::create_archive_checkpoint`
- `Repository::restore_archive_checkpoint`


#### Follow up

`agent_ui::thread_worktree_archive::find_or_create_repository` needs to
be made aware of the remote machine that the repository it's searching
for is on. Once that is completed, we can get the correct repo when
archiving a remote thread and the flow should work without any problems.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-15 19:55:37 +00:00
Richard Feldman
e2780f6fbd
Only archive worktrees that Zed created (#53991)
When archiving a thread, we now check whether the linked worktree lives
inside the Zed-managed worktrees directory (configured via
`git.worktree_directory`). If it doesn't — meaning the user created it
themselves outside of Zed — we skip both the directory deletion and the
`git worktree remove`, leaving it untouched.

Previously, archiving a thread would delete *any* linked worktree
associated with the thread's folder paths, even ones the user had
created manually via `git worktree add`.

Release Notes:

- Fixed archiving an agent thread deleting linked git worktrees the user
created outside of Zed's managed worktrees directory.
2026-04-15 15:54:03 -04:00
Anthony Eid
bf25cb1835
agent: Inline worktree info fetching to remove expects in agent_panel (#54006)
The `worktree_receivers` and `worktree_directory_setting` were pre
computed as `Option`s before the async block, then unwrapped with
`expect` inside the match arm that always had them set. Move the
fetching directly into the `WorktreeCreationArgs::New` arm so the values
are never optional, replacing the panicking expects with error
propagation via `?`.

The expects were guaranteed to never panic because the `Some` codepath
used the same branching logic of the unwrap codepath later on. This
change is just for future maintainability though.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-15 15:25:07 -04:00
Max Brunsfeld
86725ae359
Make flexible dock widths more closely match full-height pane splits (#53998)
This fixes a but that @ConradIrwin noticed where the flexible docks
widths are weirdly dependent on the width of the active pane.

Release Notes:

- Fixed a bug where flexible docks resized incorrectly in certain cases.
- Fixed an issue where resizing a flexible-width panel in the left dock
would also resize fixed-width panels.
2026-04-15 11:50:48 -07:00
Finn Evers
a49cdce32b
ci: Add merge queue trigger (#51833)
This adds a merge queue trigger to our main CI job to allow for a merge
queue which runs a subset of our tests before merging to main.

With this setup, merging to main would probably take around one to two
minutes and would not catch all but definitely most issues. We could
extend it here though as we'd like.

Release Notes:

- N/A
2026-04-15 20:44:46 +02:00
Bennet Bo Fenner
dfe6b878bd
agent: Fix session not found error (#53999)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-15 18:15:37 +00:00
Sven Vollmar
aaafc146b5
Add "New Center Terminal" to context menu (#53702)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added "New Center Terminal" button to window context menu

"New Terminal" only opens a new terminal window in the dedicated
terminal view, while "New Center Terminal" opens a new terminal in the
currently active view.

"+"/"New..." context menu
<img width="487" height="318" alt="Screenshot_20260411_184840"
src="https://github.com/user-attachments/assets/7c1597cf-5638-4d76-a486-537033cb8da5"
/>

Right click context menu
<img width="422" height="386" alt="Screenshot_20260411_184904"
src="https://github.com/user-attachments/assets/4e557e21-8839-4226-b704-87e37fbd8f46"
/>
2026-04-15 17:38:47 +00:00
KyleBarton
c2736df3c7
Respect runArgs for dev containers (#53931)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53503

Release Notes:

- Fixed gap where runArgs were not respected when specified in
devcontainer.json
2026-04-15 08:24:34 -07:00
Joseph T. Lyons
13185d68ff
Bump Zed to v0.234 (#53986)
Release Notes:

- N/A
2026-04-15 15:08:53 +00:00
Bennet Bo Fenner
e79b3c6dac
settings: Follow up to #48003 (#53985)
This is a follow up to #48003, instead of removing the settings key in a
new migration, we can prevent the existing one from adding settings in
the first place.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-04-15 15:03:53 +00:00