d2ddb4b
markdown: Fix heading sizes and spacing in preview (#54374)
Click to expand commit body
## Context
Heading sizes in the markdown preview were nearly identical to body
text, making `# H1`, `## H2`, and `### H3` visually indistinguishable.
The root cause was in `MarkdownStyle::themed()`: it set a
`heading_level_styles` override with font sizes of `rems(1.05β1.15)`,
which silently replaced the correct sizes applied by
`apply_heading_style` (via GPUI's `text_3xl`/`text_2xl`/`text_xl`
utilities `rems(1.875/1.5/1.25)`). Removing that override restores the
intended hierarchy. A `mt_4()` top margin was also added so consecutive
headings have visual breathing room.
Closes #54358
Video of manual test below :
[Screencast from 2026-04-21
02-22-12.webm](https://github.com/user-attachments/assets/8dd815f9-6f9b-4e88-bebb-28c79f019427)
## How to Review
`crates/markdown/src/markdown.rs` Three changes:
- (1) removed the `heading_level_styles` block from
`MarkdownStyle::themed()` that was overriding heading font sizes with
nearly-body-text values;
- (2) added `mt_4()` to the heading div in `push_markdown_heading` for
better vertical spacing;
- (3) added `test_heading_font_sizes_are_distinct` which renders H1βH3
and a paragraph then asserts that line heights strictly decrease from H1
down to body text.
## 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
Release Notes:
- Fixed heading sizes in the markdown preview to correctly reflect the
H1βH6 size hierarchy, matching standard markdown renderers
saberoueslati
created
4814074
markdown: Add "Copy Link" to right-click context menu (#53758)
Click to expand commit body
## Context
Closes #53741
Right-clicking on a link in any Markdown view showed no way to copy the
URL. The right-click handler already detected links for left-click
navigation, but the context menu was never extended to surface a
link-specific action.
Video of the manual test below :
[Screencast from 2026-04-13
00-29-49.webm](https://github.com/user-attachments/assets/fbde09ab-78da-4366-b1e0-e15e0d43442b)
## How to Review
- **`crates/markdown/src/markdown.rs`** β Added a `context_menu_link:
Option<SharedString>` field to `Markdown`. Added
`capture_for_context_menu(link)` (replaces the old
`capture_selection_for_context_menu`) which saves both selected text and
the hovered link together. Added a `context_menu_link()` accessor.
Updated the capture-phase right-click handler to detect the link under
the cursor via `rendered_text.link_for_source_index`. Added a
`event.button != MouseButton::Right` guard to the bubble-phase
`MouseDownEvent` handler to prevent selection logic from running on
right-click.
- **`crates/agent_ui/src/conversation_view/thread_view.rs`** β In
`render_message_context_menu`, after computing `has_selection`, also
reads `context_menu_link` from the same markdown chunks. Adds a "Copy
Link" entry with a separator at the top of the menu when a link URL is
present.
- **`crates/markdown_preview/src/markdown_preview_view.rs`** β Wraps the
markdown element in a `right_click_menu` with a "Copy Link" entry (when
a link is present).
Edit: There was a mention of a "Copy" and "Copy as Markdown" buttons.
After discussion, it was decided that I would re-add them fully fleshed
out in a separate PR
## 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
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Added "Copy Link" to the right-click context menu when clicking on a
link in Markdown views (agent panel and Markdown preview)
saberoueslati
created
80ab748
agent_ui: Fix inconsistent Rules keybinding in Toggle Agent Menu (#54420)
Click to expand commit body
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 #54419
Release Notes:
- Fixed Agent menu shortcut context handling so Alt-Shift-L consistently
resolves to Rules (and displays correctly) when the Toggle Agent Menu is
open, while preserving existing global/context-specific shortcuts such
as Language Servers and onboarding bindings outside Agent menu context.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
galuis116
,
Danilo Leal
, and
Danilo Leal
created
c8cda37
compliance: Account for Zippy commits without PR in report summary (#54461)
Click to expand commit body
The report summary previously assumed that every commit that had a
review would also have an associated PR - this was no longer the case
with Zippy PRs that are allowed without PR. This pull request fixes this
wrong assumption.
Release Notes:
- N/A
#### Context
When tree-sitter parses a file with broken syntax (e.g. a large partial
SQL `VALUES` clause, or any language where a large chunk becomes
invalid), it can produce a single `ERROR` node spanning thousands of
lines. On every render frame, Zed queries this tree for syntax
highlights via `SyntaxMapCaptures`. Previously, only `set_byte_range`
was applied to the query cursor - this limits which captures are
*returned*, but tree-sitter still had to *traverse* the entire ERROR
subtree to find them, causing O(file size) work per frame and making
scrolling/editing visibly laggy.
The fix applies `set_containing_byte_range` to the highlight query
cursor, mirroring what `SyntaxMapMatches` already does for indentation
and bracket queries. This tells tree-sitter to skip subtrees that extend
far beyond the visible window, reducing traversal to the visible range
only.
**Note:** This fix eliminates the main freeze/stall caused by full-tree
traversal. A small amount of lag may still occur on very large broken
files, as tree-sitter still needs to parse the error-recovery structure.
Further improvements would require deeper changes to tree-sitter's query
execution or incremental parsing.
#### Closes #52390
#### How to Review
Small change β focus on
[syntax_map.rs:1119-1123](crates/language/src/syntax_map.rs#L1119) (the
fix) and the `containing_byte_range_for_captures` helper below it.
Compare with the existing `SyntaxMapMatches::new` path (line ~1255)
which uses the same pattern.
#### 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
#### Video
[Screencast from 2026-03-26
14-19-19.webm](https://github.com/user-attachments/assets/6628492a-f013-438a-836a-2740f6e2f266)
#### Note : Reopens previous work from closed PR #52475 (fork was
deleted)
Release Notes:
- Fixed laggy scrolling and editing in files with large broken syntax
regions (e.g. incomplete SQL `VALUES` clauses or large invalid blocks in
any language)
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Om Chillure
and
Max Brunsfeld
created
bcaa1b5
dev_container: Resolve compose service build args in Dockerfile expansion (#54270)
Click to expand commit body
For docker-compose-based dev containers, build args live on the primary
compose service's `build.args`, not on `dev_container.build` (which is
`None` in the compose case). `expanded_dockerfile_content` only
consulted the latter, so `${β¦}` references in the service's Dockerfile β
e.g. `FROM ${BASE_IMAGE}` β were never substituted. Downstream callers
then invoked `docker inspect "${BASE_IMAGE}"` and `docker pull
"${BASE_IMAGE}"`, both of which fail and the dev container fails to
start.
A new unit test `test_expands_compose_service_args_in_dockerfile` mounts
a Dockerfile with `FROM ${BASE_IMAGE}` backed by a compose service whose
`build.args` define `BASE_IMAGE=test_image:latest`, and asserts both
`expanded_dockerfile_content` and `image_from_dockerfile` produce the
resolved reference.
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 dev container startup failing for docker-compose configs whose
service Dockerfile uses build-arg substitution in the FROM line (for
example, `FROM ${BASE_IMAGE}`).
Sandro Meier
created
9e18c6a
Bump jupyter-websocket-client to 1.1.0 (#54442)
Click to expand commit body
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
MostlyK
created
5df4e1e
recent_projects: Fix remote projects dialog not showing vertical scrollbar for overflow content (#54425)
Click to expand commit body
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 #54424
Release Notes:
- N/A
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
galuis116
and
Danilo Leal
created
4d63117
compliance: Allow Zippy version bumps (#54342)
Click to expand commit body
This adds checks for the Zed Zippy version bumps. These are rather
strict, but since we should also be strict with the bumps themselves, I
consider this the better approach.
Note this intentionally only includes the version bumps here for now.
Release Notes:
- N/A
Finn Evers
created
f8295ff
Fix blank git diff view on Windows when working in a subfolder (#52234)
Click to expand commit body
## Context
Fixes a Windows path handling bug in `crates/util/src/paths.rs` when
computing a relative path via `strip_prefix`. (Closes #51758 )
Previously, Windows prefix matching only handled drive-letter
case-insensitivity. It could still fail when the parent and child paths
referred to the same location but used different separator styles (`\`
vs `/`) or different casing in later path segments. That caused valid
Windows paths to return `None` instead of a relative path, which caused
the diff to break.
This change normalizes Windows paths for prefix comparison by
lowercasing any ASCII characters and converting backslashes to forward
slashes before checking the prefix.
Tests were added for mixed-case and mixed-separator Windows paths to
cover the bug and prevent further regressions.
## How to Review
1. Check the `strip_prefix` Windows branch to confirm the new
normalization logic only affects prefix comparison and still rejects
partial-segment matches.
2. Check the added tests for mixed separator and mixed casing cases on
Windows paths.
## 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:
- Fix blank git diff view on Windows when working in a subfolder
---------
Co-authored-by: John Tur <john-tur@outlook.com>
Hitesh Rohira
and
John Tur
created
2542b71
extension_host: Fix Windows manifest paths when uploading extensions to WSL remote (#50653)
Click to expand commit body
Closes #42731
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)
<img width="1440" height="900" alt="Screenshot 2026-03-09 at 5 10 46β―PM"
src="https://github.com/user-attachments/assets/bf124481-dc10-44e9-aaab-3e562d71e41e"
/>
Release Notes:
- Fixed Windows path handling in extension manifests to ensure
extensions upload correctly to remote environments like WSL.
---------
Co-authored-by: John Tur <john-tur@outlook.com>
Thomas Jensen
and
John Tur
created
6d73ada
Fix telemetry source for git and sidebar-triggered agent threads (#54005)
Click to expand commit body
The `ReviewBranchDiff`, `ResolveConflictsWithAgent`, and
`ResolveConflictedFilesWithAgent` actions are dispatched from the git UI
(`git_ui/src/project_diff.rs` and `git_ui/src/conflict_view.rs`), not
the agent panel. Their `source` field in the "Agent Thread Started"
telemetry event was set to `"agent_panel"` β this changes it to
`"git_panel"`.
Also threads the `source` parameter through `activate_draft` and
`ensure_draft` so that drafts created from the sidebar correctly report
`source = "sidebar"` instead of `"agent_panel"`.
Release Notes:
- N/A
MarΓa Craig
created
1e6e448
editor: Fix autoscroll sometimes obscuring the current row behind a sticky header (#53165)
Click to expand commit body
Fixes an autoscroll bug that sometimes obscures the current row behind a
sticky header.
The bug was caused by `Editor::autoscroll_vertically` using the
`sticky_header_line_count` value that was cached during the previous
render, which isn't necessarily the number of sticky headers that the
scroll target needs, e.g.
- when jumping to a definition
- when pressing the up arrow key when the selection is in the topmost
visible row with `"vertical_scroll_margin": 0`
This fixes that by not caching `sticky_header_line_count` and instead
querying Tree-sitter on the fly to get the number of sticky headers that
the scroll target needs. Performance-wise this seem okay, I measured it
to take less than 200Β΅s on my machine using a very large Rust file (and
there are still some possible ways to optimize this if necessary). In
particular, the pathological huge single-line file case as discussed in
#48450 shouldn't be an issue here because unlike the main sticky header
Tree-sitter query, here we query the outline items that contain a
particular point rather than those that intersect an entire row.
The `ScrollCursorTop` handler is also simplified to use the same shared
function for counting the number of sticky headers, since that action
doesn't rely on autoscroll.
Before:
https://github.com/user-attachments/assets/efb12776-82d9-4b94-baa5-347ec769fb98
After:
https://github.com/user-attachments/assets/236deb9f-fe06-43bd-b167-7bd3ab719e4c
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 #50803
Release Notes:
- Fixed sticky headers sometimes obscuring the current row.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Tim Vermeulen
and
Conrad Irwin
created
179af67
vim: Preserve system clipboard when pasting over visual selection (#52948)
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
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #52352
Release Notes:
- Fixed system clipboard being overwritten when pasting over a visual
selection with Cmd-V/Ctrl-V in vim mode
Special thanks to @lingyaochu for finding out the root cause of the
issue.
Took the test from: https://github.com/zed-industries/zed/pull/54233
The git graph was using `buffer_ui_size` when calculating the canvas row
height and the table row height. This is wrong because elements such as
`Labels` in the graph table were rendered using `ui_font_size`. This PR
normalizes the row height calculation by always using `ui_font_size` for
the canvas and table row height calculation, and taking into account the
scaling factor.
This PR also fixes a bug where the bottom of the canvas could flicker on
its first redraw because the uniform list hadn't cached the viewport
size yet, and we underestimated the visible size of the canvas and
underdrew it. We now fallback to the window height as the viewport size.
This means we'll overdraw for a single frame whenever the uniform list
hasn't cached the last item size, but it avoids the flicker!
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 #53492
Closes #53469
Release Notes:
- git_graph: Fix misalignment issues between the graph canvas and the
graph table
---------
Co-authored-by: lingyaochu <zx0@mail.ustc.edu.cn>
Anthony Eid
and
lingyaochu
created
ef9b42f
ep: Repair teacher outputs if num of discarded chars is too high (#54441)
Click to expand commit body
Release Notes:
- N/A
Oleksiy Syvokon
created
d06406f
Fix debugger start ignoring save property (#53353)
Click to expand commit body
## Summary
When `debugger::Start` runs a build task (via the `"build"` field in
`debug.json`), it was bypassing the task's `"save"` property and calling
`project.create_terminal_task()` directly. This meant unsaved files were
never saved before the build ran, even when `"save": "all"` was set
unlike `task: spawn` which correctly saved first.
**Changes:**
- Extracted `Workspace::save_for_task(workspace, strategy, cx)` as a
shared async helper in `workspace/src/tasks.rs`
- Refactored `schedule_resolved_task` to call this helper (no behavior
change, removes inline duplication)
- Called the same helper in `RunningState::resolve_scenario` before
`create_terminal_task`, so the debugger build path now respects the
task's `save` strategy
- Added `test_save_for_task_all`, `test_save_for_task_current`, and
`test_save_for_task_none` tests covering the extracted helper directly
## 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 #53284
## Video after fix
[Screencast from 2026-04-08
08-04-18.webm](https://github.com/user-attachments/assets/b0c20164-3670-440a-b43a-8457fb57bfbd)
## Release Notes:
- Fixed debugger not saving files before running a build task when
`"save": "all"` is set in the task definition
Fixes #51456
## Problem
When opening a recent project with an unsaved scratch buffer (untitled
file), the project switch silently fails. The log shows:
```
failed to save contents of buffer
Caused by: FOREIGN KEY constraint failed
```
## Root Cause
When a user creates a new file from the welcome screen and edits it
without saving, the buffer is dirty but has no file path. When opening a
recent project, `prepare_to_close` calls
`save_all_internal(SaveIntent::Close)`, which tries to serialize dirty
items to the database for hot-exit functionality.
The serialization fails with a FOREIGN KEY constraint error because
workspace serialization is throttled - the workspace row may not exist
in the database yet when the editor tries to INSERT into the editors
table referencing that workspace_id.
The previous code used `try_join_all` on all serialize tasks, so a
single serialization failure would abort the entire close flow,
preventing the project switch.
## Fix
Replace `try_join_all` with individual task awaiting. If a serialize
task fails, the item is moved back to the `remaining_dirty_items` list
so the user gets a proper save/discard prompt instead of the action
silently failing.
This is a minimal change (7 insertions, 2 deletions) that:
- Handles the FOREIGN KEY error gracefully
- Preserves the save/discard prompt UX for items that fail serialization
- Logs the serialization error for debugging via `.log_err()`
- Does not change behavior for items that serialize successfully
## Test Plan
- [ ] Open Zed with no active workspace
- [ ] Create a new file from the welcome screen
- [ ] Edit the buffer to make it dirty (do not save)
- [ ] Open a recent project via `projects: open recent`
- [ ] Verify the project opens (previously it silently failed)
- [ ] Verify a save/discard prompt appears for the dirty scratch buffer
Release Notes:
- Fixed opening a recent project silently failing when an unsaved
scratch buffer is present (#51456).
---
This PR was written with the assistance of AI (Claude).
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Matt Van Horn
,
Matt Van Horn
, and
Max Brunsfeld
created
57d9e1f
git: Revert skipping of events for the `.git` directory itself (#54443)
Click to expand commit body
This reverts #54329 and the part of #52499 that was an earlier attempt
at the same thing, which caused us to incorrectly miss git state updates
on Windows. cc @Veykril it seems like we need to find a different way to
fix the problem of `.git` scanning cycles.
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 a bug causing stale git state on Windows.
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
Joseph T. Lyons
created
847510c
Fix broken `is_maximized` check on Windows (#54436)
Click to expand commit body
Bad change from https://github.com/zed-industries/zed/pull/54321
Fixes https://github.com/zed-industries/zed/issues/54418
Release Notes:
- N/A
John Tur
created
f9cb919
Tweak wording around multi-folder project actions (#54438)
Click to expand commit body
* Project panel "Add Folders to Project" and "Remove folder from
Project"
* Recent projects "Add Folders to this Project"
Release Notes:
- N/A
Release Notes:
- vim: Removed normal mode from the agent sidebar search
---------
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Conrad Irwin
and
cameron
created
a0b49e6
sidebar: Fix threads disappearing when stored main paths go stale (#54382)
Click to expand commit body
Fixes a user-reported bug where a thread could be missing from the
sidebar even though it was still present in the metadata store and still
visible in Thread History. The thread reappears in the sidebar only
after the user sends a message.
### Scenario
A single multi-root workspace whose roots are `[/cloud,
/worktrees/zed/wt_a/zed]`, where:
- `/cloud` is a standalone git repo (main == folder).
- `/worktrees/zed/wt_a/zed` is a linked worktree of a separate `/zed`
repo.
The project group normalizes to `main_worktree_paths = [/cloud, /zed]`.
A thread created in this workspace is written with `main=[/cloud, /zed],
folder=[/cloud, /worktrees/zed/wt_a/zed]` and the sidebar finds it via
`entries_for_main_worktree_path`.
If the thread's stored `main_worktree_paths` ever drifts from the group
key β e.g. a stale row loaded from the store on startup, a legacy write,
or a row persisted with `main == folder` β all three existing lookups in
`Sidebar::rebuild_contents` miss:
1. `entries_for_main_worktree_path([/cloud, /zed])` β the thread's
stored main doesn't equal the group key.
2. `entries_for_path([/cloud, /zed])` β the thread's folder paths don't
equal the group key either.
3. The linked-worktree fallback iterates the group workspaces'
`linked_worktrees()` snapshots. Those yield *sibling* linked worktrees
of the repo, not the workspace's own roots, so `/worktrees/zed/wt_a/zed`
doesn't match.
The row falls out of the sidebar entirely even though the metadata is
intact and the thread's folder paths exactly equal the open workspace's
roots. The store heals the stored row on the next `RootThreadUpdated`
event, which is why sending a message makes the row reappear β but until
then the sidebar misrepresents the state.
### Fix
Add a fourth lookup to `Sidebar::rebuild_contents`: for each open
workspace in the group, query the store by the workspace's own root
paths. Any thread whose `folder_paths` matches an open workspace's roots
belongs under that group, regardless of what its `main_worktree_paths`
say.
This covers the gap between stale-row load and store self-heal, matches
the principle that the sidebar should reflect state that exists in a
reasonable way, and is symmetric with the existing lookups (same store
API, one more iterator).
### Commits
1. `sidebar: Add failing repro for thread disappearing from sidebar` β
adds `test_sidebar_keeps_multi_root_thread_with_stale_main_paths` which
reproduces the bug. Sets up the multi-root + linked-worktree layout,
persists a thread in the stale shape, and asserts the row is still
visible in the sidebar.
2. `sidebar: Show threads whose folder paths match an open workspace` β
the fourth-lookup fix. 31 lines in `crates/sidebar/src/sidebar.rs`, no
deletions.
### Verification
- `cargo test -p sidebar`: 103 passed, 0 failed (the new test was
failing before commit 2 and is passing after).
- `./script/clippy -p sidebar`: clean.
### Follow-ups
The three existing lookups in `rebuild_contents` are each covering a
different historical shape the store can be in. A real cleanup β do a
one-shot migration on reload that fills in `main_worktree_paths` for any
row missing it, then retire the two legacy-shape lookups β is worth
doing as a separate PR, but out of scope here.
Release Notes:
- Fixed an issue where agent threads could go missing from the sidebar.
Eric Holk
created
1ea6eb4
workspace: Fix recent-projects cleanup wiping active workspaces (#54224)
Click to expand commit body
The recent-projects picker, sidebar, welcome screen, and agent thread
store all called `recent_workspaces_on_disk`, which combined listing
with deleting stale rows. Its retention predicate rejected workspaces
with no on-disk directory, including empty workspaces holding unsaved
scratch buffers, and the resulting `delete_workspace_by_id` call
cascaded into `items`, `pane_groups`, and the per-editor tables. For
clarity, the method has been renamed to `recent_workspaces_for_ui`.
Meanwhile, `last_session_workspace_locations` used a slightly different
form of the same predicate. The two disagreeing on what counts as a
valid workspace caused #48799, `Workspace WorkspaceId(N) not found`
errors on repeated launches (#50409), the
`test_window_edit_state_restoring_enabled` flake (#50871), and the
foreign key constraint fail on `projects: open recent` with a dirty
scratch buffer (#51456).
Note that for the last issue mentioned (#51456) there is no save prompt
for scratch buffers. This seems out of scope for this PR so I'll fix
that after this is addressed.
Self-Review Checklist:
- [x] 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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes #48799
Closes #50409
Closes #50871
Closes #51456
Release Notes:
- Fixed unsaved scratch buffers being lost across restarts and an
occasional error when opening a recent project.
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
Bennet Bo Fenner
created
f7d46cf
sidebar: Move to new workspace non-Wayland (#54055)
Click to expand commit body
We were just creating a window without showing it. However, wayland does
not respect this setting, so it seemed to work.
Now we actually activate the window :)
Rather than changing the single call-site, we always do this when
calling `Workspace::new_local`, since there were no code paths in the
repo that pass `NewWindow` without immediately activating it
Release Notes:
- N/A or Added/Fixed/Improved ...
Cameron Mcloughlin
created
6e900b4
agent_ui: Handle pagination of session/list correctly when importing (#54427)
Click to expand commit body
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
Bennet Bo Fenner
created
c91b917
agent_ui: Sort thread import agents by display name (#54417)
Click to expand commit body
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
Ben Brandt
created
5cda808
ep: Fix teacher's output parser for v0327 (#54416)
Click to expand commit body
Release Notes:
- N/A
Oleksiy Syvokon
created
102805a
agent_ui: Preserve session resume state after load errors (#54411)
Click to expand commit body
Use stored thread metadata during reset when no root thread view exists,
so retries keep the original session id and title instead of starting a
new session.
Add a regression test for reconnecting after an initial custom agent
load failure.
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 or Added/Fixed/Improved ...
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Ben Brandt
and
Bennet Bo Fenner
created
7a6a95c
editor: Fix edit predictions polluting completions menu (#50403)
Click to expand commit body
Closes #49565
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)
Screenshots
Before:
<img width="1509" height="726" alt="image"
src="https://github.com/user-attachments/assets/4931262a-e243-4e54-8ba8-f5fd13ec7bff"
/>
After:
<img width="1284" height="611" alt="image"
src="https://github.com/user-attachments/assets/0466cab6-d303-484c-a22b-4c168d21cec6"
/>
<img width="1284" height="611" alt="image"
src="https://github.com/user-attachments/assets/d6bce35b-e599-42da-9c4d-214e490677d5"
/>
Release Notes:
- Fixed edit predictions polluting the completions menu with unrelated
snippets (e.g. Unicode symbols) when
`show_in_completions_menu` is disabled
---------
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
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
Bennet Bo Fenner
created
b36583f
onboarding: Ensure scrollbar is shown at the proper edge (#54392)
Click to expand commit body
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 #54391
Release Notes:
- Fixed onboarding UI scrollbar placement so the vertical scrollbar now
appears at the right edge of the onboarding pane, while keeping
onboarding content centered.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
galuis116
and
Danilo Leal
created
0858f1c
title_bar: Fix worktree label showing `main` when opening a worktree directly (#54406)
Click to expand commit body
This PR fixes an issue where we'd show incorrect worktree labels when
opening a linked worktree directly. The linked worktree name would be
displayed in the project button but the dedicated worktree button would
be displaying "main", which is incorrect.
Now that we have a dedicated worktree button in the title bar, we can
make the project button always show the root repository name,
effectively matching the threads sidebar.
Release Notes:
- Fixed the title bar worktree button showing "main" when opening a
linked git worktree directly.
Danilo Leal
created
7c1078e
compliance: Temporarily fix the wrong compliance reports (#54401)
Click to expand commit body
This will be fully replaced by
https://github.com/zed-industries/zed/pull/54342 - however, this will
not help for the next week on the stable branch, since we have plenty of
non-signed commits on that branch currently.
Thus, adding this temporary check here to fix this and which is a
cherry-pickable change. This **will** be fully replaced by the linked
PR, however, I cannot cherry pick that since we would otherwise need to
force-push the branches to remove the bad commits.
Release Notes:
- N/A
Finn Evers
created
51fc26d
Fix agent default model not picking up after authentication resolve (#54397)
Click to expand commit body
Regression in https://github.com/zed-industries/zed/pull/54125
Release Notes:
- agent: Fixed an issue where the default Zed model would not get
selected after sign-in completed
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Smit Barmase
,
Bennet Bo Fenner
, and
Ben Brandt
created
d4849cc
compliance: Add support for checking singular commit (#54369)
Click to expand commit body
This helps with two things: Testing changes locally against real commits
as well as laying the groundwork for making things less convoluted for
the GitHub worker.
Also removes some useless wrapping left from an earlier direction.
Release Notes:
- N/A
When images are resized to meet provider size constraints (Anthropic's
1568px limit or the 5MB encoded-PNG cap), the stored ImageSize was still
recording the original width/height rather than the final post-downscale
dimensions. This caused incorrect token estimation via estimate_tokens()
since it uses width * height / 750.
Use processed_image.dimensions() after all downscale passes so that
ImageSize reflects the actual image sent to the provider.
Release Notes:
- Fixed an issue where token estimation would be incorrect in case where
the thread contained downscaled images.
https://github.com/user-attachments/assets/e7a7903b-e133-4fbf-9267-3ebb17f867ff
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 #43132
Release Notes:
- Fixed inlay hints navigating to the wrong position
Ramon
created
90c8629
agent_panel: Retain draft prompt when creating new draft thread (#54387)
Click to expand commit body
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
Bennet Bo Fenner
created
84dcf38
gpui: Improve Anchored to support center position (#47154)
Click to expand commit body
Release Notes:
- N/A
Ref https://github.com/longbridge/gpui-component/pull/1956 extract my
fork version of `anchored.rs` to let GPUI to support position Anchored
at center.
https://github.com/user-attachments/assets/8d0230ed-4b75-440b-b8c3-9bde3decd141
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Jason Lee
and
Claude Sonnet 4.6
created
81b16f4
fuzzy_nucleo: Fix out of range panic (#54371)
Click to expand commit body
Closes ZED-6PK
The issue here was that we could hit cases where the amount of segments
< amount of CPUs, e.g. for 5 candidates and 4 CPUs, we would have 2
candidates per matcher, so for the fourth matcher, we would start
slicing at 3 * 2 = 6 > 5, which is out of bounds.
Instead, make it so that we distribute the candidates across all
matchers so that all matchers have either n or n + 1 candidates.
No release notes since this is only on Nightly.
Release Notes:
- N/A
Finn Evers
created
4a630f0
Fix rules files not loading and config file rescan clearing tokens (#53659)
Click to expand commit body
Fixes #52453
Fixes #53246
Both issues were introduced by #51208 ("Handle Linux FS Rescan Events"),
which added `PathEventKind::Rescan` handling.
## Rules files not loading (#52453)
`load_worktree_info_for_system_prompt` called `load_worktree_rules_file`
synchronously, which uses `entry_for_path()` on the current worktree
snapshot. If the background scanner hasn't finished its initial scan,
the entry doesn't exist yet and the lookup returns `None` β the code
concludes no rules file exists. This was always a latent race condition,
but became more visible after Rescan events were introduced, since they
can trigger additional `WorktreeUpdatedEntries` churn that interacts
with the refresh mechanism.
The fix awaits `scan_complete()` on local worktrees before performing
the rules file lookup, ensuring the full directory tree is indexed
first.
## Config file rescan clearing OAuth tokens (#53246)
The `Rescan` handlers in `watch_config_dir` used
`fs.load(file_path).await.unwrap_or_default()`, which turns any
file-read error into an empty string. This empty string flows to
consumers like `CopilotChat`, where `extract_oauth_token("")` returns
`None`, causing the OAuth token to be unconditionally overwritten with
`None` β triggering re-authentication.
The fix changes both Rescan handlers to skip files that fail to load
(using `if let Ok(contents) = ...`), matching the pattern already used
by the `Created`/`Changed` handler.
Release Notes:
- Fixed rules files (AGENTS.md, CLAUDE.md, .rules, etc.) sometimes not
being applied in agent threads.
- Fixed GitHub Copilot re-prompting for authentication after filesystem
rescan events.
Anders Jenbo
created
95b0c5a
Prefer exact case matches when breaking completion ties (#54072)
Click to expand commit body
## Summary
Fix completion ordering when two items are otherwise tied and only
differ by letter case.
In cases like `abc` vs `ABC`, if the user types `a`, Zed should prefer
`abc`. If the user types `A`, Zed should prefer `ABC`. This matches the
expectation described in #37081 and #27993, where `subscription` should
rank above `Subscription` for query `s`.
## What changed
In `CompletionsMenu::sort_string_matches`, I added a tie-breaker that
prefers completions with more exact case-sensitive matches at the
fuzzy-match positions.
This only applies after the existing higher-priority sort keys, so it
does not replace fuzzy score, match positions, snippet ordering, or LSP
`sortText`. It only resolves ambiguous ties more intuitively.
## Tests
Added regression coverage in `code_completion_tests` for abstract
case-only examples:
- `a` prefers `abc` over `ABC`
- `A` prefers `ABC` over `abc`
- `ab` prefers `abc` over `ABC`
- `AB` prefers `ABC` over `abc`
- mixed-case multi-letter queries like `Ab` and `aB`
## Verification
Ran:
```bash
cargo test -p editor code_completion_tests
```
PS: all code and description is generated by Codex
Release Notes:
- Fixed completions not tie braking by case