Commit log

ee24860 Fix create_worktree callsite types after merge with main

Click to expand commit body
The git_store::Repository::create_worktree wrapper takes String (not
Option<String>), but the merge left test callsites passing Some(...).

Richard Feldman created

63a83e4 Fix formatting in repository.rs

Richard Feldman created

3ff9d44 Merge remote-tracking branch 'origin/main' into AI-112/delete-worktree-on-archive

Richard Feldman created

5a9c763 nix: Fix build on x86_64-linux (#52917)

Click to expand commit body
Release Notes:

- N/A

Jakub Konka created

ed97a04 agent_ui: Fix collapsing bug with thinking blocks in auto-mode (#52916)

Click to expand commit body
Quick follow up to https://github.com/zed-industries/zed/pull/52874
where expanded thinking blocks, when in auto-mode, wouldn't collapse
again.

Release Notes:

- N/A

Danilo Leal created

84984be Correct TOCTOU comment to say it narrows rather than closes the race

Click to expand commit body
The re-check reduces the window but doesn't eliminate it, since state
can still change at subsequent await points during the commit/archive
sequence.

Richard Feldman created

2fabe30 Improve branch switch fallback with clearer warnings

Click to expand commit body
When the branch can't be switched to (e.g. it's checked out in another
worktree), the create_branch fallback also fails if the branch already
exists. Instead of silently discarding this error, log a clear warning
explaining the worktree is in detached HEAD state.

Richard Feldman created

2a15bf6 Require multibuffer excerpts to be ordered and nonoverlapping (#52364)

Click to expand commit body
TODO:
- [x] merge main
- [x] nonshrinking `set_excerpts_for_path`
- [x] Test-drive potential problem areas in the app
- [x] prepare cloud side
- [x] test collaboration
- [ ] docstrings
- [ ] ???

## Context

### Background

Currently, a multibuffer consists of an arbitrary list of
anchor-delimited excerpts from individual buffers. Excerpt ranges for a
fixed buffer are permitted to overlap, and can appear in any order in
the multibuffer, possibly separated by excerpts from other buffers.
However, in practice all code that constructs multibuffers does so using
the APIs defined in the `path_key` submodule of the `multi_buffer` crate
(`set_excerpts_for_path` etc.) If you only use these APIs, the resulting
multibuffer will maintain the following invariants:

- All excerpts for the same buffer appear contiguously in the
multibuffer
- Excerpts for the same buffer cannot overlap
- Excerpts for the same buffer appear in order
- The placement of the excerpts for a specific buffer in the multibuffer
are determined by the `PathKey` passed to `set_excerpts_for_path`. There
is exactly one `PathKey` per buffer in the multibuffer

### Purpose of this PR

This PR changes the multibuffer so that the invariants maintained by the
`path_key` APIs *always* hold. It's no longer possible to construct a
multibuffer with overlapping excerpts, etc. The APIs that permitted
this, like `insert_excerpts_with_ids_after`, have been removed in favor
of the `path_key` suite.

The main upshot of this is that given a `text::Anchor` and a
multibuffer, it's possible to efficiently figure out the unique excerpt
that includes that anchor, if any:

```
impl MultiBufferSnapshot {
    fn buffer_anchor_to_anchor(&self, anchor: text::Anchor) -> Option<multi_buffer::Anchor>;
}
```

And in the other direction, given a `multi_buffer::Anchor`, we can look
at its `text::Anchor` to locate the excerpt that contains it. That means
we don't need an `ExcerptId` to create or resolve
`multi_buffer::Anchor`, and in fact we can delete `ExcerptId` entirely,
so that excerpts no longer have any identity outside their
`Range<text::Anchor>`.

There are a large number of changes to `editor` and other downstream
crates as a result of removing `ExcerptId` and multibuffer APIs that
assumed it.

### Other changes

There are some other improvements that are not immediate consequences of
that big change, but helped make it smoother. Notably:

- The `buffer_id` field of `text::Anchor` is no longer optional.
`text::Anchor::{MIN, MAX}` have been removed in favor of
`min_for_buffer`, etc.
- `multi_buffer::Anchor` is now a three-variant enum (inlined slightly):

```
enum Anchor {
    Min,
    Excerpt {
        text_anchor: text::Anchor,
        path_key_index: PathKeyIndex,
        diff_base_anchor: Option<text::Anchor>,
    },
    Max,
}
```

That means it's no longer possible to unconditionally access the
`text_anchor` field, which is good because most of the places that were
doing that were buggy for min/max! Instead, we have a new API that
correctly resolves min/max to the start of the first excerpt or the end
of the last excerpt:


```
impl MultiBufferSnapshot {
    fn anchor_to_buffer_anchor(&self, anchor: multi_buffer::Anchor) -> Option<text::Anchor>;
}
```
- `MultiBufferExcerpt` has been removed in favor of a new
`map_excerpt_ranges` API directly on `MultiBufferSnapshot`.

## 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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Co-authored-by: Conrad <conrad@zed.dev>

Cole Miller , Conrad Irwin , Piotr Osiewicz , Jakub Konka , and Conrad created

0e1751b Use INSERT OR REPLACE for archived worktree records

Click to expand commit body
The archived_git_worktrees table has a unique index on worktree_path.
A plain INSERT would fail if the same path was archived again. Using
INSERT OR REPLACE ensures the old record is replaced with the new
archive state.

Richard Feldman created

7eacdd1 Attempt to undo mixed reset when soft reset fails during restore

Click to expand commit body
When restoring a worktree, if the mixed reset succeeds but the soft
reset fails, the worktree was left with HEAD pointing at the internal
WIP staged commit. Now we attempt to undo the mixed reset by resetting
back to the original WIP commit hash, returning the worktree to a
coherent (if not fully unwound) state.

Richard Feldman created

b9eda0f git_graph: Fix loading graph hang (#52875)

Click to expand commit body
This hang was caused by emitting the Git Graph Count Updated event for
every commit being added to the graph instead of every batch of commits.
This would cause gpui to have a massive amount of events to handle on
the foreground thread, even if most of them had very little work
involved.

For example, Zed graph has over 80k commits, that means we were emitting
80k plus events instead of 80.

- [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 or Added/Fixed/Improved ...

Anthony Eid created

a77f621 Make undo_wip_commits return success bool and adjust prompts

Click to expand commit body
The undo_wip_commits closure now returns true/false so callers can
tell the user whether the undo actually succeeded. All three callsites
(SHA failure, DB record failure, directory removal failure) now vary
their prompt text accordingly, telling the user to manually run
git reset HEAD~2 when the automatic undo failed.

Richard Feldman created

f9da5fb Document test coverage gap for restore reset logic

Click to expand commit body
The fake git implementation doesn't create .git gitfiles in worktree
directories, so the project scanner never discovers a Repository entity
for restored worktrees. This means the two-reset staging-restoration
logic is not exercised by the existing test.

Richard Feldman created

811bb71 Fix off-by-one in FakeGitRepository::reset truncation

Click to expand commit body
The truncate(target_index + 1) call was a no-op when pop_count == 1
because target_index was len-1, so truncate(len) kept all elements.
This meant subsequent resets kept returning the same commit.

Fix: read the snapshot at target_index first, then truncate to
target_index (removing the consumed entry).

Richard Feldman created

e650667 agent_settings: Add `always_play_sound_when_agent_done` setting (#52284)

Click to expand commit body
This PR changes `agent.play_sound_when_agent_done` from a boolean to an
enum with three options:

- `never` (default)
- `when_hidden`
- `always`

In Settings → Agent, this now appears as a _Play Sound When Agent Done_
dropdown.

Existing settings are migrated automatically:
- `false` → `never`
- `true` → `always`

### Why

A boolean only allowed the sound to be on or off. This change gives
users clearer control over when the agent notification sound should
play.

### Verification

- Added a migrator test for this setting change.
- Manually tested the settings UI, settings migration and the feature


Release Notes:

- Added new agent notification sound options

---------

Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>

ifengqi and Oleksiy Syvokon created

dc238f2 git_graph: Minimize curve size (#52865)

Click to expand commit body
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 ...

Anthony Eid created

8ffc49f Fix review issues in archive/restore worktree feature

Click to expand commit body
- Gate soft reset on mixed reset success during restore; if either
  fails, skip branch restore but still mark worktree as restored in DB
- Clean up git refs and DB records when canceling in-flight archive
  tasks, so git gc can reclaim orphaned WIP commits
- Return Err from create_fresh_worktree on failure instead of Ok with
  a deleted path that would open a broken workspace
- Fix fake_git_repo reset() to clone target snapshot instead of popping
  it, preserving commit history for subsequent operations
- Enforce allow_empty in fake commit() so tests can verify the flag
- Fall back to direct deletion when cross-filesystem rename fails; if
  both fail, roll back WIP commits, DB records, and git refs
- Remove completed tasks from pending_worktree_archives HashMap
- Verify restored worktree path is a recognized git worktree before
  reusing it, treating unrecognized directories as collisions

Richard Feldman created

0638897 Fix tooltip reference cycles (#52853)

Click to expand commit body
## Summary
- break tooltip back-references from stored callbacks and tasks with
weak handles
- keep the tooltip controller as the sole strong owner of tooltip
lifecycle state
- add a regression test that exercises the visible-tooltip ownership
graph directly

## Testing
- cargo test -p gpui tooltip_is_released_when_its_owner_disappears --lib

Closes AI-120

Release Notes:

- Fixed a tooltip memory leak.

Richard Feldman created

9b610e2 languages: Update vscode-eslint to 3.0.24 and fix ESLint 8-10 breaking cases (#52886)

Click to expand commit body
Closes #29757
Closes #49387

This PR upgrades ESLint language server from `vscode-eslint 2.4.4` to
upstream `microsoft/vscode-eslint 3.0.24`, and make the workspace
configuration version-aware so ESLint 8, 9, and 10 take the correct
config-mode path.

The key part is that the 3.x bump alone is not enough. This PR keeps Zed
out of that path except where it is still actually needed. Rest
heavy-lifting is done by eslint server itself.

Zed now only overrides ESLint settings in the two known broken cases:
- ESLint 8.21-8.56 flat config: send `experimental.useFlatConfig = true`
  - ESLint 9 legacy config: send `useFlatConfig = false`
  
All other cases defer to `vscode-eslint 3.x`'s own config and
working-directory discovery.

For testing, I created https://github.com/smitbarmase/eslint-repros,
which contains a versioned ESLint repros covering root flat config,
legacy config, and package-local monorepo cases across ESLint 8, 9, and
10. Here is compare between `zed/main`, a pure `vscode-eslint 3.x`
upgrade and this branch with the config-mode fixes:

  ## zed main

  ```text
  eslint-v8_21-flat-root-single
  eslint-v8_56-flat-package-local-monorepo  -> breaks on main
  eslint-v8_56-flat-root-single
  eslint-v8_56-legacy-root-single
  eslint-v8_57-flat-package-local-monorepo  -> breaks on main
  eslint-v8_57-flat-root-single
  eslint-v8_57-legacy-root-single
  eslint-v9_0-flat-package-local-monorepo
  eslint-v9_0-flat-root-single
  eslint-v9_0-legacy-root-single            -> breaks on main
  eslint-v10_0-flat-package-local-monorepo
  eslint-v10_0-flat-root-single             -> breaks on main
  ```
  
  ## vscode-eslint 3.x upgrade

  ```text
  eslint-v8_21-flat-root-single
  eslint-v8_56-flat-package-local-monorepo  -> breaks on 3.x upgrade
  eslint-v8_56-flat-root-single
  eslint-v8_56-legacy-root-single
  eslint-v8_57-flat-package-local-monorepo
  eslint-v8_57-flat-root-single
  eslint-v8_57-legacy-root-single
  eslint-v9_0-flat-package-local-monorepo
  eslint-v9_0-flat-root-single
  eslint-v9_0-legacy-root-single            -> breaks on 3.x upgrade
  eslint-v10_0-flat-package-local-monorepo
  eslint-v10_0-flat-root-single             -> breaks on 3.x upgrade
  ```
  
  ## vscode-eslint 3.x upgrade + use flat config fixes

  ```text
  eslint-v8_21-flat-root-single
  eslint-v8_56-flat-package-local-monorepo
  eslint-v8_56-flat-root-single
  eslint-v8_56-legacy-root-single
  eslint-v8_57-flat-package-local-monorepo
  eslint-v8_57-flat-root-single
  eslint-v8_57-legacy-root-single
  eslint-v9_0-flat-package-local-monorepo
  eslint-v9_0-flat-root-single
  eslint-v9_0-legacy-root-single
  eslint-v10_0-flat-package-local-monorepo
  eslint-v10_0-flat-root-single
  ```
  
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 ESLint not reporting diagnostics in some cases for projects that
use flat-config, legacy-config, and monorepo projects across ESLint 8,
9, and 10.

Smit Barmase created

6663a60 language_model: Refactor crate structure and dependencies (#52857)

Click to expand commit body
A couple of things that this PR wants to accomplish:
* remove dependency on `settings` crate from `language_model`
* refactor provider-specific code into submodules - to be honest, I
would go one step further and put all provider-specific bits in
`language_models` instead but I realise we have cloud logic in
`language_model` which uses those too making it tricky
* move anthropic-specific telemetry into `language_models` crate - I
think it makes more sense for it to be there

Anyhow, I would very appreciate if you could have a look @mikayla-maki
and @maxdeviant and lemme know what you think, if you would tweak
something, etc.

Release Notes:

- N/A

Jakub Konka created

82a6493 Bump Zed to v0.232 (#52903)

Click to expand commit body
Release Notes:

- N/A

Joseph T. Lyons created

20d71cf Clarify FakeGitRepository reset with truncate+pop instead of loop

Click to expand commit body
Replace the obscure pop loop with truncate+pop to make the
intent explicit: keep entries up to the target, then pop the
target to use its contents. Identical behavior, clearer code.

Richard Feldman created

3eadd41 Dev containers native implementation (#52338)

Click to expand commit body
## Context

Closes #11473

In-house Zed implementation of devcontainers. Replaces the dependency on
the [reference implementation](https://github.com/devcontainers/cli) via
Node.

This enables additional features with this implementation:
1. Zed extensions can be specified in the `customizations` block, via
this syntax in `devcontainer.json:
```
...
  "customizations": {
    "zed": {
      "extensions": ["vue", "ruby"],
    },
  },

```
2.
[forwardPorts](https://containers.dev/implementors/json_reference/#general-properties)
are supported for multiple ports proxied to the host

## How to Review

<!-- Help reviewers focus their attention:
- For small PRs: note what to focus on (e.g., "error handling in
foo.rs")
- For large PRs (>400 LOC): provide a guided tour — numbered list of
files/commits to read in order. (The `large-pr` label is applied
automatically.)
     - See the review process guidelines for comment conventions -->

## 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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Improved devcontainer implementation by moving initialization and
creation in-house

KyleBarton created

5d06f24 Use configured worktree directory in create_fresh_worktree

Click to expand commit body
Use worktrees_directory_for_repo instead of hardcoded
DEFAULT_WORKTREE_DIRECTORY, matching the collision path in
restore_archived_worktree.

Richard Feldman created

9b38aa4 Support archiving multiple linked worktrees per thread

Click to expand commit body
Remove the single-path restriction and iterate over all paths in
the thread's folder_paths. Each linked git worktree gets its own
independent archive task stored in pending_worktree_archives.

Extract archive_single_worktree as a standalone async method
containing the full WIP-commit → ref-creation → worktree-deletion
sequence for one worktree.

Richard Feldman created

199f394 Re-check path existence after worktree creation failure

Click to expand commit body
When create_worktree_detached fails, re-check whether the path
now exists before falling back to create_fresh_worktree. A
concurrent restore may have already created the worktree, in
which case we reuse the existing path.

Richard Feldman created

e03966e Handle per-path restoration failures gracefully in maybe_restore_git_worktrees

Click to expand commit body
Individual path failures now log the error and fall back to the
original path instead of aborting the entire loop. Cleanup only
runs after successful restoration. The thread always activates
at the end with whatever paths were successfully restored.

Richard Feldman created

10f8d91 Cancel archive tasks on unarchive and re-check is_last_thread in async block

Click to expand commit body
- Store archive tasks in pending_worktree_archives keyed by path so
  they can be cancelled (dropped) when the user unarchives a thread.
- Cancel any in-flight archive tasks for paths being restored in
  maybe_restore_git_worktrees before starting restoration.
- Re-check is_last_thread from the store inside the async block to
  close the TOCTOU window between the synchronous check and async
  execution.

Richard Feldman created

7a56090 Fix unarchive rollback using session_id directly instead of stale metadata

Click to expand commit body
The thread_metadata was captured after the archive call, so it could
be None (the thread was already excluded from the entries list). This
made the unarchive rollback closure a silent no-op on failure.

Instead, clone the session_id directly for the rollback closure,
which always works regardless of when the archive happened.

Richard Feldman created

2bbd569 Add doc comment to ArchivedGitWorktree and rename misleading variable

Click to expand commit body
- Add doc comment explaining why ArchivedGitWorktree lives in the
  thread_metadata_store module (shared SQLite database).
- Remove misleading branch_name_clone rename — it was a move, not
  a clone.

Richard Feldman created

67a60ac Use two WIP commits to preserve staging state on archive

Click to expand commit body
When archiving a worktree, create two commits instead of one:
1. Commit whatever is currently staged (allow-empty) — "WIP staged"
2. Stage everything including untracked, commit again — "WIP unstaged"

On restore, two resets undo this in reverse:
1. Mixed reset HEAD~ undoes the unstaged commit, putting previously-
   unstaged/untracked files back as working tree changes while resetting
   the index to match the staged commit's tree.
2. Soft reset HEAD~ undoes the staged commit without touching the index,
   so originally-staged files remain staged.

If any step in the two-commit sequence fails, all prior commits are
undone immediately before reaching the error prompt.

Richard Feldman created

4a0c02b editor: Prevent blame popover from appearing when cursor is on different pane (#52603)

Click to expand commit body
The blame popover shouldn't appear when the cursor hovers over the
annotation but on a different pane.

Before:


https://github.com/user-attachments/assets/dbf6f7b5-e27f-495b-8d6f-fa75a4feee18

After:


https://github.com/user-attachments/assets/d5e186df-4ebf-4b4c-bb5f-4d9e7b0f62c7

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:

- Fixed a bug that caused git blame annotations to be hoverable from a
different pane.

Tim Vermeulen created

dcef83e editor: Clear previous select mode when clicking on a sticky header (#52636)

Click to expand commit body
Clicking on a sticky header causes
`selections.select_ranges([anchor..anchor])` to be called, but this does
not clear the editor's `selections.select_mode()`, resulting in possible
incorrect selections if this is followed up by a shift-click. This PR
fixes that with
```diff
- selections.select_ranges([anchor..anchor]);
+ selections.clear_disjoint();
+ selections.set_pending_anchor_range(anchor..anchor, SelectMode::Character);
```
which is essentially what `editor.select(SelectPhase::Begin { ... },
...)` (i.e. a regular single click in the editor) does as well.

Before:


https://github.com/user-attachments/assets/bcf2647e-a22a-4866-8975-d29e135df148

After:


https://github.com/user-attachments/assets/fb82db51-fef1-4b7c-9954-6e076ae0b176

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 bug that caused clicking on a sticky header to not always
properly clear the previous selection.

Tim Vermeulen created

06dbce4 agent_ui: Improve adding selection as context (#52860)

Click to expand commit body
This PR improves adding selection as context particularly for terminals,
making them not depend on open buffers. It also now works adding
selection from a terminal that's no in the panel but as a tab.

Also, I'm removing a behavior introduced in
https://github.com/zed-industries/zed/pull/48045 that turned out to be
confusing, where the selection keybinding would add as context the
content of the current line I'm focused on. I think we shouldn't do this
given that a lot of times, particularly when adding a selection from a
terminal, I'd also end up adding content from a buffer just because my
cursor was previously in there, even without anything selected on it.
Saw myself multiple times deleting the unwanted buffer context crease in
this case. If the keybinding is about _selection_, we should only
trigger it when there's something selected.ing not do anything if there
isn't any selection.

Release Notes:

- Agent: Improved adding selection as context particularly for
terminals, making them not depend on open buffers.

Danilo Leal created

f5993d8 agent_ui: Add more refinements to the thinking block display (#52874)

Click to expand commit body
Follow-up to https://github.com/zed-industries/zed/pull/52608

This PR adds a new iteration to the thinking block display design after
some internal round of feedback. It turns out, we had some people
appreciating the auto-collapse when thinking is done; thinking content
isn't too useful afterwards and it is just more content _to to he
model_, not the user. I also liked the one old but it definitely has the
issue of being a jarring layout shift when it wraps up. So that's why
I'm keeping what I introduced in the PR linked above as a setting, so
that anyone who feels strongly about the default (auto-expand, and
auto-collapse) can change that.

Release Notes:

- N/A

Danilo Leal created

66f9e32 sidebar: Archive threads without a project association automatically (#52897)

Bennet Bo Fenner created

224ce68 migrator: Remove text thread settings migration (#52889)

Click to expand commit body
Since this was just removing unused keys, but behavior isn't broken if
they are there. So we can just leave them as-is


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>
Co-authored-by: MrSubidubi <dev@bahn.sh>

Ben Brandt , Bennet Bo Fenner , and MrSubidubi created

02e8914 agent_ui: Use selected agent for new threads (#52888)

Click to expand commit body
Persist the last used agent globally as a fallback for new
workspaces, keep per-workspace selections independent. This should mean
"new thread" should grab whatever agent you are currently looking at,
and won't leak across projects.

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:

- agent: Prefer the currently used agent per-project when creating a new
thread.

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: MrSubidubi <dev@bahn.sh>

Ben Brandt , Bennet Bo Fenner , and MrSubidubi created

c544611 markdown: Refactor code block copy button visibility to use enum (#52817)

Click to expand commit body
Release Notes:

- N/A

---------

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
Co-authored-by: Finn Evers <finn.evers@outlook.de>
Co-authored-by: MrSubidubi <finn@zed.dev>

Xiaobo Liu , Finn Evers , and MrSubidubi created

23edf06 sidebar: Support loading threads that have no project association (#52842)

Click to expand commit body
Changed the migration codepath, so that threads with no project are also
migrated to the archive.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>

Bennet Bo Fenner and Danilo Leal created

ac20488 eslint: Fix ESLint server startup failure on stale cached server install (#52883)

Click to expand commit body
Closes
https://github.com/zed-industries/zed/issues/19709#issuecomment-3494789304
Closes
https://github.com/zed-industries/zed/issues/24194#issuecomment-2835787560

This PR fixes case where if eslint cached install is partial or stale,
Zed can try to launch a missing `eslintServer.js` and the server crashes
with `MODULE_NOT_FOUND`.

```
Error: Cannot find module '/Users/.../languages/eslint/vscode-eslint-2.4.4/vscode-eslint/server/out/eslintServer.js'
```

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:

- Fixed ESLint server startup failures caused by reusing an incomplete
or stale cached server install.

Smit Barmase created

a9dd7e9 Fix workspace-absolute paths in markdown images (#52708)

Click to expand commit body
## Context

Previously, markdown images failed to load workspace-absolute paths.
This updates the image resolver to identify the active workspace root
directory. Paths which are workspace absolute are correctly resolved and
rendered. The added test covers a successful resolution.

This PR re-implements the fix that was originally proposed in my
previous PR, #52178.

## Fix


https://github.com/user-attachments/assets/d69644ea-06cc-4638-b4ee-ec9f3abbb1ed

## How to Review

Small PR - focus on two changes in the file
`crates/markdown_preview/src/markdown_preview_view.rs`:
- `fn render_markdown_element()` (lines ~583-590): added the logic to
determine the workspace_directory
- `fn resolve_preview_image()` (lines ~714-726): added
workspace_directory variable, and a verification to create the full path
when a path is workspace-absolute

One test was added, covering a successful resolution
(`resolves_workspace_absolute_preview_images`). This test was
implemented in the file
`crates/markdown_preview/src/markdown_preview_view.rs`.


## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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 #46924 

Release Notes:

- Added workspace-absolute path detection in markdown files

danielaalves01 created

a3964a5 Rework column/table width API in data table (#51060)

Click to expand commit body
data_table: Replace column width builder API with `ColumnWidthConfig`
enum

This PR consolidates the data table width configuration API from three
separate builder methods (`.column_widths()`, `.resizable_columns()`,
`.width()`) into a single `.width_config(ColumnWidthConfig)` call. This
makes invalid state combinations unrepresentable and clarifies the two
distinct width management modes.

**What changed:**

- Introduces `ColumnWidthConfig` enum with two variants:
  - `Static`: Fixed column widths, no resize handles
- `Redistributable`: Drag-to-resize columns that redistribute space
within a fixed table width
- Introduces `TableResizeBehavior` enum (`None`, `Resizable`,
`MinSize(f32)`) for per-column resize policy
- Renames `TableColumnWidths` → `RedistributableColumnsState` to better
reflect its purpose
- Extracts all width management logic into a new `width_management.rs`
module
- Updates all callers: `csv_preview`, `git_graph`, `keymap_editor`,
`edit_prediction_context_view`

```rust
pub enum ColumnWidthConfig {
    /// Static column widths (no resize handles).
    Static {
        widths: StaticColumnWidths,
        /// Controls widths of the whole table.
        table_width: Option<DefiniteLength>,
    },
    /// Redistributable columns — dragging redistributes the fixed available space
    /// among columns without changing the overall table width.
    Redistributable {
        entity: Entity<RedistributableColumnsState>,
        table_width: Option<DefiniteLength>,
    },
}
```

**Why:**

The old API allowed callers to combine methods incorrectly. The new
enum-based design enforces correct usage at compile time and provides a
clearer path for adding independently resizable columns in PR #3.

**Context:**

This is part 2 of a 3-PR series improving data table column width
handling:
1. [#51059](https://github.com/zed-industries/zed/pull/51059) - Extract
modules into separate files (mechanical change)
2. **This PR**: Introduce width config enum for redistributable column
widths (API rework)
3. Implement independently resizable column widths (new feature)

The series builds on previously merged infrastructure:
- [#46341](https://github.com/zed-industries/zed/pull/46341) - Data
table dynamic column support
- [#46190](https://github.com/zed-industries/zed/pull/46190) - Variable
row height mode for data tables

Primary beneficiary: CSV preview feature
([#48207](https://github.com/zed-industries/zed/pull/48207))


### Anthony's note

This PR also fixes the table dividers being a couple pixels off, and the
csv preview from having double line rendering for a single column in
some cases.

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

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>

Oleksandr Kholiavko and Anthony Eid created

0b275ea Change behavior of search with vim mode enabled (#51073)

Click to expand commit body
When vim mode is enabled, previously if Cmd-F (or platform equivalent)
was pressed, enter will go to the editor's first match, and then hitting
enter again goes to the next line rather than next match. This PR
changes it to make enter go to the next match, which matches the
convention in most other programs. The behavior when search is initiated
with / is left unchanged.

This is a reopen of #35157, rebased and fixed.
Closes #7692

Release Notes:

- In vim mode, when search is triggered by the non-vim mode shortcut
(cmd-f by default) enter will now behave as it does outside of vim mode.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>

Vivek Jain and Conrad Irwin created

878aba8 markdown: Show copy button on hover to prevent overlapping code block… (#52837)

Click to expand commit body
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] 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 #52064

Release Notes:

- Fixed copy button overlapping code block content in the Agent panel
(#52064)

## Demo

Before:
<img width="496" height="139" alt="image"
src="https://github.com/user-attachments/assets/6c49ad7f-ae36-4a6b-be72-783ff6e98537"
/>
<img width="411" height="182" alt="image"
src="https://github.com/user-attachments/assets/a4b89407-2ae0-4629-875b-706592e81b34"
/>

After:


https://github.com/user-attachments/assets/a139db06-3909-4a22-881a-836262ed3c36

João Soares created

2f93e73 Merge remote-tracking branch 'origin/main' into AI-112/delete-worktree-on-archive

Click to expand commit body
# Conflicts:
#	crates/fs/src/fake_git_repo.rs

Richard Feldman created

2c39dc5 Remove dead empty-commit-hash branch and add robust archive error handling

Click to expand commit body
- Remove the is_empty() check in the restore path since no row with an
  empty commit_hash is ever created
- On head_sha failure after WIP commit: undo the commit, unarchive the
  thread, and notify the user via prompt
- On DB insert failure: undo the commit, unarchive the thread, and notify
- On worktree deletion failure: log and continue (DB record is correct)
- Ref creation failure is non-fatal (commit hash is in the DB)
- Extract unarchive/undo helpers to reduce duplication

Richard Feldman created

971775e gpui: Implement audible system bell (#47531)

Click to expand commit body
Relates to #5303 and
https://github.com/zed-industries/zed/issues/40826#issuecomment-3684556858
although I haven't found anywhere an actual request for `gpui` itself to
support a system alert sound.

### What

Basically, this PR adds a function that triggers an OS-dependent alert
sound, commonly used by terminal applications for `\a` / `BEL`, and GUI
applications to indicate an action failed in some small way (e.g. no
search results found, unable to move cursor, button disabled).

Also updated the `input` example, which now plays the bell if the user
presses <kbd>backspace</kbd> with nothing behind the cursor to delete,
or <kbd>delete</kbd> with nothing in front of the cursor.

Test with `cargo run --example input --features gpui_platform/font-kit`.

### Why
If this is merged, I plan to take a second step:
- Add a new Zed setting (probably something like
`terminal.audible_bell`)
- If enabled, `printf '\a'`, `tput bel` etc. would call this new API to
play an audible sound

This isn't the super-shiny dream of #5303 but it would allow users to
more easily configure tasks to notify when done. Plus, any TUI/CLI apps
that expect this functionality will work. Also, I think many terminal
users expect something like this (WezTerm, iTerm, etc. almost all
support this).

### Notes
~I was only able to test on macOS and Windows, so if there are any Linux
users who could verify this works for X11 / Wayland that would be a huge
help! If not I can try~

Confirmed Wayland + X11 both working when I ran the example on a NixOS
desktop

Release Notes:

- N/A

Ian Chamberlain created

6f41ccc Replace 500ms sleep with deterministic project worktree scan

Richard Feldman created

4087d9f Remove Claude upsell (#52831)

Click to expand commit body
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

Release Notes:

- Removed the (broken) Claude ACP upsell dialogue

Conrad Irwin created