Closes#52774
## Summary
- Bind Windows `Alt+F4` to `workspace::CloseWindow` in the `Terminal`
keymap context
- Add a regression test covering the built-in Windows terminal keymap
entry
## Why
When the integrated terminal is focused, `Alt+F4` should close the
window instead of falling through to terminal keystroke handling.
Handling this in the Windows `Terminal` keymap keeps the fix aligned
with the rest of the terminal shortcut overrides.
## Validation
- `cargo test -p settings
windows_terminal_keymap_closes_window_on_alt_f4`
Release Notes:
- Fixed Alt+F4 on Windows so Zed closes even when the integrated
terminal is focused.
---------
Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
This PR fixes an issue introduced in
https://github.com/zed-industries/zed/pull/54397 where the Zed Cloud
provider would not be reflected as "authenticated" if a connection to
Collab was attempted, but could not be established.
This was especially noticable when running Zed against a local version
of Cloud and not having Collab running.
This restores the original logic prior to that change.
Release Notes:
- N/A
Hi! 👋 When `base_keymap` is set to `None`, it disables all the
keybindings, even if `vim_mode` or `helix_mode` is enabled. However, I
think the Vim/Helix keybindings should be applied on top of the empty
base keymap.
My use case for this is to start with the minimal set of Vim/Helix key
shortcuts and add other bindings on top of that, instead of flooding the
keymap with hundreds of predefined shortcuts from some base keymap.
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 ##42292
The text inserted in the search ('\$SEARCH') and replace ('$$OTHER')
inputs of the top-panel is a little anti-aesthetic, but that seems out
of scope for this issue.
Release Notes:
- '$' in the second clause of vim-style '%s/find/replace/g' actions is
correctly escaped.
Co-authored-by: Conrad Irwin <conrad.irwin@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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Closes#54737.
#48752 added empty-prefix `block_comment` entries to several language
configs (Go, C, C++, JSONC, Python, JSX inner) to support the new
toggle-block-comments action.
In `Editor::rewrap_impl`, the comment-format matcher used
`buffer.contains_str_at(indent_end, &config.prefix)` to decide whether
the current line is a continuation of a block comment. When the language
is configured with an empty prefix, this is true on every line. `//`
(and `#`) line comments inside a `comment` override scope were
classified as `BlockLine("")` and never reached the line-comment
fallback. The result was that the line-comment prefix was not stripped
before wrapping and not re-prepended after, embedding `//` markers as
text in the wrapped paragraph.
Skip the BlockLine arm when the configured prefix is empty so the
matcher falls through to `line_comment_prefixes`.
I've included regression tests for both golang (which adds a new
treesitter dep to the editor package) and C/C++.
Release Notes:
- Fixed line comment rewrapping in golang and C/C++
I might turn this into a big PR with multiple fixes. So no, this is not
going stale. I’m updating this as and when I find broken refs or stale
content.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Changes Made:
- Adding the `Item::can_save()`, `save()`, `save_as()`, `can_save_as()`
functions to help the Editor save when a checkbox is toggled
- Small refactor to seperate checkbox toggle and refreshing preview
- Adding support for both `/...` and `\\...` for windows users. [NOTE: I
no longer own a window's machine and I am unsure if this is correct, and
will fix it immediately if this is wrong]
- Resolving preview paths, strips out the fragment, and image paths are
coalesced to None if they don't exist
- Adding Tests for the added behaviour [NOTE: would love feedback since
this is the first time I am writing tests, and had a bit of assistance
from an AI, but manually reviewed the code and ran the application and
it seemed fine]
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#46901
Release Notes:
- Fixed Crtl+S saving while toggling checkbox in preview mode
The DAP TCP transport layer was hardcoded to `Ipv4Addr`, so IPv6
addresses like `fd00::a` in a debug config's `connect.host` always
failed with `hostname must be IPv4: invalid IPv4 address syntax`.
Replaced `Ipv4Addr` with `IpAddr` and `SocketAddrV4` with `SocketAddr`
across the `task`, `dap`, `dap_adapters`, and `project` crates. The WASM
extension API still uses `u32` for the host field to avoid a breaking
WIT interface change; IPv4 round-trips through extensions as before.
Fixes#52237
Release Notes:
- Fixed DAP TCP transport rejecting IPv6 addresses when connecting to
remote debug adapters.
---------
Co-authored-by: moktamd <moktamd@users.noreply.github.com>
Quick fix for a little regression I introduced in
https://github.com/zed-industries/zed/pull/54791 accidentally removing
the rotating spinner icon in the activity indicator.
Release Notes:
- N/A
Found this bug while investigating why configuring nextest based on the
instructions at
https://github.com/rust-lang/rust-analyzer/issues/21137#issuecomment-4254611341
wasn't working within Zed.
Previously, we'd use `serde(untagged)`, preferring cargo over shell
commands. The problem is that every instance of a shell command is a
valid instance of a cargo command. For example, the shell command:
```json
{
"label": "test my_test",
"kind": "shell",
"args": {
"environment": {"RUSTC_TOOLCHAIN": "/path/to/toolchain"},
"cwd": "/project",
"program": "cargo",
"args": ["nextest", "run", "--package", "my-crate", "--lib", "--", "my_test", "--exact", "--include-ignored"]
}
}
```
would end up getting deserialized as a Cargo command, silently dropping
`program` and `args`.
With this fix, we now use the provided `kind` as a tag. We do have to
introduce a `#[serde(flatten)]` unfortunately, which has a few side
effects due to internal buffering, but `#[serde(untagged)]` also does
internal buffering so this doesn't make things worse.
I've manually tested this by configuring:
```json
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"runnables": {
"test": {
"overrideCommand": [
"cargo",
"nextest",
"run",
"--package",
"${package}",
"${target_arg}",
"${target}",
"--",
"${test_name}",
"${exact}",
"${include_ignored}"
]
}
}
}
}
}
}
```
and ensuring that nextest is correctly invoked.
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 deserialization of rust-analyzer shell runnables.
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
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 accidental duplication of words in themes.md
Expand all excerpts had a doc comment describing it as expanding all
excerpts, but in practice it only expanded the excerpt that was the most
relevant.
I fixed that to make it expand all excerpts.
video:
https://github.com/user-attachments/assets/9858ebda-199c-4f72-8a2f-3cd606b0eff4
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#54651
Release Notes:
- editor: `expand excerpts` now has correct documentation explaining its
function.
Follow-up to https://github.com/zed-industries/zed/pull/54100
Instead of relying on "line number" that could have overlapped depending
on the range we query, use hierarchical IDset: `block id -> lens #` to
ensure no clashes happen anymore.
Release Notes:
- N/A
Closes#47872
Release Notes:
- Fixed Zed exiting on startup when cancelling a failed devcontainer
connection. It now falls back to an empty workspace.
Co-authored-by: KyleBarton <kjb@initialcapacity.io>
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
Straightforward.
Closes https://github.com/zed-industries/zed/issues/54308
Release Notes:
- Fixed the file extension recognition logic for images in the agent UI
being case sensitive. It is now case insensitive.
These changes update Zed's Git Panel to be able to detect unsafe git
repositories, where the user running Zed doesn't own the `.git`
directory, and show a dedicated empty view in the Git Panel that not
only explains the situation but also allows the user to choose whether
to trust this directory, which will end up running `git config --global
--add safe.directory <path>`.
While testing those changes, it was noted that attempting to add or
reset files after trusting the directory would fail, as expected, but
the UI wouldn't react to the fact that those operations failed. What
this means is, if the user tried to add a file, the UI would show a
checkmark for that file and, after the operation failed, the checkmark
would remain. We now revert that, for both `git add` and `git reset`.
Some more technical notes on this change:
- Introduce `project::git_store::GitAccess` enum to express whether we
actually have access to the repository, exposed via
`git::Repository::access`, which probes the backend with a `git status`
command and classifies the result.
- On unsafe repositories,
`project::git_store::LocalRepositoryState::new` fails to spawn the git
worker, which now cleanly signals `GitAccess::No` rather than leaving
the panel in a broken state.
- Updated `git_ui::git_panel::GitPanel::render_empty_state` with a third
alternative, when `GitAccess::No`, that basically renders a view
explaining why the repository is considered unsafe, together with
buttons for git's documentation on safe directories and a button to add
the repository's folder as a safe directory
- Updated `project::git_store::GitStore` to now watch `~/.gitconfig` and
`$XDG_CONFIG_HOME/git/config`. Watching this files allows the Git Panel
to react when the git configuration is updated, which will be the case
if the user decides to trust the repository. When either changes, a
`GitStoreEvent::GlobalConfigurationUpdated` event is emitted and the
panel refetches repository state.
- Added `project::git_store::Repository::refetch_repo_state` field,
which stores a closure to allow recreating the
`Repository::repository_state` and the job sender after the repository's
directory is trusted, without requiring a project reload.
- Added a `fs::Fs::git_config` trait method, wrapping a real `git
config` invocation. In order to be able to call this, both
`git_store::GitStore::git_config` and `project::Project::git_config`
wrappers have also been introduced. Worth mentioning that this isn't yet
supported for remote projects or collab guests.
- Updated `fs::Fs::git_clone` argument order to match
`fs::Fs::git_config` and `fs::Fs::git_init`.
- Added a new
`project::git_store::pending_op::PendingOps::last_op_errored` method
that allows determining whether the last pending operation failed. This
now allows us to filter out failed operations when determining whether
`git add` or `git reset` failed, so that we can fall through to the real
git status.
- Updated `git_ui::git_panel::GitPanel::change_file_stage` to now call
`update_counts` in its error branch so the cached staged counters stay
consistent with the reverted per-entry state, seeing as we now handle
reverting the UI state if an operation fails.
- Fixed `fs::RealFs::git_init` to fall back to the provided branch name
when `git config --global --get init.defaultBranch` fails, for example,
when the user hsan't configured one.
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Closes#42286
Release Notes:
- Added a dedicated empty state in the Git Panel for unsafe
repositories, with a "Trust Directory" button that adds the repository
to `safe.directory`
- Fixed stage and unstage checkboxes in the Git Panel not reverting when
a `git add` or `git reset` command failed
---------
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
When started working on "disable the profiler for all but Nightly and
Dev" users, I've tried to do that using the default OS settings and
discovered that those are ignored.
Release Notes:
- Fixed default.json profile and os settings not applying on startup
## Summary
- Add a new "Configuration Boundaries" section to the external agents
documentation explaining what settings are shared between Zed and ACP
agents
- Clarify bidirectional configuration story: what Zed forwards to agents
AND what agents inherit from native installations
- Add troubleshooting section for common user confusion points
- Update MCP docs with clearer cross-links
## Context
Users are confused about which Zed settings apply to external ACP agents
like Claude and Codex. Common questions:
- "I configured MCP in Zed but Claude can't see it"
- "My Codex config.toml isn't being used"
- "Do profiles apply to external agents?"
## Key Points
**What Zed forwards to ACP agents:**
- Model/mode selection, env vars, MCP servers (with limitations),
CLAUDE.md
**What's NOT forwarded:**
- Profiles, tool permissions settings, `.rules` files
**What agents DON'T inherit from native installations:**
- `~/.claude/` config, `~/.codex/config.toml`, native MCP servers,
authentication state
## Test plan
- [x] Review for technical accuracy against codebase
- [x] Check brand voice compliance
Release Notes:
- N/A
This PR fixes the logic to dismiss the "resolve merge conflict with
agent" button. Previously, we were just observing
`merge_heads_by_conflicted_path`, which seems to be intentionally
sticky, preserving the conflicted paths until changes are either
committed or aborted. This would make the button to resolve conflicts
show up even _after_ the changes get resolved. Now, we're checking
whether paths are _currently_ conflicted (`is_conflicted()`), and if
they are not, we don't display the button, even though the resolution
might have not been committed or aborted yet.
As a bonus, in this PR, I'm also putting the resolve conflict button
_before_ the activity indicator, so as to avoid bounciness, and did a
quick polish of the activity indicator button itself, by using the
`Button` component.
Release Notes:
- Fixed a bug with the merge conflict "resolve with agent" button where
it would be displayed even though all conflicts have already been
resolved.
**TL;DR**: add support for OpenCode Go (flat-rate monthly subscription)
along the already-implemented OpenCode Zed (pay-as-you-go billing).
> [!WARNING]
> This code was written by LLMs, under the supervision of a so-called
developer that never wrote Rust profesionally and that spends more time
in Pages&Keynote than in an IDE.
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
## Background
OpenCode offers a few different ways to access models:
- **free access to 3 models**, with feedback and data used to improve
the model. These models use the OpenCode Zen API endpoints, but have
different usage limits (200 requests per 5 hours) and have a different
privacy policy. Some people disable or block the free models, some
people are super-excited to have access to LLMs for free, and some
people like using the free models to test new LLMs (at launch MiMo-V2
had 2 free weeks of usage, for example).
- **pay-as-you-go access to 30 models** as part of the [OpenCode
Zen](https://opencode.ai/zen) subscription. These models use the same
OpenCode Zen API endpoints.
- **flat-rate monthly access to 7 models** as part of the [OpenCode
Go](https://opencode.ai/go) subscription. These models use the OpenCode
Zen API endpoints with an extra `/go` appended to the path. There are
5-hour, weekly, and monthly usage limits and, additionally, users can
toggle a switch in the OpenCode Console to use Zen models with their
pay-as-you-go billing after the Go limits are hit.
There's also a currently-paused [OpenCode
Black](https://opencode.ai/black) flat-rate subscription with way higher
usage limits and with access to more models, with $100 and $200 monthly
plans.
The whole thing is a bit messy, but it's great value and highly reliable
LLM access!
<br>
https://github.com/zed-industries/zed/pull/49589 added support for
OpenCode Zen by implementing a new `opencode` provider. OpenCode Go
[could be used by overriding the API
URL](https://github.com/zed-industries/zed/pull/49589#issuecomment-4130300454),
but that is a terrible user experience: some models have to be manually
added, the model list always shows the 30-something OpenCode Zen models,
and free models cannot be used at all.
I was annoyed by the experience of using OpenCode Go with Zed and this
past week I had to test a bunch of LLMs and providers and harnesses, so
I took this on as a test case 🙂
## Implementation
This PR makes the OpenCode provider more general (not just for Zen) and
adds an `OpenCodeModelSubscription` concept which is then used to
implement support for OpenCode Go. The free models are also broken out
into their own subscription for a prettier model list.
For a better user experience, the different subscriptions can be enabled
or disabled, both in the settings file and in the UX:
<img width="434" height="176" alt="Screenshot showing the OpenCode
provider configuration, with the newly added toggles"
src="https://github.com/user-attachments/assets/3520e114-00c8-4794-84bf-35cd72d9c57e"
/>
The code was written by LLMs, but I do understand it and I did a bunch
of "manual" iterations and "manual" tweaks. Still, my Rust experience is
non-existent so **I won't feel offended if y'all reject this PR**! I did
consider alternatives (adding a new `opencode-go` provider and renaming
this to `opencode-zen`, for example, or adding support for custom API
URLs in OpenCode custom models which would've been the smallest code
change but a terrible user experience, and so on) but all alternatives
would have been, in my opinion, a worse user experience.
**Tests I did**:
- confirmed OpenCode Go models work as expected
- confirmed OpenCode Zen Free models work as expected
- confirmed I get an error when trying to use OpenCode Zen models since
I don't have that subscription
- confirmed the subcription toggles work as expected (model are
shown/hidden, settings file is updated)
**Notes**:
- this PR is best reviewed commit-by-commit. I did not create a separate
PR for the model updates to minimize delays
- my exeprience with Rust is roughly zero, but I tried to strike a
balance between idiomatic Rust and easy-to-read code
- users of the OpenCode provider might have to do some re-configuration
after this PR is merged since the model identifiers now include the
subscription, eg `claude-haiku-4-5` is now `zen/claude-haiku-4-5`. Since
this is a relatively new provider and the impact is small, I preffered
that rather than adding complex migration/mapping logic.
- does changing the provider name from "OpenCode Zen" to "OpenCode"
break anything for y'all at Zed?
- does changing the telemetry id from `"opencode/<model-id>"` to
`"opencode/<subscription>/<model-id>"` break anything for y'all at Zed?
---
Release Notes:
- OpenCode provider: add support for OpenCode Go
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Closes#53587
Follow-up to #50595.
[#50595](https://github.com/zed-industries/zed/pull/50595) added
display-only checkboxes when `[x]` / `[X]` / `[ ]` appears as the sole
content of a markdown table cell. That PR called out interactivity as a
later step — this PR delivers it.
https://github.com/user-attachments/assets/c666ee4c-7e31-4450-ab33-c07c82949818
## What this does
When a consumer of `MarkdownElement` supplies an `on_checkbox_toggle`
callback, table-cell checkboxes now invoke it on click with the source
range of the `[x]` / `[ ]` marker and the new checked state. This
mirrors the existing list-item checkbox path.
For markdown preview (`markdown_preview_view.rs`) the callback is
already wired to edit the source buffer, so clicking a checkbox in a
previewed `.md` file now flips `[x]` to `[ ]` and back in the file, the
same as it already did for list checkboxes.
## How it works
`replace_pending_checkbox` previously took the cell's outer source range
and always built a visualization-only checkbox. It now takes the
optional toggle callback instead, and reconstructs the marker's exact
source range from `pending_line.source_mappings` — pulldown-cmark emits
`[x]` in a table cell as three separate `Text` events, so the per-chunk
mappings are needed to recover the 3-character range to rewrite. If a
callback was supplied, the checkbox attaches an `on_click` that invokes
it with that range and `!checked`; otherwise it falls back to the prior
visualization-only rendering.
Two free helpers (`source_range_for_rendered` /
`source_index_for_rendered`) were extracted so the mapping logic is
unit-testable.
## Scope
One file: `crates/markdown/src/markdown.rs`. No changes to
`markdown_preview` — since #52008 it renders through the shared
`MarkdownElement`, so its existing `on_checkbox_toggle` wiring picks up
table checkboxes for free.
## Relation to #53587
[#53587](https://github.com/zed-industries/zed/issues/53587) reports
that markdown checkboxes in the **agent panel** can't be clicked. This
PR is a necessary piece of that fix — without it, even if the agent
panel wired `on_checkbox_toggle`, its table checkboxes would stay inert.
It does not fully close#53587 on its own: the agent panel's
`MarkdownElement` instances in `conversation_view.rs` / `thread_view.rs`
don't currently wire `on_checkbox_toggle`, and wiring it there requires
deciding how clicks should mutate the in-memory agent response (no
source file to edit into). That's a follow-up.
## Test plan
**Unit tests** (2 new, both in `crates/markdown/src/markdown.rs`):
- `test_table_checkbox_marker_source_range` — walks parser events for a
table with checkboxes, replays what the builder accumulates, and asserts
the reconstructed source range slices to exactly `[x]` / `[ ]` in the
original markdown (including a padded-whitespace case).
- `test_source_range_for_rendered_handles_split_chunks` — pins the
mapping helper against the three-chunk layout pulldown-cmark produces.
**Automated**:
- [x] `cargo test -p markdown` — 46 tests pass (44 existing + 2 new)
- [x] `cargo test -p markdown_preview` — 3 tests pass
- [x] `./script/clippy -p markdown` — clean
**Manual** (against a preview of a markdown file with checkbox tables):
- [x] Click a checked `[x]` table cell — it becomes `[ ]` in the source
and rerenders as unchecked
- [x] Click an unchecked `[ ]` — becomes `[x]`
- [x] Uppercase `[X]` toggles on click (replacement writes `[x]` / `[
]`, matching the list-item behaviour)
- [x] Padded-whitespace cells still target just the three marker
characters
- [x] Multiple checkbox columns in one table all independently clickable
- [x] Alignment variants (left/center/right) behave the same
- [x] Non-checkbox table text unaffected
- [x] List-item checkboxes continue to work (regression)
Release Notes:
- Made table-cell markdown checkboxes clickable in markdown preview,
matching list-item checkbox behavior
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Paints selections and search highlights of rendered markdown more
accurately, to properly match what's actually being selected.
Particularly noticeable when the selection spans multiple rows in a
table cell or when it starts right after a soft wrap.
|Before|After|
| --- | --- |
|<img width="831" height="677" alt="before"
src="https://github.com/user-attachments/assets/3b2c33be-e4cb-400f-9ba6-4163eb438f99"
/> | <img width="831" height="677" alt="after"
src="https://github.com/user-attachments/assets/04161dd8-7f4a-46c5-8c63-3497d3533f6d"
/> |
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 selection and search highlights in rendered markdown not always
being displayed accurately.
This PR makes the submenu render on the left of the trigger if there's
not enough space (200px of available width) on the right. This improves
the rendering overall, I believe, as it's better than the submenu
rendering _on top_ of the parent menu.
Release Notes:
- N/A
Follow up to https://github.com/zed-industries/zed/pull/54374 as that
removed the custom heading styles that were mostly tailored to the agent
panel. It makes sense for those values not to be the ones used for
general markdown rendering, but I think it's just too big for the agent
panel. So I'm sort of hijacking the `MarkdownFont::Agent` enum here so
that we can set it conditionally to just the agent context.
Release Notes:
- N/A
Closes https://github.com/zed-industries/zed/issues/54545
With the release of the parallel agents feature, we changed the default
panel positions optimizing for an agentic-first layout. Even though we
introduced a settings backfill _and_ the ability to revert after
interacting with the announcement toast, this change seems to be causing
a bit of frustration still. In response, this PR adds a "Panel Layout"
menu in the user menu that allows to quickly toggle between the
"Classic" layout and the "Agentic" layout. If you have a different set
up, you'll see a "custom" item there just confirming that.
| Panel Layout | Custom set up |
|--------|--------|
| <img width="1110" height="866" alt="Screenshot 2026-04-24 at 12
52@2x"
src="https://github.com/user-attachments/assets/197fc4ec-b4b3-4b13-bcb3-9d3495cf0d0a"
/> | <img width="1156" height="866" alt="Screenshot 2026-04-24 at 12
55@2x"
src="https://github.com/user-attachments/assets/ca791b1b-eb6a-47a9-8aa5-c2015f33e5bd"
/> |
Release Notes:
- Added a menu item in the user menu called "Panel Layout" which offers
the ability to quickly swap between the two standard panel layouts:
classic (project panel, git panel, etc., on the left) and agentic (agent
panel on the left, everything else on the right).
Allows to reconfigure behavior, including the previous one, `top`
Closes https://github.com/zed-industries/zed/issues/52173
Release Notes:
- Reworked go to definition to open its target in the center of the
editor. Can be reconfigured with `go_to_definition_scroll_strategy`.
When extracting gzip tar files, the `GzipDecoder` was being pinned
directly over the response body stream. This caused issues because the
decoder needs to read the entire stream into memory before the `Archive`
can be created and used.
Buffer the decompressed bytes into a `Vec` first, then create the
decoder over that in-memory buffer to ensure all data is available when
needed.
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 [Java extension issue
222](https://github.com/zed-extensions/java/issues/222)
Testing:
**Automated:**
- `cargo test -p extension_host
test_extension_store_with_test_extension` — integration test that
exercises the full `download_file` → `GzipTar` → `extract_tar_file` path
through a WASM extension with a `FakeHttpClient` serving a real gzipped
tar archive. Passed.
**Manual:**
- Built and ran Zed with `cargo +nightly run`, deleted and reinstalled
the Java extension. The extension's language server download completed
successfully and all expected files were extracted.
Release Notes:
- Fixed extension `download_file` with `GzipTar` silently dropping
archive entries by buffering the full HTTP response before extraction,
matching the approach already used for extension installation. See
c6bdb69734/crates/extension_host/src/extension_host.rs (L761)
NativeAgentServer::connect used `prompt_store.await?` which turned any
PromptStore initialization failure (permission denied, disk issues,
etc.) into a hard connection error, putting the ConversationView into
LoadError state and preventing all new native agent threads from being
created.
Changed to `.log_err()` so the error is logged at ERROR level but thread
creation proceeds with `prompt_store: None`. `NativeAgent::new` already
accepts `Option<Entity<PromptStore>>` and handles `None` gracefully —
user custom prompts won't load but threads still work.
Added a regression test that serializes a stale thread ID, loads the
panel (triggering the "last active thread not found in database"
warning), then dispatches NewThread through the real NativeAgentServer
path and verifies it produces a connected thread.
Release Notes:
- Agent panel now handles filesystem errors more gracefully
When the archive view's filter is set to "Archived Only" and the user
deletes (or unarchives) the last archived thread, the toggle button
becomes disabled because there are no archived threads left. With the
filter still pinned to "Archived Only", the list goes empty and there's
no way for the user to switch back to the All view.
This fixes it by automatically falling back to `ThreadFilter::All`
inside `update_items` whenever the current filter is `ArchivedOnly` but
the store has no archived entries. Since `update_items` is invoked from
the `ThreadMetadataStore` observer, this covers all paths that mutate
the store, not only deletions triggered from this view.
Release Notes:
- Fixed the agent thread archive view getting stuck on an empty
"Archived Only" list after the last archived thread was removed.
---------
Co-authored-by: Neel <neel@zed.dev>
rustfmt is broken in this code. I believe it's too deep / complex in the
builder pattern. After factoring some bits out, it now auto formats.
Self-Review Checklist:
- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable
Closes #ISSUE
Release Notes:
- N/A
This change fixes a small bug where we were showing "Loading project..."
even when in fact we had already started the search.
It also refactors three booleans in the `SearchState` enum, so that it's
harder to make similar mistakes in the future.
Release Notes:
- N/A
## Summary
Users who add custom OpenAI models under
`language_models.openai.available_models` can set `capabilities.images:
true` to declare that the endpoint accepts image inputs. Today, that
setting is silently ignored: the Agent panel's image-attach button stays
disabled regardless, and the only workaround is to switch to a built-in
OpenAI model, attach the image, and switch back.
Root cause: `Model::Custom` does not carry a `supports_images` field,
and the OpenAI provider's `supports_images()` for the `Custom` arm
hardcodes `false`.
## Changes
1. `crates/settings_content/src/language_model.rs`: add `images: bool`
to `OpenAiModelCapabilities` with `#[serde(default)]` so existing
settings.json files keep working unchanged.
2. `crates/open_ai/src/open_ai.rs`: add `supports_images: bool` to
`Model::Custom` with a matching serde default.
3. `crates/language_models/src/provider/open_ai.rs`: pass
`model.capabilities.images` into the `Model::Custom` variant in
`provided_models`, and return the stored value from `supports_images()`
for `Custom`.
Existing `Model::Custom { .. }` match sites (`completion.rs:829`,
various in `open_ai.rs`) all use `..` so they continue to compile
without change.
## Testing
- `cargo check -p settings_content -p open_ai -p language_models`:
clean.
- I was not able to complete `./script/clippy` locally: the build
stalled on the first-time `webrtc-sys` download for livekit-rust-sdks
(TLS close_notify failure on docs.rs mirror). Happy to rerun once CI has
cached artifacts.
- Manually verified the capability plumbing by tracing: settings.json ->
`OpenAiModelCapabilities.images` -> `Model::Custom { supports_images }`
-> `supports_images()` -> `Thread::prompt_capabilities` ->
`SessionCapabilities.supports_images()` -> `build_add_context_menu` gate
in `thread_view.rs`.
## Related Issues
Closes#50752
Release Notes:
- Fixed custom OpenAI models ignoring the `capabilities.images` setting
in `language_models.openai.available_models`.
This contribution was developed with AI assistance (Codex).
---------
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Hides and disables all mutating editor actions for readonly editors.
Certain actions (as cmd-backspace mentioned in the issue) could be
somewhat beneficial to have for navigation purposes, but we'd better
shape that story properly, let's build a "harness" and disable the
mutating ones first.
Closes https://github.com/zed-industries/zed/issues/47333
Release Notes:
- Fixed readonly editor having certain mutation actions enabled
Release Notes:
- Fixed an issue where the first tool call would always be accepted when
parallel tool calls were made, rather than the one that was actually
clicked
---------
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Clamp the cached `frame_index` of an `img` element when the underlying
image changes so a stale index from a previous, longer animation cannot
index out of bounds on the new image.
Release Notes:
- Fixed a panic when a GIF was replaced with one that had fewer frames
in Markdown Preview.
## Summary
Fixes an oversight in the agent threads archive sidebar's header: on
Linux and Windows it only accounted for macOS traffic lights, so the
custom window controls (minimize/maximize/close) rendered on top of the
sidebar. The main sidebar
(`crates/sidebar/src/sidebar.rs::render_sidebar_header`) already handles
this correctly — this PR mirrors that pattern in
`ThreadsArchiveView::render_header`.
### What changed
- `crates/agent_ui/src/threads_archive_view.rs`
- `render_header` now computes `traffic_lights`, `left_window_controls`,
and `right_window_controls` (matching `sidebar.rs`) and reserves space /
renders controls accordingly when not fullscreen.
- Added `render_left_window_controls` / `render_right_window_controls`
helpers that delegate to `platform_title_bar`.
- Imported `workspace::CloseWindow`.
- `crates/agent_ui/Cargo.toml`
- Added `platform_title_bar` dependency.
### Behavior
- macOS (sidebar on left): unchanged — traffic-light padding + divider.
- Linux/Windows, sidebar on left: renders left-side window controls
inside the header.
- Linux/Windows, sidebar on right: renders right-side window controls
inside the header.
- Fullscreen: no controls rendered, same as before.
#### Closes#54596
### 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
### Video
[Screencast from 2026-04-24
14-27-51.webm](https://github.com/user-attachments/assets/47009458-2acb-4b65-bff6-d25302a0342e)
Release Notes:
- Agent: Fixed the threads sidebar overlapping the window control
buttons on Linux and Windows.
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>