Commit graph

460 commits

Author SHA1 Message Date
Om Chillure
3dde315a13
agent panel: Fix keybindings on Linux (#52672)
## Context

Fixes agent panel keybindings on Linux, mirroring the Windows fix from
#43692.

On Linux, `Ctrl+Y` (the previous `agent::AllowOnce` binding) is
intercepted by the focused text input as "redo", so the shortcut did
nothing when the message editor was focused. This is the same issue
fixed for Windows in #43692.

Changes (Linux and Windows):
- `agent::AllowAlways`: added `shift-alt-q` (was unbound on all
platforms)
- `agent::AllowOnce`: `ctrl-y` → `shift-alt-a` (Linux); already
`shift-alt-a` on Windows
- `agent::RejectOnce`: `shift-alt-x` on both platforms — `shift-alt-z`
conflicted with `agent::RejectAll` bound in other contexts, causing the
keybinding hint to not appear in the UI
- `agent::ToggleNavigationMenu`: `ctrl-shift-j` → `shift-alt-j` (Linux)
- `agent::ToggleOptionsMenu`: `ctrl-alt-i` → `shift-alt-i` (Linux)

Closes #52472

## How to Review

Two files changed: `assets/keymaps/default-linux.json` and
`assets/keymaps/default-windows.json`. Check the `AgentPanel` context
block in each.

## Self-Review Checklist

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


Note : Reopens previous work from closed PR #52479 (fork was deleted)

Release Notes:

- Fixed agent panel `Allow`, `Always Allow`, and `Reject` keybindings
not working when the message editor is focused on Linux
e
2026-03-30 16:23:01 +02:00
Cameron Mcloughlin
d72a03827d
sidebar: Switch with ctrl-tab (#52423)
Overrides `ctrl-tab` when the sidebar/agent panel is focused to switch
between recently viewed threads

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-03-28 17:48:34 +00:00
Danilo Leal
2a3fcb2ce4
collab_panel: Add ability to favorite a channel (#52378)
This PR adds the ability to favorite a channel in the collab panel. Note
that favorited channels:
- appear at the very top of the panel
- also appear in their normal place in the tree
- are not stored in settings but rather in the local key-value store

<img width="500" height="618" alt="Screenshot 2026-03-25 at 1  11@2x"
src="https://github.com/user-attachments/assets/dda8d5ae-7b45-4846-acc9-4a940b487ac4"
/>

Release Notes:

- Collab: Added the ability to favorite channels in the collab panel.
2026-03-26 16:24:20 -03:00
Danilo Leal
0a4dfe327a
sidebar: Fix space not working in the search editor (#52444)
We were using space as an alternative to `enter` for selecting thread
items even while the search editor was focused. The solution here was to
create a dynamic key context based on the search editor focus state.

Release Notes:

- N/A
2026-03-25 19:23:45 -03:00
Ben Kunkle
2b8e9cc633
ep: Follow-ups for binding changes (#52258)
## Context

- Updates docs for how to update edit prediction bindings
- Walks back how often we use tab to accept prediction where we
previously didn't; now just when in leading whitespace, tab does not
accept completion when completions menu is open
- migration for keymaps using the old `edit_prediction_conflict` key
context

## How to Review

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

## Self-Review Checklist

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

Release Notes:

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

---------

Co-authored-by: Max <max@zed.dev>
2026-03-24 18:11:43 -04:00
Danilo Leal
4b598bff35
agent_ui: Add some thread view design improvements (#52322)
This PR adds some small design refinements to the thread view: making
keybinding size consistent throughout, improving the activity bar
shadow, fixing the keybinding to open a file from an edit tool diff, and
other smaller spacing/color tweaks.

Release Notes:

- N/A
2026-03-24 11:08:34 -03:00
Finn Evers
cae8d3e0ba
settings_ui: Fix open settings keybind always taking precedence (#52277)
Solves an issue introduced by
https://github.com/zed-industries/zed/pull/49527 until we land
https://github.com/zed-industries/zed/pull/52275.

No release notes since this is only on Nightly.

Release Notes:

- N/A
2026-03-24 02:13:59 +01:00
Ben Kunkle
8b822f9e10
Fix regression preventing new predictions from being previewed in subtle mode (#51887)
## Context

<!-- What does this PR do, and why? How is it expected to impact users?
     Not just what changed, but what motivated it and why this approach.

Link to Linear issue (e.g., ENG-123) or GitHub issue (e.g., Closes #456)
     if one exists — helps with traceability. -->
Fixes some issues with https://github.com/zed-industries/zed/pull/51842
Namely that the tests were scattered and not well organized (this PR
also makes them more thorough), and a regression where holding the
modifiers for the accept prediction keybind would not cause an incoming
prediction to be immediately previewed.

## How to Review

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

## Self-Review Checklist

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

Release Notes:

- (Preview v0.229.x only) Fixed a regression where holding the modifiers
for the accept edit prediction keybind would not immediately preview
predictions as they arrived
2026-03-23 00:20:55 -04:00
Danilo Leal
e126857732
sidebar: Add another round of refinements (#52101)
- Change the branch button's tooltip to be more accurate given it
displays more stuff than only branches
- Hide the worktree dropdown menu when in a non-Git repo project
- Improve provisioned title truncation
- Remove the plus icon from the "view more" item to improve sidebar's
overall feel
- Remove the always visible "new thread" button but make it visible only
when you're in an empty thread state
- Add worktree icon in the thread item and tooltip with full path
- Space out the worktree name from the branch name in the git picker in
the title bar
- Swap order of views in the git picker to "worktree | branches | stash"
- Improve the "creating worktree" loading indicator

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

Release Notes:

- N/A
2026-03-21 16:22:32 -03:00
Danilo Leal
690d5af735
sidebar: Add several refinements (#51980)
## Context

- Improve how we detect when the sidebar should render the empty state.
It was previously wrong using `content.entries.is_empty`, which would
also happen if there are no search matches.
- Improved archive view keyboard nav and design. Not using the ListItem
here anymore so as to avoid confusing hover and active states.
- Move archive and open folder buttons to the bottom of the sidebar.
- Add a new flavor of the recent projects for the sidebar that only
serves as a way to _add_ projects.
- Add the ability to add (and remove) folders to a given project group
in the sidebar through a dropdown menu
--- 
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
2026-03-19 22:11:22 -03:00
claire
b0e35b6599
Allow search/replace to span multiple lines (#50783)
Closes #49957 

Also adds `start_of_input` context, and modifies both
`{start,end}_of_input` to work for both single line and auto height
editor modes.


https://github.com/user-attachments/assets/e30f2b20-a96c-49d5-9eb6-3c95a485d14a

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:

- Added support for multi-line search and replace input in Buffer Search
and Project Search

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2026-03-19 11:10:14 -06:00
Marco Mihai Condrache
7baf5dc04e
Add basic undo in project panel (#47091)
- Add `project_panel::undo::UndoManager` with a bounded operation stack
  to track and revert project panel operations
- Support undoing file and directory creation, renaming, moving, pasting
  and drag-and-drop operations
- Revert batch operations sequentially in reverse order to handle
  dependencies between them
- Show an error notification when one or more undo operations fail
- Add "Undo" entry to the project panel context menu, disabled when
  there is nothing to undo
- Gate the feature behind the `project-panel-undo-redo` feature flag

Ref: #5039

Release Notes:

- N/A

---------

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-03-18 22:37:21 +00:00
Cameron Mcloughlin
c842fb55dd
sidebar: Keyboard nav improvements (and vim mode) (#51856) 2026-03-18 17:53:04 +00:00
Ben Kunkle
5f12c92924
Remove edit prediction conflict state (#51842)
Closes #ISSUE

Release Notes:

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

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-03-18 12:47:46 -04:00
Danilo Leal
f9cb072798
sidebar: Improve keyboard navigation (#51796)
- In the project header, arrow keys left and right expand/collapse the
group
- Enter and space in any thread list item selects the item
- Arrow key down from the search editor moves focus to the the list
- Arrow key up from the first list item puts focus back to the editor
- At any moment while focus on the list, cmd-f moves focus back to the
search editor
- Made the `FocusWorkspaceSidebar` action always reset focus back to the
search editor

Release Notes:

- N/A
2026-03-17 21:48:42 -03:00
Danilo Leal
9f3e3be65f
agent: Improve sidebar design and behavior (#51763)
- Selection/focus improvements (reduces flickers, move selection more
correctly throughout the list)
- Adds open folder button in the sidebar header
- Fixes sidebar header design, including the thread view one, too
- Fixes behavior of cmd-n when focused in the sidebar
- Changes the design for the "new thread" button in the sidebar and adds
a preview of the prompt on it
- Rename items in the "start thread in" dropdown

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
2026-03-17 20:44:20 -03:00
andrew j
4e9ffa3ee1
markdown_preview: Add ScrollToTop and ScrollToBottom actions (#50460)
Add `gg`/`G` (vim), `cmd-up`/`cmd-down` (macOS), and
`ctrl-home`/`ctrl-end` (Linux/Windows) keybindings to scroll to the top
and bottom of the markdown preview.

The markdown preview already has page scroll (`ctrl-d`/`ctrl-u`), line
scroll (`ctrl-e`/`ctrl-y`), and item scroll (`alt-up`/`alt-down`) but
was missing top/bottom navigation. This adds two new actions —
`ScrollToTop` and `ScrollToBottom` — using the existing
`ListState::scroll_to()` infrastructure, following the same pattern as
the other scroll actions.

- [x] Done a self-review taking into account security and performance
aspects

Release Notes:

- Added scroll-to-top and scroll-to-bottom keybindings for markdown
preview (`gg`/`G` in vim mode, `cmd-up`/`cmd-down` on macOS,
`ctrl-home`/`ctrl-end` on Linux/Windows)
2026-03-17 11:55:48 +02:00
Danilo Leal
e79429b51b
agent_ui: Add more UI refinements to sidebar (#51545)
- Move archive button to the header for simplicity
- Hook up the delete button in the archive view
- Improve how titles are displayed before summary is generated
- Hook up keybinding for deleting threads in both the sidebar and
archive view

Release Notes:

- N/A
2026-03-14 02:14:25 -03:00
João Soares
8e045237c4
gpui: Hide XF86 keybindings from menus and keybinding hints (#50540)
Closes #50436

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed XF86 multimedia key names ("New", "Save", "Open") being shown as
keybinding hints in menus instead of the actual keyboard shortcuts.
2026-03-13 02:03:51 +00:00
Tommy Han
ec2659a095
Add hotkeys and actions for toggle light and dark theme (#49027)
Mentioned in #47258 

Release Notes:

- Added hotkey options and actions for toggling light and dark theme.
- Add default keymap as `cmd/ctrl+k cmd/ctrl+shift+t`
2026-03-12 21:35:42 +02:00
Danilo Leal
47cc0bac41
agent_ui: Add keybinding to cycle through new thread location options & settings (#51384)
This PR adds the ability to save in the settings whether new threads
should start in the current project or in a new Git worktree.
Additionally, it also adds a keybinding that allows cycling through the
menu options easily, with the ability to use cmd-click/enter to choose
which one is set as the default.

No release notes because this feature/settings depends on a feature flag
that isn't out yet.

Release Notes:

- N/A
2026-03-12 10:14:10 -03:00
Cameron Mcloughlin
7cd0c5d72d
agent: Fix inline assistant keymap in agent panel (#51117)
Fixes a bug that causes the new large agent panel message editor
overrides the ctrl-enter keyboard shortcut to trigger the inline
assistant, rather than sending a message

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-03-09 16:16:09 +00:00
Danilo Leal
6b64b4c6c1
agent_ui: Add keybinding and action for worktree toggle (#51092)
This PR adds an action and keybinding to trigger the worktree dropdown
in the agent panel. This is still under a feature flag, so no release
notes yet.

Release Notes:

- N/A
2026-03-09 08:55:16 -03:00
Dino
0a436bec17
git: Introduce restore and next action (#50324)
Add a `git::RestoreAndNext` action that restores the diff hunk at the
cursor and advances to the next hunk. In the git diff view, the default
restore keybinding (`cmd-alt-z` on macOS, `ctrl-k ctrl-r` on
Linux/Windows) is remapped to this action so users can quickly restore
hunks in sequence. Also refactor `go_to_hunk_before_or_after_position`
to accept a `wrap_around` parameter, eliminating duplicated
hunk-navigation logic in `do_stage_or_unstage_and_next` and
`restore_and_next`.

Release Notes:

- Added a `git: restore and next` action that restores the diff hunk at
  the cursor and moves to the next one. In the git diff view, the
  default restore keybinding (`cmd-alt-z` on macOS, `ctrl-k ctrl-r` on
  Linux/Windows) now triggers this action instead of `git: restore`.

---------

Co-authored-by: Afonso <4775087+afonsograca@users.noreply.github.com>
2026-03-09 10:50:43 +00:00
Mikayla Maki
9afeb4e11d
Implement new Multi Agent UI (#50534)
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:

- N/A

---------

Co-authored-by: Eric <eric@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: John Tur <john-tur@outlook.com>
2026-03-05 20:22:28 +00:00
David Alecrim
53fca25ba5
git_ui: Add ability to delete git worktrees from picker (#50015)
Adds the ability to delete a git worktree directly from the worktree
picker, inspired by the existing branch delete functionality.


(`cmd-shift-backspace` on macOS, `ctrl-shift-backspace` on
Linux/Windows).

Screenshot:
<img width="1288" height="466" alt="Screenshot 2026-02-24 at 16 01 05"
src="https://github.com/user-attachments/assets/6ca5048d-63fa-4295-a578-358904bb92eb"
/>

Release Notes:

- Added the ability to delete a git worktree from the worktree picker

---------

Co-authored-by: Anthony Eid <anthony@zed.dev>
2026-03-04 21:49:06 +00:00
Mikayla Maki
9c9337a802
Add cmd-y binding for agent::Keep in agent diff review (#50656)
Release Notes:

- Added `cmd-y` keybinding for accepting changes in the agent diff
review, matching the git diff review shortcut.
2026-03-04 00:09:01 +00:00
Tom Houlé
6a749380aa
Add fast mode toggle in agent panel (#49714)
This is a staff only toggle for now, since the consequences of
activating it are not obvious and quite dire (tokens costs 6 times
more).

Also, persist thinking, thinking effort and fast mode in DbThread so the
thinking mode toggle and thinking effort are persisted.

Release Notes:

- Agent: The thinking mode toggle and thinking effort are now persisted
when selecting a thread from history.
2026-02-26 21:19:41 +01:00
Danilo Leal
423a8c4b29
git_ui: Add "Review Branch" with agent feature (#49513)
This PR adds a button in the `git: branch diff` view that allows to
quickly and easily send the entire diff to your last used agent for a
review. What this does is automatically submits a (pre-written and
generic) prompt to the last agents you were using in the agent panel
with the whole content of your diff.

<img width="750" height="1964" alt="Screenshot 2026-02-18 at 3  35@2x"
src="https://github.com/user-attachments/assets/493d8cf4-4815-4b01-91a0-6a39ad6219fe"
/>

Release Notes:

- Added a "Review Branch" button in the `git: branch diff` view so that
the whole diff can be quickly sent for review to an agent.

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-02-18 19:18:15 -03:00
Danilo Leal
52fc14f36d
agent_ui: Add the ability to undo "reject all" (#48462)
Closes https://github.com/zed-industries/zed/issues/39294

This PR implements the ability to undo the "reject all" action from the
agent panel (and the other places where this button is surfaced).
Effectively, this allows to recuperate the edits an agent has introduced
in case you either accidentally clicked the button or regretted the
decision to reject all.


https://github.com/user-attachments/assets/6f048b95-dd0a-4a45-8b4f-cd8f99d45cb3

Release Notes:

- Agent: Introduced the ability to undo the "reject all" action from
agent-made changes.

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2026-02-18 15:49:36 -03:00
Danilo Leal
011113ea3c
workspace: Improve recent projects picker for multi-project scenario (#48989)
Follow-up to https://github.com/zed-industries/zed/pull/46641.

In the PR linked above, I had introduced a dropdown that'd show up in
the title bar when the workspace contained more than one project.
Although that helped improve the multi-project use case, it created some
quirky designs:

- The project dropdown and the recent project pickers looked too
different from one another
- The transition between the 2 project case to the 1 project scenario,
from the dropdown, was not great, because you'd be then seeing the
bigger recent projects picker
- The `workspace: switch project` action was still reachable in the
command palette even if you had one project in the workspace

So, what this PR does is essentially fixing all of this by consolidating
it all in the Recent Projects picker. If you are in a multi-project
scenario, the picker will display a section with all of the projects on
the workspace allowing you to activate each one of them. The picker also
looks simpler when you reach it by clicking on the project name in the
title bar, as opposed to through the keybinding. I've then removed the
project dropdown code as well as the action, given we don't need them
anymore due to the consolidation. Lastly, I tackled the inconsistent
wording used between "Folders", "Projects", and "Workspaces".

Here's the result:


https://github.com/user-attachments/assets/9d8ef3e3-e57b-4558-9bc0-dcc401dec469

- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Workspace: Improved the recent projects picker by making it also
display active projects in case of a multi-project workspace.
2026-02-12 09:54:33 -03:00
Richard Feldman
ee3f40fe25
Re-add MultiWorkspace (#48800)
Release Notes:

- Added agent panel restoration. Now restarting your editor won't cause
your thread to be forgotten.

---------

Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
2026-02-12 01:06:23 +00:00
Danilo Leal
2b7b8865ba
agent_ui: Fix keybinding display inside tooltips in the footer actions (#48909)
- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Agent: Fixed an issue where keybindings inside tooltips in the message
editor footer actions weren't being displayed.
2026-02-11 02:12:31 -03:00
Bennet Bo Fenner
7a6674d5dc
agent: Move subagent spawning to ThreadEnvironment (#48381)
TODO
- [x] Cancellation
- [x] Show subagent card as soon as tool_name == "subagent"
- [x] Keybinding for closing subagent full screen view
- [x] Only fire subagent notifications when appropriate
- [x] Fix tests

Release Notes:

- N/A

---------

Co-authored-by: Cameron <cameron@zed.dev>
Co-authored-by: Tom Houlé <tom@tomhoule.com>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-02-10 11:26:01 +00:00
Finn Evers
165b404460
Revert "New multi workspace (#47795)" (#48776)
Preparing this just in case.

Release Notes:

- N/A
2026-02-09 15:37:16 +01:00
Danilo Leal
a27304bf91
agent_ui: Refine thinking effort selector (#48790)
This PR adds some design refinements to the thinking effort selector (to
be generally rolled out soon):
- Improved split button UI styles and consistency with other dropdowns
in the message editor
- Stopped rendering the effort selector if thinking is turned off
- Added a keybinding to trigger the effort menu
- Added a keybinding to cycle through effort options

<img width="500" height="380" alt="Screenshot 2026-02-09 at 10  18@2x"
src="https://github.com/user-attachments/assets/48d5b65c-7256-4ceb-aab2-35869f8fbf4a"
/>

---

- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- N/A
2026-02-09 10:42:07 -03:00
Mikayla Maki
1c21718587
New multi workspace (#47795)
It's happeningggggg

Release Notes:

- Changed the Agent Panel so that the Active Thread is restored on
restart.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Richard Feldman <richard@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-08 17:46:51 -08:00
Kunall Banerjee
ec7e9dc1cc
keymap_editor: Add alt-l keybinding for cycling favorite models (#48390)
The `alt-tab` keybinding doesn’t work properly under the `AgentPanel`
context on Windows and certain Linux distros, so `alt-l` is provided as
an alternative for the same action.

In my testing, I could not trigger the `AcpThread > Editor` context, but
I added the keybinding there too just in case.

Closes #48347.

Release Notes:

- Added an alternate keybinding for `agent::CycleFavoriteModels` on
Linux and Windows to prevent conflict with global app switcher
2026-02-06 21:54:04 -05:00
MostlyK
ab54a7e29b
repl: Add quality of life changes in Jupyter view (#47533)
- Keyboard navigation where you can traverse through cells using up and
down arrow
- Jupyter Logo added 
- Initialize kernel as shutdown for more predictable behavior
- Ability to create .ipynb files with bare essential metadata.
- Optimize editor initialization to avoid cloning the entire notebook
and shortcuts


Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-02-04 07:05:22 -06:00
Lukas Wirth
4c0e348588
keymaps: Fix accept edit predictions key binding collisions (#48184)
Release Notes:

- Fixed accepting next word and next line edit prediction keybindings
colliding cursor movement keybinds
2026-02-02 15:08:43 +00:00
Lukas Wirth
b9c0f756c4
fs: Cache filesystem case sensitivity (#47995)
We query this on the main thread on every file system access otherwise

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-01-30 09:42:28 +01:00
Rutger Cappendijk
52182e43cd
agent_ui: Add ability to add terminal output to agent context (#47637)
Summary

This PR adds the ability to quote terminal selections into Agent
threads, similar to how editor selections can be quoted. Users can now
select text in the terminal and add it as context to their agent
conversation.

### Features

- **Context menu**: Added "Add to Agent Thread" option to the terminal's
right-click menu (only shows when text is selected)
- **Keyboard shortcut**: The existing `cmd->` / `ctrl->` shortcut now
works in the terminal
- **Collapsed display**: Terminal output appears as a collapsed
"Terminal" crease in the chat, just like code references
- **Works with both thread types**: Supports both ACP-style threads
(Claude Code) and text threads

### Implementation

- Extended `quote_selection` handler to check for terminal panel focus
after checking for editor selections
- Terminal content is formatted as ` ```terminal` code blocks via new
`insert_terminal_crease` method
- Refactored crease insertion into `insert_crease_impl` helper to
support both code snippets (with `TextSnippet` icon) and terminal output
(with `Terminal` icon)
- Added automatic detection and folding of ` ```terminal` blocks in
`set_message` so terminal content stays collapsed in sent message
history
- Terminal creases use a trailing space instead of newline so cursor
behavior matches user expectations

### Demo

1. Select text in terminal
2. Right-click → "Add to Agent Thread" (or press `cmd->`)
3. Terminal content appears as collapsed "Terminal" block in chat
4. Send message - AI receives full terminal output, but chat history
shows it collapsed

### General note

I'm new to open source and the codebase in general so let me know if
anything should be different!
I tried to stay in line with other patterns I saw.
I didn't see a way to setup an end to end test with a real terminal so I
just added a unit test for the adding of the text to the chat, if it
exists and I missed it then I think the test coverage could be improved
with a test that uses a real terminal + running the command

<img width="431" height="148" alt="image"
src="https://github.com/user-attachments/assets/854732f9-2a7f-4f31-867e-d54af068c97c"
/>


Release Notes:

- agent: Added the ability to send selections from terminals into the
Agent thread

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-01-29 15:15:03 +00:00
Danilo Leal
d18d4b188c
thread view: Improve thinking mode toggle UI (#47945)
Add the icon to the left side of the message editor, add a new icon for
when the thinking mode is toggled on, and add a keybinding for the
action. Currently available under a feature flag-only but should be out
soon.

<img width="400" height="318" alt="Screenshot 2026-01-29 at 11  57@2x"
src="https://github.com/user-attachments/assets/e033ec83-746b-4fed-beb7-ed26e96cb60a"
/>

Release Notes:

- N/A
2026-01-29 12:11:13 -03:00
Danilo Leal
37b8f66df5
agent_ui: Add a menu for inserting context (#47768)
This PR swaps the @ icon button in the message editor for a + one, which
opens a dropdown that displays context options you can add to the agent.
Aside from removing one step if you're wanting to add context first with
the mouse (in comparison to just inserting @ in the message editor),
this menu will also house skills you've created, whenever we get to
support to that. It also works to surface images and selections in a bit
more visible way as context options. So, effectivelly, this is a bit of
foundation work for further features to come. Here's what it looks like:

<img width="500" height="586" alt="Screenshot 2026-01-27 at 11  38@2x"
src="https://github.com/user-attachments/assets/551686ba-4629-4317-9177-1e942512a23c"
/>

Note that all the options you see in the menu should also be available
through simply typing @ in the message editor.

Release Notes:

- Agent: Added a menu for inserting context more easily with the mouse
in the agent panel.
2026-01-27 15:37:32 -03:00
Ichimura Tomoo
8e291ec404
encoding: Add "reopen with encoding" (#46553)
# Add "Reopen with Encoding" feature (Local/Single user)

## Summary

This PR adds a "Reopen with Encoding" feature to allow users to manually
specify an encoding and reload the active buffer.

This feature allows users to explicitly specify the encoding and reload
the file to resolve garbled text caused by incorrect detection.

## Changes

1.  Added encoding picker logic to `encoding_selector`

- Implemented a modal UI accessible via the command palette, shortcuts,
or by clicking the encoding status in the status bar.
- Allows users to select from a list of supported encodings (Shift JIS,
EUC-JP, UTF-16LE, etc.).

2.  Updated Buffer logic (crates/language)

- Added a `force_encoding_on_next_reload` flag to the Buffer struct.
- Updated the `reload` method to check this flag and apply the following
logic:
- **Non-Unicode (e.g., Shift JIS):** Bypasses heuristics (like BOM
checks) to force the specified encoding.
- **Unicode (e.g., UTF-8):** Performs standard BOM detection. This
ensures that the BOM is correctly handled/consumed when switching back
to UTF-8.

3.  UI / Keymap

- Made the encoding status in the status bar (ActiveBufferEncoding)
clickable.
- Added default keybindings:
  - macOS: cmd-k n
  - Linux/Windows: ctrl-k n
  - Windows: ctrl-k n

## Limitations & Scope

To ensure stability and keep the PR focused, the following scenarios are
intentionally out of scope:

1. **Collaboration and Remote Connections**

- Encoding changes are disabled when collaboration (is_shared) or SSH
remote connections (is_via_remote_server) are active.
- **Reason:** Synchronizing encoding state changes between host/guest or
handling remote reloads involves complex synchronization logic. This PR
focuses on local files only.

`Remote Connection (SSH/WSL)`

|Via status bar|Via shortcut/command|
|:---:|:---:|
|<img width="767" height="136" alt="remote_tooltip"
src="https://github.com/user-attachments/assets/6c7cb293-2486-4f6d-a3ff-2086d939398e"
width="400" />|<img width="742" height="219" alt="remote_shortcut"
src="https://github.com/user-attachments/assets/5448f199-2066-4baf-b349-a983ab2fa77a"
width="400" />|

`Collaboration Session `

|Via status bar|Via shortcut/command|
|:---:|:---:|
|<img width="734" height="86" alt="collab_tooltip"
src="https://github.com/user-attachments/assets/37de99a9-dd33-4c78-98bf-20654d41fdd0"
/>|<img width="720" height="182" alt="collab_pop"
src="https://github.com/user-attachments/assets/91d03ea7-f029-442a-8236-55234576f7ed"
/>|

2. Dirty State

- The feature is disabled if the buffer has unsaved changes to prevent
data loss during reload.

|Via status bar|Via shortcut/command|
|:---:|:---:|
|<img width="545" height="103" alt="local_dirty_tooltip"
src="https://github.com/user-attachments/assets/d9ae658e-52b3-4ecd-9873-d0ec8bd51b5d"
/>|<img width="707" height="178" alt="local_dirty_pop"
src="https://github.com/user-attachments/assets/d170ea1e-9fcb-42e7-aa3e-0555b4a19d86"
/>|

3. Files detected as Binary

Files that worktree detects as "binary" (e.g., UTF-16 files without BOM
containing non-ASCII characters) are not opened in the editor, so this
feature cannot be triggered.
**Future Work**: Fixing this would require modifying crates/worktree
heuristics or exposing a "Force Open as Text" action for InvalidItemView
to trigger. Given the scope and impact, this is deferred to a future PR.

## Test Plan

I verified the feature and BOM handling using the following scenarios:

### Preparation

Used the following test files:

-
[**test_utf8.txt**](https://github.com/user-attachments/files/24548803/test_utf8.txt):
English-only text file. No BOM.
-
[**test_utf8_bom.txt**](https://github.com/user-attachments/files/24548822/test_utf8_bom.txt):
English-only text file. With BOM.
-
[**test_utf8_jp_bom.txt**](https://github.com/user-attachments/files/24548825/test_utf8_jp_bom.txt):
UTF-8 with BOM file containing Japanese characters.
-
[**test_shiftjis_jp.txt**](https://github.com/user-attachments/files/24548827/test_shiftjis_jp.txt):
Shift-JIS file containing Japanese characters (content designed to
trigger misdetection, e.g., using only half-width katakana).

Used an external editor (VS Code or Notepad) for verification.

### Case 1: English-only file behavior

1.  Open an English-only UTF-8 file (test_utf8.txt).
2.  Reopen as Shift JIS.
3.  **Result:**

- Text appearance remains unchanged (since ASCII is compatible).
- Status bar updates to "Shift JIS".

### Case 2: Fixing Mojibake

1. Open a Shift-JIS file (test_shiftjis_jp.txt) that causes detection
failure.
    ※Confirm it opens with mojibake
2.  Select Shift JIS from the status bar selector.
3.  **Result:**

- Mojibake is resolved, and Japanese text is displayed correctly.
- Status bar updates to "Shift JIS".

### Case 3: Unicode file with BOM behavior

1.  Open an English-only UTF-8 with BOM file (test_utf8_bom.txt).
2.  Reopen as `Shift JIS`.
3.  **Result:**

- The BOM bytes are displayed as mojibake at the beginning of the file.
- The rest of the English text is displayed normally (ASCII
compatibility).
- Status bar updates to "Shift JIS".

### Case 4: Non-Unicode file with BOM behavior

1. Open a UTF-8 with BOM file containing Japanese
(test_utf8_jp_bom.txt).
2.  Reopen as Shift JIS.
3.  **Result:**

- The BOM bytes at the start are displayed as mojibake.
- The Japanese text body is displayed as mojibake (UTF-8 bytes
interpreted as Shift JIS).
- Status bar updates to "Shift JIS" (no BOM indicator).

### Case 5: Revert to Unicode

1.  From the state in Case 4 (Shift JIS with mojibake), reopen as UTF-8.
2.  **Result:**

- The BOM mojibake at the start disappears (consumed).
- The text returns to normal.
- Status bar updates to "UTF-8 (BOM)".

### Case 6: External BOM removal (State sync)

1.  Open a UTF-8 with BOM file in Zed (test_utf8_bom.txt).
2. Open the same file in an external editor and save it as UTF-8 (No
BOM).
3.  Refocus Zed.
4.  **Result:**

- Text appearance remains unchanged.
- The (BOM) indicator disappears from the status bar.
- Saving in Zed and checking externally confirms the BOM is gone.

### Case 7: External BOM addition

1. From the state in Case 6 (UTF-8 No BOM), save as UTF-8 with BOM in
the external editor.
2.  Refocus Zed.
3.  **Result:**

- The (BOM) indicator appears in the status bar.
- Saving in Zed and checking externally confirms the BOM is present.

### Case 8: External Encoding Change (Auto-detect sync)

1.  Open an English-only UTF-8 file in Zed (`test_utf8.txt`).
    * *Status bar shows: "UTF-8".*
2. Open the same file in an external editor and save it as **UTF-16LE
with BOM**.
3.  Refocus Zed.
4.  **Result:**
    * The text remains readable (no mojibake).
* **Status bar automatically updates to "UTF-16LE (BOM)".** (Verifies
that `buffer.encoding` is correctly updated during reload).

Release Notes:

- Added "Reopen with Encoding" feature (currently supported for local
files).

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-01-27 05:27:26 +00:00
MostlyK
e9aadaf0af
repl: Add initial notebook execution + KernelSession abstraction (#43553)
Coming from discussion on #25936 and
https://github.com/zed-industries/zed/pull/19756 .
This PR introduces the KernelSession abstraction and adds basic notebook
cell execution inside NotebookEditor.

The following provides a base starter for the development on Notebooks.

What this PR includes today:

Release Notes:

- KernelSession trait extracted. Both REPL and NotebookEditor now share
the same routing mechanism.
- NotebookEditor can launch kernels, execute code cells, and display
outputs.
- Basic cell operations: run current cell, run all, move up/down, add
code/markdown blocks. Keybindings follow Jupyter defaults.


Next Steps:

- [x] Editing support for markdown and code blocks.
- Buffer integration instead of temporary cell text.
- [x] Proper focus behavior when executing or adding cells.
- Kernel control UI.

A little far fetched steps:

- Vim Support
- Cell Handling Improvement and other convenient features and design
from other editors
- Ability to have better parsing for AI Support. 


I have attached a video of showcasing some of the features:


https://github.com/user-attachments/assets/37e6f3e5-2022-45f0-a73d-2dd01ebc2932
2026-01-22 09:00:29 -06:00
MostlyK
59738a7776
Support zooming and panning in the image viewer (#43944)
Implemented Pan and Zoom on the Image Viewer.

Demo:



https://github.com/user-attachments/assets/855bafe8-fdc2-4945-9bfb-e48382264806





Closes #9584



Release Notes:

- Add zoom in/out, reset, fit-to-view and zoom-to-actual actions 
- Support scroll-wheel zoom with modifier, click-and-drag panning 
- Renders a zoom percentage overlay. 
- ImageView Toolbar Added to control zoom in/out and fit view.

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-01-21 22:48:30 +01:00
Danilo Leal
5e1b7ae90c
agent_ui: Fix keybinding conflict with editing queued messages (#47290)
This PR fixes `shift-e` being used for triggering edits in queued
messages, which breaks writing simple capital E in the editor.

Release Notes:

- N/A
2026-01-21 11:00:16 -03:00
Danilo Leal
ff35da22fb
agent_ui: Fix keybinding conflict with action to clean up the queue (#47254)
This PR frees up `shift-backspace` to work as it did before. Now, the
action to remove the first queued message is now assigned to the
`cmd-shfit-backspace` keybinding, whereas the action to clear the entire
message queue is assigned to `cmd-alt-backspace`.

Release Notes:

- N/A
2026-01-20 20:54:13 -03:00
Danilo Leal
2ccca66dc1
agent_ui: Add support for editing queued messages (#47234)
This PR adds the ability to edit a queued message, which you can now do
by hitting `cmd-e` from the message editor, which will focus the first
queued message. To pull that off, I'm also making the queued messages
render as an editor, the same way we do with regular user messages. That
way, we ensure less layout shift when focusing in and out of the queued
message for editing and gain the ability to render context
buttons/creases the same way we do in the main message editor.


https://github.com/user-attachments/assets/fb68fd48-c0cd-491f-a7d9-5065a9151b0b

Note that in the video, I show the state in which you're still editing
in the moment in which the queued message would be sent. If that
happens, your queued message won't be sent even if you unfocus the
queued message editor. In this case, you need to explicitly hit "Send
Now".

Release Notes:

- Agent: Added the ability to edit queued messages.
2026-01-20 17:26:30 -03:00