a8b57a2529abcfe263e4e9b38cbd61b60705d9ef
39298
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a8b57a2529 |
feature_flags: Enable project panel undo everywhere except stable (#61457)
# Objective Enable the Project Panel Undo/Redo feature flag in all channels except stable. This gives us control over when it lands in Stable, while also allowing us to have it sit in Preview for longer than a single week, if we want to. ## Solution Update `ProjectPanelUndoRedoFeatureFlag::enabled_for_all` to be true on all release channels except `ReleaseChannel::Stable`. The feature flag doesn't allow us to scope it per environment so there's no way we could enable the flag for all but only have it impact Preview, should have added that safeguard in the beginning as stable is already relying on the feature flag exclusively. ## Testing N/A ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable --- Release Notes: - N/A |
||
|
|
95106f9cde |
docs: Add project panel's undo and redo documentation (#60191)
# Objective Update the Project Panel's documentation to document which operations support undo and redo behavior so it's easier for users to discover this feature. This Pull Request should stay in draft and only be merged after both https://github.com/zed-industries/zed/pull/59709 and https://github.com/zed-industries/zed/pull/59595 are merged, as documentation mentions behavior that is being updated in both Pull Requests. Release Notes: - N/A |
||
|
|
8780e3a1e2 |
project_panel: Refactor undo and redo error messages (#60186)
# Objective Improve the error messages shown when undoing or redoing project panel operations fail. Right now we're mostly relying on the error message generated by the underlying function or method that attempts to apply the inverse operation, which might not be the best UX. ## Solution * Update the style used in the `Workspace::show_notification` call, under `project_panel::undo::Inner::show_error`, in order to use markdown styling. This allows paths to stand out a little bit better, which is helpful seeing as pretty much all error messages will contain path information in the notification's body. * Update the way paths are displayed so as to show the full relative path and, if multiple worktrees are present, include the worktree name. This helps disambiguate cases where multiple worktrees might have the same path, for example, `src/lib.rs`. * Update each specific operation's error message to better convey what exactly failed. ## Testing Manually tested each of the scenarios outlined in the `Showcase` section. Please refer to the screenshots in that section to see before and after comparisons ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase ### Undo failures <details> <summary>1. Move conflict</summary> | Steps | Before | After | | --- | --- | --- | | 1. Move `a.txt` into `docs/` (cut/paste or drag)<br>2. Run `touch a.txt`<br>3. Undo | <img width="2736" height="1586" alt="1_before" src="https://github.com/user-attachments/assets/d60660d1-ba85-4a08-82a3-a6e3f6d84506" /> | <img width="2736" height="1586" alt="1_after" src="https://github.com/user-attachments/assets/c050f287-b186-42db-8995-57102d1db4d2" /> | </details> <details> <summary>2. Rename conflict</summary> | Steps | Before | After | | --- | --- | --- | | 1. Rename `a.txt` → `b.txt`<br>2. Run `touch a.txt`<br>3. Undo | <img width="2736" height="1586" alt="2_before" src="https://github.com/user-attachments/assets/0c0eb0bc-ea01-4642-a63a-69687b2ba13e" /> | <img width="2736" height="1586" alt="2_after" src="https://github.com/user-attachments/assets/68dba045-60b2-462e-9f34-5bb038a4a245" /> | </details> <details> <summary>3. Source no longer exists</summary> | Steps | Before | After | | --- | --- | --- | | 1. Move `a.txt` into `docs/`<br>2. Run `rm docs/a.txt`<br>3. Undo | <img width="2736" height="1586" alt="3_before" src="https://github.com/user-attachments/assets/2f55327c-d478-44f5-ac85-5e0b10044a52" /> | <img width="2736" height="1586" alt="3_after" src="https://github.com/user-attachments/assets/5296b431-c2a1-408e-8920-9f2d5c1d169a" /> | </details> <details> <summary>4. Restore from emptied Trash</summary> | Steps | Before | After | | --- | --- | --- | | 1. Delete `a.txt` (moves it to Trash)<br>2. Empty it from the system Trash<br>3. Undo | <img width="2736" height="1586" alt="4_before" src="https://github.com/user-attachments/assets/41966e44-409a-4ae2-ada1-59992658f1b5" /> | <img width="2736" height="1586" alt="4_after" src="https://github.com/user-attachments/assets/f6df01f9-0702-4f28-80aa-eb2289077ea5" /> | </details> <details> <summary>5. Restore collision</summary> | Steps | Before | After | | --- | --- | --- | | 1. Delete `a.txt` (to Trash)<br>2. Run `touch a.txt`<br>3. Undo | <img width="2736" height="1586" alt="5_before" src="https://github.com/user-attachments/assets/f4151e85-7668-4dab-8cf4-b45ef0fdb741" /> | <img width="2736" height="1586" alt="5_after" src="https://github.com/user-attachments/assets/3f25aa56-1b59-4230-9a15-b39a0d280a48" /> | </details> <details> <summary>6. Trash a file that's gone</summary> | Steps | Before | After | | --- | --- | --- | | 1. Create `empty.txt` in the panel<br>2. Run `rm empty.txt`<br>3. Undo | <img width="2736" height="1586" alt="6_before" src="https://github.com/user-attachments/assets/077edeb8-3618-4b72-b49f-9d1cc3a801d5" /> | <img width="2736" height="1586" alt="6_after" src="https://github.com/user-attachments/assets/4b1d6689-93b1-4725-8829-2f71b4b586e9" /> | </details> ### Redo failures <details> <summary>7. Redo a move into an occupied destination</summary> | Steps | Before | After | | --- | --- | --- | | 1. Move `a.txt` into `docs/`, then Undo (file back at root)<br>2. Run `touch docs/a.txt`<br>3. Redo | <img width="2736" height="1586" alt="7_before" src="https://github.com/user-attachments/assets/d6591d08-b0a1-4992-866f-fcc26491ba8c" /> | <img width="2736" height="1586" alt="7_after" src="https://github.com/user-attachments/assets/b46d5fe2-09be-4264-9834-f5965f5f1150" /> | </details> <details> <summary>8. Redo a restore after the Trash was emptied</summary> | Steps | Before | After | | --- | --- | --- | | 1. Create `empty.txt`, then Undo (it gets trashed)<br>2. Empty it from the system Trash<br>3. Redo | <img width="2736" height="1586" alt="8_before" src="https://github.com/user-attachments/assets/9ced2696-1bdf-4b33-aaaf-abc015787505" /> | <img width="2736" height="1586" alt="8_after" src="https://github.com/user-attachments/assets/bfc84fc3-c97f-474d-857c-3d5137d06b83" /> | </details> <details> <summary>9. Redo a re-trash of a deleted file</summary> | Steps | Before | After | | --- | --- | --- | | 1. Delete `a.txt` (to Trash), then Undo (restores it)<br>2. Run `rm a.txt`<br>3. Redo | <img width="2736" height="1586" alt="9_before" src="https://github.com/user-attachments/assets/3152787d-c02c-482e-a70a-600e97a44b3b" /> | <img width="2736" height="1586" alt="9_after" src="https://github.com/user-attachments/assets/7dd40497-0dfc-41fa-a6ac-772562d29258" /> | </details> --- Release Notes: - N/A |
||
|
|
ab92195a02 |
fs: Update trash-rs version (#61721)
# Objective Update the version of `trash-rs` used in order to contain the fix for the panic when restoring a non-existing trash item in Linux – https://github.com/zed-industries/trash-rs/commit/41c6c800d884a89351f3b8856d12894cccee261d . ## Solution N/A ## Testing N/A ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - N/A |
||
|
|
65f3428fb5 |
collab_panel: Make focus and selected styles consistent (#61749)
As in, make it consistent with the other panels, where we use a blue border for the focused state and a different background color for the selected state. It's been a long time coming little design fix to the collab panel. <img width="450" alt="Screenshot 2026-07-27 at 8 01@2x" src="https://github.com/user-attachments/assets/70724483-8092-4993-afd4-5faa3d3fae51" /> Release Notes: - N/A |
||
|
|
a5d1afa534 |
Fix unexpected argument ' ' upon trying to debug while cargo is indexing (#61241)
# Objective Fixes #47119 ## Solution Strip empty-string arguments from the resolved build task in debugger_ui::session::running::RunningState::resolve_scenario after template substitution, before spawning the build command. This is the correct place to do this as: 1.It's the first point in the pipeline where the empty strings exist as concrete values rather than unsubstituted template variables. 2. It acts as a general safety net for any future locator that produces a shell-command build step with placeholder args. 3. Other languages (Go, Node, Python) use build: None and pass structured JSON directly to their DAP adapters, so they never hit this code path. ## Testing Performed visual and self testing by replicating the issue. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed unexpected argument '' upon trying to debug while cargo is indexing --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com> |
||
|
|
8e4e5a39ee |
Match the macOS app appearance to the selected theme (#58902)
Closes #5049. When the system is in light mode but Zed uses a dark theme, the macOS window chrome — the window border and the titlebar — is rendered light, leaving a pale, low-contrast edge that makes the window look washed out. Zed's own content renders correctly; the affected chrome is drawn by AppKit, not Zed. Why it happens: `NSWindow` conforms to `NSAppearanceCustomization`, so a window's appearance is inherited app → window → view and resolved through `effectiveAppearance` unless an explicit appearance is set. Zed never set one, so every window inherited the *system* appearance and AppKit drew the chrome for light mode regardless of the dark theme. The fix uses the override AppKit provides for exactly this: set `NSApplication.appearance` app-wide, so every window inherits it. VSCode (`window.systemColorTheme`) and JetBrains IDEs do the same. <img width="2600" height="1346" alt="after-light" src="https://github.com/user-attachments/assets/c31376af-8f51-4c36-a62f-55714f63b59c" /> ## GPUI - Add `App::set_window_appearance(Option<WindowAppearance>)`, the setter paired with the existing `App::window_appearance()` getter. `Some(_)` forces a light/dark appearance; `None` clears the override and follows the system again. - macOS sets `NSApplication.appearance` (`None` → `nil`); no-op on other platforms. - Demo: `cargo run -p gpui --example window_appearance`. ## Zed - An explicit light/dark theme (or a static theme) forces the matching chrome; `System` follows the OS. - Wired once at startup via a global settings observer, so every window — including the settings window — stays in sync. | Before | After | | --- | --- | | <img width="3630" height="1878" alt="before-light" src="https://github.com/user-attachments/assets/44c9ab66-c0cf-433a-93b0-17446b34a284" /> | <img width="3686" height="1832" alt="SCR-20260609-nzjk" src="https://github.com/user-attachments/assets/32b0412b-0913-4e68-acba-bf39dcb6aa6a" /> | References: [`NSAppearanceCustomization`](https://developer.apple.com/documentation/appkit/nsappearancecustomization) · [`NSApplication.appearance`](https://developer.apple.com/documentation/appkit/nsapplication/appearance) Release Notes: - Fixed the macOS window border and titlebar not matching the selected theme when the system appearance differed (for example, a dark theme under a light system theme). ([#5049](https://github.com/zed-industries/zed/issues/5049)) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
c97b7c0ea4 |
gpui_web: Fix some bugs (#61707)
Release Notes: - N/A or Added/Fixed/Improved ... |
||
|
|
4a1df1f7ca |
markdown_preview: Open relative links at line (#60864)
Closes #60733 # Objective Markdown Preview treats a relative `path:line[:column]` destination as a literal filename. When that file does not exist, the link falls through to the system URL handler instead of opening the workspace file at the requested position. ## Solution - Recognize position suffixes on relative Markdown links. - Convert GitHub-style `#L42` fragments into the same positioned target used by `path:42`, so both forms share one resolution and opening path. - Resolve links with `workspace::path_link::possible_open_target` using the Markdown source directory. This keeps the remote-project path resolution added in #61438. - Open resolved targets with `editor::items::open_resolved_target`, including its one-based row and column handling. - Preserve valid URI schemes and fall back to the existing Markdown link behavior when no workspace target resolves. ## Testing - Extended the Markdown Preview GPUI regression test to cover relative `path:line:column`, GitHub-style `#Lline`, subfolder-relative resolution, and custom URI schemes. - `git diff --check` passes. - The focused Rust test could not start in the current macOS environment because the Rust toolchain binaries hang in the dynamic loader before Cargo runs. PR Actions are awaiting maintainer approval. ## Self-Review Checklist: - [x] I have reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed UI and icon guidelines - [x] Tests cover the new and changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - Fixed Markdown Preview links using workspace-relative paths with line and column suffixes. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com> |
||
|
|
a1510de54e |
agent: Report follow-up messages as tool permission denials (#61754)
# Objective - Treat a follow-up sent during pending tool approval as a denial the agent can understand. ## Solution - Preserve the follow-up interruption through permission handling and return a specific denial result to the model. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Agent: Fixed agents not recognizing follow-up messages as denial of pending tool calls. |
||
|
|
865318723e |
reqwest_client: Allow configuring a per-read idle timeout (#61753)
Long-lived streaming responses (LLM completions) can stall when the socket goes silent but the connection is never closed, leaving a read that never returns to hang the request indefinitely. Add an opt-in read_timeout parameter. Release Notes: - N/A |
||
|
|
7b030b5008 |
project: Fix panic when an inlay hint response outlives its buffer version (#61747)
# Objective Fix a nightly crash where Zed aborts on a bounds-check panic in the inlay hint cache. `LspStore::inlay_hints` captures a `RowChunk` before awaiting the language server, then reads the hint cache with that chunk's id afterwards. If the buffer shrank meanwhile, `latest_lsp_data` has already rebuilt the cache with fewer chunks, so the stale id indexes out of bounds. Chunks are 50 rows, so the reported crash only needed a ~150-250 line deletion, not a drastic edit. Regressed in #61523. Nightly only; the regressing commit is in no release tag, so this never reached preview or stable. Fixes ZED-AGY Fixes FR-142 ## Solution - Return an empty result when the buffer version no longer matches, so a stale chunk id can never index the rebuilt cache. The stale *writes* were already guarded by this version check; only the read sat outside it. - An empty result is already treated as "not fetched", so the chunk is simply re-requested on the next refresh. ## Testing `test_inlay_hint_response_after_buffer_shrinks` reproduces the abort deterministically and passes with the fix. Note that it drives the race through a fake language server rather than a real one. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - N/A |
||
|
|
3b79b56201 |
agent_ui: Use buffer font in more places (#61738)
Release Notes: - N/A |
||
|
|
b25d3eeeca |
release_channel: Allow compile time overrides that don't use include_str! (#61731)
Some crates in zed use `include_str!("../../zed/RELEASE_CHANNEL")`,
which breaks when used as a dependency in a crane nix build (each crate
is built in isolation).
This adds a compile time env var to skip that check, which allows crates
in the zed repo to be used as dependencies in a crane build.
---
Release Notes:
- N/A or Added/Fixed/Improved ...
|
||
|
|
94c6647995 |
Fix zoomed panels closing when focus moves within the panel (#59439)
Closes FR-139 Most focus-lost issues that close the agent panel in Zen mode stem from panels returning a transient child editor's focus handle from `Focusable::focus_handle`. The Zen-mode check closes the zoomed panel when the focused element is not a descendant of the panel's focus handle, so any focus movement inside the panel that landed outside that child editor looked like the panel losing focus. This PR separates the two roles that handle was serving: - `Focusable::focus_handle` now always returns a stable handle tracked at the panel's root element, used for containment checks (Zen-mode auto-close, `toggle_panel_focus`, dock focus subscriptions). - The new `Panel::activation_focus_handle` returns what should receive focus when the panel is activated (e.g. a filter/commit/message editor) and must be a focus-tree descendant of the root handle. All "focus the panel" callsites in workspace/dock now use it. Migrated panels: `AgentPanel` (including thread views and the toolbar title editor), `CollabPanel`, `GitPanel`, `OutlinePanel`, and `TerminalPanel` (previously delegated to the active pane, so focus in a non-active pane dropped containment). `CollabPanel` activation falls back to the panel root when signed out or collaboration is disabled, since the filter editor isn't rendered in those states. Also fixes duplicate element ids for tool calls with multiple content blocks. Tests: a regression test that clicks tool-call output and focuses the thread title editor while zoomed (both previously closed Zen mode), and a dock-level test asserting the activation handle receives focus on panel activation while the panel root reports containment. Release Notes: - Fixed zoomed panels (e.g. the agent panel in Zen mode) closing unexpectedly when focus moved to elements inside the panel, such as tool call output or the thread title editor. |
||
|
|
9dcc3c2909 |
Fix Bedrock effort and regional routing (#61597)
Fixes Amazon Bedrock adaptive-thinking requests so the selected effort reaches Anthropic models, and routes Claude Opus 4.7 and 4.8 through their documented Japanese and Canadian inference profiles. Release Notes: - Fixed Amazon Bedrock effort selection and regional routing for Claude Opus 4.7 and 4.8. |
||
|
|
c29ba6c212 |
git_panel: Use specific label and prompt for reverting deleted file (#61554)
# Objective I expected a different label for reverting a file deletion like Zed already has for reverting a file creation. ## Solution This PR implements a new label and prompt. VS Code also shows a different prompt while keeping the label static but I think it makes more sense to let both adapt. ## Testing Just deleted a file and checked menu label and prompt. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable ## Showcase <img width="363" height="139" alt="image" src="https://github.com/user-attachments/assets/6be7e5b9-7250-449e-9cba-ea5a2099dd3a" /> <img width="349" height="240" alt="image" src="https://github.com/user-attachments/assets/d87d5b4b-ff29-4976-8078-314c94a71896" /> --- Release Notes: - Git Panel: Added specific label and prompt to context menu for reverting a deleted file |
||
|
|
09c5c27474 |
search: Preserve cleared query when reopening the text finder (#61585)
## Context Closes #61394 The Text Finder persists the last query per workspace (in the `text_finder_queries` table) so it can seed itself on reopen. Persistence happens in `TextFinder::on_before_dismiss`, but it was guarded by `if !query.is_empty()`, so clearing the query and dismissing never wrote anything. The stale non-empty query stayed in the database and got restored on the next open, making it impossible to "clear and keep it cleared." This removes the guard so dismissal always persists the current query, including an empty one. The read side already treats an empty stored query as "nothing to restore" (`load_last_search` returns `None` for an empty string), so an empty write cleanly clears the seed instead of leaving the previous query behind. Manual test below : [Screencast from 2026-07-24 15-24-33.webm](https://github.com/user-attachments/assets/ba305f54-8ec2-4d3d-be0b-e2eb001bb204) ## How to Review **`crates/search/src/text_finder.rs`** `on_before_dismiss` no longer gates the write on a non-empty query. It always calls `store_last_search` with the picker's current query and options. `store_last_search` still early-returns for workspaces without a `database_id`, so unpersisted workspaces are unaffected, and `load_last_search` still maps an empty persisted query to `None`, so `seed_query` won't resurrect it. The active-item selection still takes priority over the persisted value on reopen, so seeding from a live editor selection is unchanged. The tests' shared `init_test` now installs a test `db::AppDatabase` global. This is required because the new test is the first one to actually reach `TextFinderDb::global(cx)`. The existing `test_dismiss_from_within_workspace_update` leaves the workspace's `database_id` as `None`, so it short-circuits before touching the DB. `test_clearing_query_does_not_restore_previous_query` exercises the real persistence path: it assigns a workspace `database_id` (`set_random_database_id` + `flush_serialization`), opens the finder with a query, dismisses, and asserts the query round-trips through `seed_query`; then it reopens, clears the query via `set_query("")`, dismisses, and asserts `seed_query` is now `None`. The positive round-trip assertion keeps the negative case from passing vacuously. ## 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: - Fixed the project search / Text Finder restoring a previous query after it had been cleared and dismissed |
||
|
|
edd906859c |
Revert force hardmark settings for documentation hover (#61622)
Closes https://github.com/zed-industries/zed/issues/60777 # Objective - Due to #59426, forcing docString softmark to hardmark, an regression has appeared. It causes all docString on different language to load newLine (`\n`) by default, instead of soft wrap. - By checking the issue, turns out we should not setting `soft_break_as_hard_break: true`, this will make the hover docString less - Details can refer to #60777 ## Solution - Revert settings by removing the line in `hover_popover.rs:742` ## Testing - About the testing result and comparsion, you can refer to #60777 - Updated test `test_hover_markdown_preserves_soft_breaks` to `test_hover_markdown_soft_breaks_reflow_per_commonmark` ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed an issue where hover documentation could have too many line breaks. --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com> |
||
|
|
11a8837bad |
git_ui: Ensure discarding tracked changes respects staging state (#61608)
Closes #56020 Release Notes: - Fixed Discard Tracked Changes discarding unstaged files --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com> |
||
|
|
28f47fa3a0 |
Skip [DONE] stream terminator in anthropic and google_ai SSE parsers (#61627)
## Problem
When `api_url` points to a proxy or gateway that appends `data: [DONE]`
to the SSE stream, every streaming completion fails with:
```
error deserializing Anthropic API response: expected value at line 1 column 2
```
In the UI this surfaces as **"error deserializing Anthropic API response
— Retrying (Attempt 3 of 3)"** followed by **"Connection Interrupted"**,
even though the proxy returned a well-formed stream and the model's full
response was already delivered before the terminator. The failure is
100% reproducible on multi-turn tool-use conversations (Zed reads the
stream to completion after each turn, so it always reaches the trailing
`[DONE]`) and intermittent on single-turn conversations (depending on
whether the connection closes before the line is read). The same class
of error appears in the `google_ai` crate as `Error parsing JSON: ...
"[DONE]"`.
Neither side is at fault here. Zed's current parser is a correct
implementation of the Anthropic and Gemini specs, which terminate
streams by connection close and never emit `[DONE]`; at the same time,
appending a `[DONE]` terminator is a common, legitimate convention among
SSE gateways. This PR is a compatibility improvement that makes Zed
robust to that widely-used stream shape, so streaming works whether or
not the upstream emits the terminator.
## Why Zed crashes but the Anthropic SDK does not
The Anthropic TypeScript and Python SDKs handle this correctly
**without** any explicit `[DONE]` check. Their SSE parser uses a
two-layer architecture:
1. **SSE framing layer** — parses `event:` / `data:` fields into
`{event, data}` objects without inspecting the data payload.
2. **Event dispatch layer** — only calls `JSON.parse` on events whose
`event` name is in a known whitelist (`message_start`,
`content_block_delta`, etc.). A bare `data:` line with no preceding
`event:` line yields `event: null`, which is not in the whitelist and is
silently ignored.
So when a proxy sends `data: [DONE]`, the SDK produces `{event: null,
data: "[DONE]"}`, the dispatch layer drops it, and `JSON.parse` is never
run on `[DONE]`. Claude Code and Cline both use the Anthropic SDK under
the hood, so they inherit this behavior and never crash on `[DONE]`.
Zed's `anthropic` and `google_ai` crates use a simpler single-layer
parser: strip the `data:` prefix, then unconditionally
`serde_json::from_str` the remainder. There is no event-name dispatch,
so `[DONE]` goes straight into the JSON parser — `[` looks like an array
start, `D` is not a valid value, serde reports `expected value at line 1
column 2`, and the stream dies.
## Fix
Add a one-line guard after prefix stripping: if the trimmed payload is
`[DONE]`, return `None` from the `filter_map` closure. This is a
lightweight equivalent of the SDK's whitelist-ignore behavior — same
result (silently skip the terminator), without restructuring the parser
into a full event-name dispatch architecture.
Two commits, one per crate:
1. `anthropic` — guard in `stream_completion_with_rate_limit_info`
2. `google_ai` — identical guard in `stream_generate_content`
## Scope
The other ten SSE-based providers in this repo (`open_ai`, `deepseek`,
`mistral`, `open_router`, `lmstudio`, `llama_cpp`, `copilot_chat`)
already handle `[DONE]` because their upstream specs (OpenAI-compatible)
define it as a required stream terminator. `ollama` (NDJSON) and
`bedrock` (AWS SDK event stream) do not use SSE. After this PR, every
SSE parser in Zed handles `[DONE]` without error.
## Safety
- Official Anthropic and Gemini APIs never send `[DONE]`; the guard is a
no-op on direct connections.
- `line.trim() == "[DONE]"` handles both `data: [DONE]` and
`data:[DONE]`.
- Returning `None` drops the line silently; the stream concludes on the
next EOF as usual.
Release Notes:
- Fixed streaming completions failing with "error deserializing
Anthropic API response" when the SSE endpoint appends a `[DONE]` stream
terminator (affects custom `api_url` proxies for Anthropic and Google
Gemini)
|
||
|
|
068691a80f |
agent: Improve error messaging for edit_file tool (#61662)
# Objective Currently, when a model provides the wrong parameters to the edit file tool, it gets back the opaque error message `data did not match any variant of untagged enum ValueOrJsonString`. At least some models (DeepSeek in my experience) can't figure out what to do from this point, and keep trying the same wrong parameter names in the tool call before eventually falling back to using `ed`. This may address https://github.com/zed-industries/zed/issues/58622. ## Solution Rather than attempting to deserialize to the `ValueOrJsonString` enum, try to deserialize as a JSON string and then as a value in turn, so that deserialization errors better propagate. ## Testing Using DeepSeek V4 Pro. Tried it out in a reloaded conversation where the edit tool was consistently failing. Asked it to stress-test the edit tool. Only one edit failed after a few successful attempts, and returned the error message "missing field `new_text`". Subsequent edits worked again rather than resulting in a doom loop. I don't think the model noticed what happened, but it seemed to help. <img width="366" height="551" alt="image" src="https://github.com/user-attachments/assets/6f9c0c8d-bf94-4670-bad0-0ead5c1fff4e" /> ... <img width="346" height="153" alt="image" src="https://github.com/user-attachments/assets/2afa2901-9a90-4142-aa9d-ff32a7be0d0c" /> --- Release Notes: - Improved edit_file tool error messaging. --------- Co-authored-by: MrSubidubi <finn@zed.dev> |
||
|
|
33e2058302 |
acp: Validate and surface more elicitation warnings (#61708)
Eventually more of this should move into the SDK I think, but makes several states with forms and urls clearer to the user. Release Notes: - N/A |
||
|
|
1ca8f8396b |
Add agent panel font family settings (#59629)
Objective: Allow users to configure the font families used by agent panel content separately from the main UI and buffer fonts. Solution: - Add `agent_ui_font_family` for agent responses in the agent panel. - Add `agent_buffer_font_family` for the agent panel message editor and user messages. - Keep context menus on the primary UI font family. - Document the new settings and expose them in the settings UI. Testing: - Ran `cargo fmt`. - Ran `cargo check -p settings_content -p theme_settings -p markdown -p agent_ui -p settings_ui -p ui`. - Ran `git diff --check`. - Manually tested the agent panel font behavior in a dev build. Release Notes: - Added settings for configuring agent panel UI and buffer font families. Co-authored-by: Finn Evers <finn@zed.dev> |
||
|
|
e923a802ab |
ci: Grant version bump token more permissions (#61709)
This should hopefully fix the issue with the version bumps we were seeing - to bypass push protections, the token seems to need workflow permissions for some reason as well. Release Notes: - N/A |
||
|
|
63b52a7ee3 |
gpui: Make HSLA functions const (#61682)
# Objective Make hsla functions `const`. ## Solution Made Hsla-related functions `const fn`. ## Testing > Did you test these changes? If so, how? Ran `cargo test -p gpui color` to verify the color-related tests pass. > Are there any parts that need more testing? No additional testing is required since this change only changes existing color functions to `const fn`. > How can other people (reviewers) test your changes? Is there anything specific they need to know? Reviewers can run `cargo test -p gpui color` to verify the changes. > If relevant, what platforms did you test these changes on, and are there any important ones you can't test? Tested on macOS. No platform-specific behavior is expected. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - N/A |
||
|
|
5a020093f5 |
Fix typo in .rules (#61693)
## Objective A phrase in `.rules` was missing a verb. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - N/A |
||
|
|
50da8c40dc |
Avoid unnecessary git scan when the agent creates a checkpoint (#61271)
Agent checkpointing is implemented by staging selected files to a temporary git index file, then creating a commit. To avoid checkpointing commonly-excluded files even when the user doesn't have them in their gitignore, we write a temporary override to .git/info/exclude while running the staging. However, this causes us to do an unnecessary git scan when a checkpoint happens, because in general we want to do this when `.git/info/exclude` changes (the user might have edited it). This PR fixes that by doing the staging in two steps: - First, we stage any tracked files - Then we get a list of untracked files to include and stage those explicitly. The list is obtained by running `git ls-files` with a custom ignore file in addition to the `--standard` ignores; we write that custom ignore file to a path ending in `tmp` under .git, which means that our worktree code will not start a git scan in response to its events (the same way it already works for the temporary index file). .git/info/exclude is never touched. Note that we already listed all untracked files before this PR, in order to exclude the large ones. Release Notes: - Fixed Zed doing unnecessary work when the agent created a checkpoint. |
||
|
|
30730a305a |
fs: Fix crash loop from closedir panic during worktree scan (#59953)
# Objective Fixes #59952. Zed crash-loops on launch. The faulting thread aborts inside the Rust standard library while closing a directory handle during background worktree scanning: `std`'s `DirStream::drop` (`library/std/src/sys/fs/unix.rs`) `assert!`s that `closedir()` succeeds unless the error is `EINTR`. That handle originates in `RealFs::read_dir`, which wraps `std::fs::read_dir(path)` in `stream::iter(...)` and carries the live `ReadDir` across async boundaries; the worktree `BackgroundScanner` (`scan_dir` → `forcibly_load_paths`) later drops the stream. If `closedir()` returns a non-`EINTR` error (e.g. `EBADF` under file-descriptor pressure — seen alongside repeated `unable to start FSEvent stream` warnings on a large dependency tree), `std` panics inside `Drop`. Zed's `crashes::panic_hook` turns any panic into `process::abort()`, and because the same workspace is re-scanned every launch, this is a permanent crash loop. (`catch_unwind` can't help: the hook aborts before unwinding.) ## Solution Stop relying on `std`'s asserting close. Add a `read_dir_entries(path)` helper that reads entries eagerly so the directory handle is opened and closed within a single call: - On unix, read via libc (`opendir`/`readdir`/`closedir`) and **deliberately ignore a failing `closedir`**, so a close error degrades gracefully instead of aborting the process. - On non-unix, keep `std::fs::read_dir` (which has no such assert) but collect eagerly so the handle is dropped within the call. `RealFs::read_dir` now calls this helper. The change is scoped to `crates/fs/src/fs.rs`; the watcher, scanner, and panic hook are untouched. ## Testing - Added unit tests in `crates/fs/src/fs.rs` for `read_dir_entries`: entry listing, `.`/`..` exclusion, empty directories, and the missing-directory error path. - `cargo test -p fs read_dir` → 3 passed. - `RUSTFLAGS="-D warnings" cargo build -p fs`, `cargo clippy -p fs --all-features --all-targets -- -D warnings`, and `cargo fmt -p fs --check` are all clean. - Tested on macOS (aarch64). The `fs` crate compiles within the full `cargo build -p zed` graph. I could not produce a running app binary in my environment (the `gpui_macos` Metal step needs full Xcode, not just Command Line Tools) — reviewers on a full Xcode setup can `cargo run -p zed`. - The original `closedir` `EBADF` is not deterministically reproducible, so the fix is structural rather than verified against a live repro; the tests guard the read path and behavior. ## 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 adheres to Zed's UI standards — N/A (no UI change) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed Zed crash-looping on launch when `closedir` fails during background directory scanning ([#59952](https://github.com/zed-industries/zed/issues/59952)). --------- Co-authored-by: Cole Miller <cole@zed.dev> |
||
|
|
23cb8712ba |
workspace: Retain panes while saving (#61683)
Save tasks can suspend while waiting for prompts, formatting, or filesystem I/O. Holding only a WeakEntity<Pane> allowed the pane to be released during those suspension points, surfacing an internal 'entity released' error as a failed save. Instead upgrade the pane once the save operation starts so we can ensure it finishes. --- Release Notes: - N/A or Added/Fixed/Improved ... |
||
|
|
7f96e13d7b |
Fall back to path-only mention for binary files in the agent panel (#61279)
## Summary - Dragging a binary file (docx, xlsx, pdf, etc.) into the agent panel's message editor inserted a mention link, then asynchronously tried to load its content as a text buffer. That failed with "Binary files are not supported", which surfaced an error toast **and** deleted the mention text that had already been inserted. - `confirm_mention_for_file` now catches that specific failure and falls back to `Mention::Link` (a path-only reference, same as directory mentions already use), instead of failing the whole mention and reverting the edit. ## Test plan - [ ] Drag a `.docx` or `.xlsx` file into the agent panel chat input — the file path mention should stay inserted with no error toast. - [ ] Drag a regular text file in — content mention still works as before (unaffected code path). Release Notes: - Fixed dragging a binary file (docx, xlsx, pdf, etc.) into the agent panel deleting the inserted reference and showing a "Binary files are not supported" error --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> Co-authored-by: Cole Miller <cole@zed.dev> |
||
|
|
afd17238ed |
editor: Check anchor validity for hovered links (#61686)
Closes FR-112 Otherwise, if a multibuffer snapshot changed under the hood for example one of the paths changed, without doing an explicit validity check, we would panic during comparison instead. Release Notes: - Fixed panic when hovering links during an under-the-hood multibuffer changes. |
||
|
|
c214057e08 |
gpui_wgpu: Fix bidi paragraph shaping crash (#61651)
Closes FR-133 `cosmic-text`'s BiDi line shaping machinery (`ShapeLine::new`) asserts that every BiDi paragraph is following the same direction. It turns out that our `gpui_wgpu` line shaping adapter would not account for that leading to panics if text contained multiple BiDi paragraphs with multiple directions. Not super common but worth fixing as the fix is not super complicated. At the same time, I'd like to point out that there is a patch submitted to `cosmic-text` that redoes shaping logic so that this is no longer illegal: https://github.com/pop-os/cosmic-text/pull/508 If it gets accepted, we can revert this fix. Release Notes: - Fixed panic in `gpui_wgpu` if text contained multiple BiDi paragraphs with mismatched directions. |
||
|
|
1764c2fa67 |
csv_preview: Refine filter popover UI (#61138)
# Objective
- The column filter popover was a static `ContextMenu`: no search, and
it didn't scale to columns with many unique values.
## Solution
- Replaced it with a `Picker<ColumnFilterDelegate>` with fuzzy search
and match highlighting over the column's unique values.
- Row order is frozen at open time (available first, then values hidden
by other filters under a "Hidden by other filters" header) so toggling a
value doesn't reshuffle the list.
- Added a footer with `{selected} / {total} rows selected` and "Clear
all".
- Added `fuzzy` and `picker` deps to `csv_preview`.
## Testing
- Search narrows to fuzzy matches with highlighting.
- Toggling a value updates its checkmark and footer count without
closing or reordering the list.
- Values excluded by another column's filter show disabled under "Hidden
by other filters".
- "Clear all" clears the column's filters and keeps the popover open.
## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
## Showcase
| Before | After |
| --- | --- |
| <img width="660" height="351" alt="image"
src="https://github.com/user-attachments/assets/c78084a2-d327-4d48-9c05-f35383455713"
/> | <img width="660" height="354" alt="image"
src="https://github.com/user-attachments/assets/910d52ef-4530-4ac7-91ac-3db318cf6c19"
/> |
**+ search**
<img width="972" height="574" alt="image"
src="https://github.com/user-attachments/assets/1a26d0fc-c96c-4973-818d-7d053e8cce73"
/>
---
Release Notes:
- N/A
|
||
|
|
a50a292fd1 |
gpui: Fix dropped frames when scrolling an unfocused window (#61600)
Scroll events are delivered to the window under the pointer even when it isn't focused, but we cap inactive windows at ~30fps to save energy, so scrolling an unfocused window visibly drops frames. We now exempt high-rate input from the cap using the existing `InputRateTracker`: a trackpad scroll stream lifts it while events are arriving and for one second after the last burst, then the cap resumes on its own. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed dropped frames when scrolling unfocused windows. |
||
|
|
e191dd00c7 |
Fix crash when dumping debug buffers in a collab session (#61616)
The `dev: dump input latency histogram` and `dev: dump accessibility tree` actions called `Project::create_local_buffer`, which panics on remote projects — so running either one as a guest in a collab session aborted the whole app. Both now use the async `Project::create_buffer` + `set_text` instead (the same pattern `open_log_file` uses), which routes through the collab protocol on remote projects. Since the collab-created buffer is visible to other participants, the latency report now includes a "Reported from <username>'s machine" line when the project is shared, using the collab username so we don't expose anything that isn't already shared with the session. While restructuring the handler I also split snapshotting from formatting: the histogram snapshot (and the delta baseline) is captured synchronously when the action fires, and the report string is built on a background task. The accessibility tree dump stays synchronous because gpui doesn't currently expose the captured tree data outside the window borrow, and adding public API for a debug action's JSON pretty-print didn't seem worth it. Release Notes: - Fixed a crash when running the `dev: dump input latency histogram` or `dev: dump accessibility tree` actions in a shared project. |
||
|
|
401a0c7e3d |
agent_ui: Fix selection mentions from "Add to Agent Thread" not opening files (#61621)
# Objective Fixes #59333. Selection mentions created with "Add to Agent Thread" could not be clicked to open the referenced file, while selection mentions created by pasting were navigable. ## Solution The ready selection-mention crease did not receive its `MentionUri` or `Workspace`, so `MentionCrease` could not install its click handler. Pass the workspace through the action-completion callback and provide both values to the shared crease renderer, enabling its existing navigation behavior. ## Testing I tested these changes locally. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase Before: https://github.com/user-attachments/assets/8dd4a2d0-4b22-4fb3-8777-cf97b6436b91 After: https://github.com/user-attachments/assets/cff1cdb3-804a-45d8-a9c5-fdd8b35b6f8f --- Release Notes: - Fixed selection mentions added with "Add to Agent Thread" not opening their referenced files. |
||
|
|
826f28eb8f |
gpui_windows: Align inactive GPUI popup behavior on Windows with other platforms (#61411)
*As an LLM was used to translate the PR message, the original text is included alongside the translation in accordance with the contributing guidelines. # Objective > On Windows, GPUI accepted `WindowKind::PopUp` and `focus: false`, but the window creation path ignored both options. This caused two problems with the notification popup shown when an agent finished its work: > > * When another window had focus, the popup could appear behind it. > * When Zed had focus, the popup could steal focus. > > This pull request applies `WindowKind::PopUp` and `focus: false` to windows on Windows, bringing popup behavior in line with other operating systems. Windows版GPUIでは、`WindowKind::PopUp`と`focus: false`を指定しても、それらのオプションが実際のウィンドウ生成処理では無視されていました。そのため、エージェントの作業が完了したときに表示される通知で次のような問題が発生していました。 - ほかのウィンドウにフォーカスがある場合にポップアップがほかのウィンドウの背後に隠れてしまう - Zedにフォーカスがある場合はポップアップがフォーカスを奪ってしまう このプルリクエストでは、Windows上でも`WindowKind::PopUp`と`focus: false`をウィンドウに反映させるようにし、ポップアップの挙動をほかのOSと一致させます。 ## Solution > This PR updates popup creation in GPUI on Windows to match the behavior on other platforms. When you specify `WindowKind::PopUp` and `focus: false`, GPUI now keeps the popup above other windows without stealing focus. > > Keeping a `focus: false` popup above other windows caused the IME to commit text under composition when the popup appeared. This PR also fixes that issue. Windows版GPUIのポップアップの生成処理をほかのプラットフォームの挙動と一致するように変更しました。このPRでは、`WindowKind::PopUp`と`focus: false`を指定したときにポップアップウィンドウを最前面に表示し、フォーカスを奪わないようにしました。 また、`focus: false`のポップアップが最前面に表示されるようにしたことで、ポップアップが表示されたときにIMEで入力中のテキストが意図せず確定されるようになってしまったため、それに対する修正も含まれています。 ## Testing > I built Zed on Windows and displayed a test agent notification to verify the following: > > * The popup stays above other windows when another window has focus. > * When Zed has focus, a popup with `focus: false` does not steal focus or interrupt IME input. > * The buttons in the popup remain clickable. Windows上でZedをビルドし、テスト用のエージェント通知を表示して次の項目をテストしました。 - ほかのウィンドウにフォーカスがある場合でもポップアップが最前面に表示される - Zedにフォーカスがある場合に`focus: false`のポップアップがフォーカスを奪わず、IMEを使った入力も阻害しない - ポップアップ内のボタンをクリックできる ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase > Note: I added a button to display an agent notification for testing in this video, but this PR does not include that button. ※この動画ではテスト目的でエージェント通知を表示するボタンを追加していますが、このPRの変更には含まれていません。 ### Before The popup window is hidden when another window has focus: https://github.com/user-attachments/assets/5312729b-1409-4c81-a169-dd031099059b A popup with `focus: false` steals focus: https://github.com/user-attachments/assets/dd1ac2a2-d5e8-4f8f-bc47-6cc659a10951 ### After The popup window stays on top even when another window has focus: https://github.com/user-attachments/assets/af058921-14fc-4ca5-9698-758202c4c888 A popup with `focus: false` does not steal focus or interrupt text input: https://github.com/user-attachments/assets/9bc487c6-ae68-4ec0-9073-1257b91e06a9 --- Release Notes: - Fixed Windows agent notifications appearing behind other windows, stealing input focus, or committing active IME composition. --------- Co-authored-by: John Tur <john-tur@outlook.com> |
||
|
|
a3ac036eb6 |
Fix: prevent completion labels and docs from being truncated (#61324)
# Objective - Fixes #60374 ## Solution - Moved the `documentation_label` from the `ListItem::end_slot` into the main `h_flex` layout alongside the `main_label`. - Added `.flex_shrink(1.0)` and `.truncate()` to the documentation container. - To allow it to shrink gracefully when space is tight. - Removed `.w_full()` from the main label's container. - To prevent it from aggressively occupying all available horizontal space, allowing the layout to balance the width between the label and the documentation. ## Testing - Visual and layout fixes tested manually by verifying the completion menu in `settings.json`. - All unit tests in the affected crate passed: `cargo test -p editor`. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase ### Visual change <img width="813" height="314" alt="スクリーンショット 2026-07-20 143707" src="https://github.com/user-attachments/assets/1daa3fa4-a479-465a-b7fd-cc803242c8a2" /> --- Release Notes: - Fixed(CompletionsMenu): prevent completion labels and docs from being truncated. --------- Co-authored-by: Nathan Sobo <nathan@zed.dev> |
||
|
|
b1b412ddb3 |
worktree: Suppress bare .git events explained by filtered sibling events (#61636)
Fixes an infinite git-rescan loop on Windows introduced by #59876. On Windows, creating or deleting a file directly inside .git updates the directory's last-write time, so ReadDirectoryChangesW reports a bare .git Changed event alongside the file's own event. Since #59876, bare .git events schedule a git rescan (to cope with coalesced FSEvents on macOS), so every filtered-out lock-file event still triggered a rescan through its paired bare event. Because a rescan's own `git diff --numstat HEAD` can take .git/index.lock (even under --no-optional-locks, e.g. in jj-colocated repos whose index never refreshes clean), each rescan re-triggered the next one, spawning ~9 git processes per cycle, ~4 cycles/sec, indefinitely. Bare .git events are now deferred while processing an event batch and only trigger a rescan when the batch contains no filtered event for the same git dir that explains the directory change. A standalone bare .git event (the macOS coalescing case #59876 addressed) still triggers a rescan, as does any batch containing a meaningful .git change. Release Notes: - N/A or Added/Fixed/Improved ... |
||
|
|
c2a610f7eb |
Add sextant glyph support to terminal rendering (#51072)
The Zed integrated terminal shows a broken QR code for apps with Expo SDK 55. This PR custom-paints the terminal block and sextant glyphs used for QR codes rather than relying on font glyphs. | SDK 55 Before | SDK 55 After | SDK 55 in Ghostty | | --- | --- | --- | | <img width="581" height="536" alt="Zed Nightly" src="https://github.com/user-attachments/assets/11054401-e947-4628-918a-0088042ccbf9" /> | <img width="563" height="535" alt="Zed dev build" src="https://github.com/user-attachments/assets/22e0bed3-9927-436d-8e0b-1ad0839f7bee" /> | <img width="576" height="502" alt="Ghostty" src="https://github.com/user-attachments/assets/c5f544d8-43e5-4dad-8bcd-8a36c401e9a7" /> | ### Other notes - Expo recently merged https://github.com/expo/expo/pull/46148, which causes Expo SDK 56 to fall back to the old QR code behavior when used in Zed. Once this PR merges, Expo can remove that fallback and use the compact QR code path in Zed again for Expo SDK 56+. | Current Fallback QR Code for SDK 54 and 56 | Fallback with this PR | | -- | -- | | <img width="744" height="684" alt="SCR-20260622-jwco" src="https://github.com/user-attachments/assets/414896aa-52bc-4de7-a6b9-59cd5af08de0" /> | <img width="616" height="752" alt="SCR-20260622-kfjh" src="https://github.com/user-attachments/assets/accbef7a-3365-480f-add3-08910141afa5" /> | This PR now also fixes TUIs in the integrated terminal for users using some fonts. | OpenCode w/ Monaco before change | OpenCode w/ Monaco after change | | --- | --- | | <img width="1512" height="982" alt="image" src="https://github.com/user-attachments/assets/a40f01a6-adf9-4e8b-909a-be53945eb813" /> | <img width="1512" height="982" alt="image" src="https://github.com/user-attachments/assets/b40bb22c-ef7e-466a-9bcf-46eb951087cd" /> | Finally, shade characters are now handled in the integrated terminal. | btop with tty graph before change | btop with tty graph after change | | --- | --- | | <img width="1516" height="863" alt="SCR-20260724-irpr-2" src="https://github.com/user-attachments/assets/afb77f01-6d3d-428a-b1be-7abb3d0e3d4d" /> | <img width="1516" height="876" alt="SCR-20260724-ises-2" src="https://github.com/user-attachments/assets/42262858-70da-4ba2-a5e6-96243fcfaadd" /> | #### This PR - Adds custom painting for terminal bitmap glyphs used by QR renderers: `█`, `▀`, `▄`, `▌`, `▐`, and U+1FB00..U+1FB3B sextants - Adds tests for handling sextants, blocks/half-blocks, and adjacent block merging Closes #50158 Closes #58830 Before you mark this PR as ready for review, make sure that you have: - [X] Added a solid test coverage and/or screenshots from doing manual testing - [X] Done a self-review taking into account security and performance aspects - [X] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fixed QR code rendering for Expo SDK 55 apps - Fixed rendering TUIs in the integrated terminal for some users --------- Co-authored-by: Kirill Bulatov <kirill@zed.dev> |
||
|
|
dbdea58349 |
collab: Fix multiworkspace location out of sync bugs (#61598)
### Summary This PR fixes three small bugs that could cause a multi-workspace's reported location to be out of sync with its actual location, which causes following to break in multiplayer collaboration sessions. The first bug was that each child workspace's title bar within a multi-workspace had its own `cx.observe_window_activation` subscription that would set the associated child workspace's project location. This caused problems because it ran for all child workspaces instead of just the active workspace within the multi-workspace. The fix was moving `cx.observe_window_activation` to the `cx.observe_new` call in the `call` crate that tracks newly created windows/multi-workspaces. The second bug was caused by an incorrect `if` statement in a `MultiWorkspace` subscription that would return early if the window was active and the event emitted by `MultiWorkspace` wasn't `ActiveWorkspaceChanged`. This caused issues when the window was inactive because it would incorrectly set the active call's location to the wrong project. The fix was making the early return happen if the window wasn't active. The third bug was that every child `Workspace` also observed window activation and called `update_active_view_for_followers`. This allowed hidden workspaces to report their active view instead of only the active workspace. ### Testing I added a property test for bugs one/two and another prop test for bug 3 Release Notes: - collab: Fix out of sync following bugs |
||
|
|
58df5a14ce |
gpui: Fix images not being drawn with rounded corners when using ObjectFit::Cover (#61383)
# Objective Fixes #44339 ## Solution The issue was taking place as image bounds where larger than the view bounds. Hence, the rounding of the image happened outside the view bounds, hence the corners where not rounded. This solution changed the paint_image function in window.rs. Now, it takes in 2 parameters, image bounds and bounds of the area to be draw. Then, the function creates the tile field of PolychromeSprite by cropping the image to fit the area to be drawn. This ensures that the rounding happens correctly. ## Testing Testing was done as per the issue and results where verified visually. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase <img width="1409" height="1030" alt="image" src="https://github.com/user-attachments/assets/3645b36d-f182-4853-bdfe-d66a4132d273" /> ## Release Notes: Fixed rounded corners not rendering on images when using ObjectFit::Cover --------- Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com> Co-authored-by: Nathan Sobo <nathan@zed.dev> |
||
|
|
d23aaeebea |
workspace: Rename read-only tab controls from File to Tab (#61202)
## Context
The editor tab's read-only controls used "File" terminology in their
tooltips and the tab context menu ("Make File Read-Only", "Locked File",
"Read-Only File", etc.). This was misleading in two ways: the option
also appears on unsaved and non-file tabs that have no file on disk, and
the toggle only controls whether the buffer is editable in the editor,
it does not change filesystem permissions. This renames the labels to
lock/unlock "Tab" language, matching the lock icon shown when the tab is
toggled.
Closes #60079.
Behavior after the change :
[Screencast from 2026-07-17
15-35-30.webm](https://github.com/user-attachments/assets/5fb018cb-515f-449c-a57e-0c0bead250bd)
## How to Review
1 file changed:
**crates/workspace/src/pane.rs**
Renames three sets of user-facing strings, all pure text changes with no
behavior change. The read-only toggle button tooltips become "Unlock
Tab" / "This will make this tab editable" and "Locked Tab" / "This tab
is read-only". The tab tooltip meta label becomes "Read-Only Tab". The
context menu entry, whose label already depends on
`capability.editable()`, becomes "Lock Tab for Editing" (when currently
editable) and "Unlock Tab for Editing" (when currently read-only); the
click handler still calls `toggle_read_only`, so the mapping from label
to action is preserved.
## 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
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- Improved read-only tab controls to use "Tab" instead of "File" in
tooltips and the tab context menu, since the toggle affects editability
in the editor rather than filesystem permissions.
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
|
||
|
|
43b5360ac8 |
git_ui: Prevent Git panel bindings in repository selector (#61282)
# Objective Fix Git panel keybindings intercepting input intended for the repository selector. With Vim mode enabled, pressing `i` in the selector focused the commit-message editor instead of filtering repositories. Platform keybindings could also intercept printable input such as spaces. Fixes #57936 ## Solution Exclude the `GitRepositorySelector` context from the Git panel changes-list bindings in the macOS, Linux, Windows, and Vim keymaps. ## Testing Manually tested on macOS using a debug build with Vim mode enabled and a workspace containing two Git repositories ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Fixed Git repository selector input being intercepted by Git panel keybindings, including in Vim mode. Co-authored-by: Nathan Sobo <nathan@zed.dev> |
||
|
|
051e5c6a88 |
editor: Skip untitled buffers when saving a multi-buffer (#61380)
Closes #60041. ## Summary When Project Search results contain both a saved file and an untitled buffer, running `workspace: reload` did nothing (quitting hit the same path). The log showed: ``` ERROR [.../workspace.rs] buffer doesn't have a file ``` ## Root cause The Project Search results view is an `Editor` over a multi-buffer, and its `Item::save` delegates to `Editor::save`. For a multi-buffer, `Editor::save` collects every dirty buffer and calls `Project::save_buffers`. An untitled excerpt has no file, so `BufferStore::save_buffer` returns `Err("buffer doesn't have a file")`. That error propagates through `Pane::save_item` → `save_all_internal` → `prepare_to_close`, which then reports the workspace as not ready to close, so `reload`/quit silently aborts. A singleton untitled buffer avoids this because `Editor::can_save` returns `false` for it (the workspace routes it to `save_as`); for a multi-buffer, `can_save` is always `true`. ## Fix Exclude file-less (untitled) buffers when collecting the buffers to save for a multi-buffer. Untitled buffers can only be written via `save_as`, so a bulk multi-buffer save now persists the file-backed excerpts and leaves untitled ones untouched. This also addresses the same latent issue in other multi-buffer views (diagnostics, find-all-references) that can excerpt an untitled buffer. ## Testing - Added `test_save_multi_buffer_with_untitled_buffer_skips_untitled` in `crates/editor/src/items.rs`: it builds a multi-buffer over a file-backed buffer and an untitled buffer (both dirty), then asserts `save` succeeds, the file-backed buffer is persisted, and the untitled buffer stays dirty. Fails before this change (`buffer doesn't have a file`), passes after. - `cargo test -p editor --lib save` (13 tests) and `cargo test -p search --lib project_search` (22 tests) pass. - `./script/clippy -p editor` is clean. Manual repro (before): new untitled buffer with text → Project Search for a term matching both it and a saved file → `workspace: reload` → no-op with `buffer doesn't have a file` in the log. After: reload proceeds. Release Notes: - Fixed `workspace: reload` and quitting silently doing nothing when Project Search results included an unsaved untitled buffer. |
||
|
|
50e399332c |
gpui_windows: Only flash the window once on request_attention (#61611)
The current behavior bothers me. Release Notes: - N/A |
||
|
|
640286ae3e |
Opus 5 BYOK Support (#61596)
<img width="844" height="404" alt="Screenshot 2026-07-24 at 3 47 04 PM" src="https://github.com/user-attachments/assets/4691a246-bab9-4426-aa0b-6a7cfa2aa486" /> action support, and explicit thinking opt-out behavior. Adds Claude Opus 5 to the Anthropic and Amazon Bedrock BYOK providers, including its documented context and output limits, regional inference profiles, fast mode and comp Release Notes: - Added Claude Opus 5 support for Anthropic and Amazon Bedrock BYOK providers. |
||
|
|
f16101a758 |
editor: Fix sticky header drag cancels autoscroll (#53592)
In #52636 I seem to have introduced this bug, where mouse-down on a sticky header followed by an immediate mouse movements sometimes dropped the pending autoscroll request (to jump to the sticky header line): https://github.com/zed-industries/zed/blob/1fcf9749a6ed384ae346ddf2049ae76e0cc430a9/crates/editor/src/scroll.rs#L453 Fixed by exiting early from `mouse_dragged` when `editor.has_autoscroll_request()`. What sometimes happened before this fix: https://github.com/user-attachments/assets/b6dd6650-b5f0-4ea1-ae70-9c4cf69e31a0 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 where clicking on a sticky header would sometimes not jump to that line in the editor |
||
|
|
c28cf645f9 |
Add explicit OpenAI conversation compaction and fix Anthropic compaction (#61370)
# Objective Add explicit conversation compaction for OpenAI Responses API models, available through both direct OpenAI connections and Zed Cloud models. Keep finalized replacement context provider-neutral and separate from the lifecycle events emitted while automatic compaction is in progress. ## Solution - Add opt-in explicit compaction support to the `LanguageModel` trait. - Separate streamed `CompactionUpdate` lifecycle events from finalized `CompactedContext`. - Represent provider-native compacted context as an opaque, versioned state owned by the originating provider. - Construct compact requests through the same OpenAI request conversion used for completions, then narrow the request to fields supported by `/responses/compact`. - Preserve and validate the complete canonical replacement window returned by OpenAI. - Replay the replacement window before messages sent after compaction, without resending the superseded transcript. - Support explicit compaction through both the direct OpenAI provider and `CloudLanguageModel`. - Update automatic OpenAI and Anthropic compaction to use the same finalized context representation. - Reject empty, malformed, incorrectly versioned, and incorrectly owned provider state. The corresponding Cloud change adds the `/completions/compact` proxy route: https://github.com/zed-industries/cloud/pull/3099. The downstream Delta UI integration is https://github.com/zed-industries/delta/pull/1739. ## Testing - `cargo nextest run -p anthropic -p open_ai -p language_models_cloud` - `cargo check -p language_models --tests` - `cargo fmt --all --check` - `git diff --check` The focused tests cover request construction, canonical-window preservation and replay, direct and Cloud transports, automatic compaction lifecycle events, malformed provider state, provider ownership, format compatibility, and HTTP failure handling. ## 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 adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable --- Release Notes: - Added: System messages are now sent through the `instructions` field in OpenAI Responses API requests. |