Commit graph

24108 commits

Author SHA1 Message Date
Dino
5398443e94
Merge 9c35cd6a87 into bd4e943597 2025-08-26 16:02:01 -04:00
Danilo Leal
bd4e943597
acp: Add onboarding modal & title bar banner (#36784)
Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2025-08-26 16:59:12 -03:00
Danilo Leal
c5d3c7d790
thread view: Improve agent installation UI (#36957)
Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-26 16:58:23 -03:00
张小白
fff0ecead1
windows: Fix keystroke & keymap (#36572)
Closes #36300

This PR follows Windows conventions by introducing
`KeybindingKeystroke`, so shortcuts now show up as `ctrl-shift-4`
instead of `ctrl-$`.

It also fixes issues with keyboard layouts: when `use_key_equivalents`
is set to true, keys are remapped based on their virtual key codes. For
example, `ctrl-\` on a standard English layout will be mapped to
`ctrl-ё` on a Russian layout.


Release Notes:

- N/A

---------

Co-authored-by: Kate <kate@zed.dev>
2025-08-27 03:24:50 +08:00
dinocosta
9c35cd6a87 chore(diagnostics): remove pattern_items module
With the previous commit, both `BufferSearchBar` and `ProjectSearchView`
have been updated to no longer rely on `PatternItems`, seeing as
`SearchQuery::regex` is now responsible for handling pattern items.

This commit removes the `search::pattern_items` module, since there's no
longer other modules needing its functionality.
2025-08-26 19:19:33 +01:00
dinocosta
c69f4f49f0 refactor: implement case sensitive pattern items in search query
In order to simplify the implementation of pattern items in search
queries, this commit updates the `project::search::SearchQuery::regex`
function so as to support both `\\c` and `\\C` in the provided query.

This means that we no longer need to have both `BufferSearchBar` and
`ProjectSearchView` handling pattern items, so the
`search::pattern_items` module can now safely be removed.

It's worth noting that, since these are now handled at the `SearchQuery`
level, this removes the updates to the UI regarding search options, that
were being triggered by the pattern items being processed and applied to
the search options.

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-26 19:09:06 +01:00
Max Brunsfeld
b1b60bb7fe
Work around duplicate ssh projects in workspace migration (#36946)
Fixes another case where the sqlite migration could fail, reported by
@SomeoneToIgnore.

Release Notes:

- N/A
2025-08-26 10:54:39 -07:00
Adam Mulvany
0e575b2809
helix: Fix buffer search: deploy reset to normal mode (#36917)
## Fix: Preserve Helix mode when using  search

### Problem
When using `buffer search: deploy` in Helix mode, pressing Enter to
dismiss the search incorrectly returned to Vim NORMAL mode instead of
Helix NORMAL mode.

### Root Cause
The `search_deploy` function was resetting the entire `SearchState` to
default values when buffer search: deploy was activated. Since the
default `Mode` is `Normal`, this caused `prior_mode` to be set to Vim's
Normal mode regardless of the actual mode before search.

### Solution
Modified `search_deploy` to preserve the current mode when resetting
search state:
- Store the current mode before resetting
- Reset search state to default
- Restore the saved mode to `prior_mode`

This ensures the editor returns to the correct mode (Helix NORMAL or Vim
NORMAL) after dismissing buffer search.

### Settings

I was able to reproduce and then test the fix was successful with the
following config and have also tested with vim: default_mode commented
out to ensure that's not influencing the mode selection flow:

```
  "helix_mode": true,
  "vim_mode": true,
  "vim": {
    "default_mode": "helix_normal"
  },
```

This is on Kubuntu 24.04.

The following test combinations pass locally:

- `cargo test -p search`
- `cargo test -p vim` 
- `cargo test -p editor`
- `cargo test -p workspace`
- `cargo test -p gpui -- vim`
- `cargo test -p gpui -- helix`

Release Notes:

- Fixed Helix mode switching to Vim normal mode after using `buffer
search: deploy` to search

Closes #36872
2025-08-26 10:38:53 -06:00
Danilo Leal
65c6c709fd
thread view: Refine tool call UI (#36937)
Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2025-08-26 12:55:40 -03:00
dinocosta
d28e52d9e7 feat: add pattern items to project search
Update the `search::project_search::ProjectSearchView` implementation in
order to allow users to leverage pattern items in the search query.

Add a very basic `test_pattern_items` test to `search::project_search`
in order to test how the `apply_pattern_items` method affects the
`ProjectSearchView.search_options` value depending on the query editor's
text. Unfortunately I wasn't having much luck adding a text similar to
the one for `BufferSearchBar` where we actually simulate the user's
input and keystrokes, so definitely something that can be improved upon.
2025-08-26 16:49:54 +01:00
dinocosta
7f9e589491 refactor: introduce pattern_items module 2025-08-26 16:28:58 +01:00
dinocosta
835f613fd6 refactor: reimplement pattern items as an enum
Update the way pattern items are implemented so that, instead of saving
these in an array with the character representation, the search option
and its value, it now is a `PatternItem` enum, and the enum implements
several methods:

- `character` - Returns the character representation for the pattern
item item, without the backslash.
- `search_option` - Returns the search option and its desired value.

The `TryFrom<&str>` trait is also implemented for `PatternItem` so that
we can simply build a `PatternItem` from a string like `"\\c"`.
2025-08-26 16:28:57 +01:00
dinocosta
f7473c80ae fix: fix issue with \ preceding pattern items
With the current implementation of pattern items, it's impossible to
search for strings like `\c` in buffers as, even when using `\\c`, the
`\c` suffix will be interpreted as a pattern item. This commit updates
the regex used to find the pattern items so as to ensure that the
preceding character is never a `\` and, if it is, it's considered that
the user is searching for a slash instead of trying to use a pattern
item.
2025-08-26 16:28:57 +01:00
dinocosta
09470b9d57 fix: fix issue with conflicting pattern items
Fix issue where having conflicting pattern items in the search query
could lead to erroneous results. For example, if the search query was
`test\c\C\c`, one would expect for the case sensitivity option to be
disabled, seeing as `\c` is the last pattern item. However, since the
code was simply iterating over `PATTERN_ITEMS`, it did not take into
consideration that:

1. The same pattern item could appear more than once in the query 2. The
order of the pattern item in the query should take precedence over the
order of the pattern item in `PATTERN_ITEMS`

As such, this commit fixes that so that the implementation actually
iterates over the pattern items capture in the query, ensuring that, if
`\c\C\c` is found, the last pattern item is the one that will be
applied.
2025-08-26 16:28:57 +01:00
dinocosta
7366112f56 fix: fix issue with case-sensitivity turning off after first character
This commit fixes an issue with the pattern items implementation where,
in vim mode, deploying the buffer search through `/` and then typing any
character would automatically disable the regex setting. After some
research this was tracked down to the fact that the `default_options`
don't actually contain all of the settings that are enabled when the
buffer search bar is shown with `/`, as the vim layer is the one that
ends up calling the `set_search_options` method with the
`SearchOptions::REGEX` option enabled. Calling this method doesn't
actually update the `default_options`, and I believe this should
probably not be changed.

As such, in order to prevent this issue, this commit introduces a new
`pattern_item_options` vector to the `BufferSearchBar`, which simply
keeps track of the search options that were either enabled/disabled by
pattern items in the search query, that actually had impact on the
search options. By keeping track of this, one can easily just revert the
options, by calling `toggle_search_option`, seeing as we only keep track
of the ones that actually had any effect on the options, and revert to
all of the options that were enabled when the buffer search bar was
deployed, be it on the `default_options` or not.

I believe the current implementation can probably be improved with a
simple `SearchOptions` and then using the `exclusion` or `intersection`
methods but have yet to dedicate more time to this. On the other hand,
there's yet another issue that surfaced while working on this:

1. Type `Main\c\C\c` in the search query 2. Confirm that
case-sensitivity is enabled

This happens because we're not actually keeping track of the order the
pattern items are applied in the search query, so the order they're
defined in `PATTERN_ITEMS` takes precendence, we'll likely need to
capture the matches so we can then actually leverage the order to
determine what the final option should be.
2025-08-26 16:28:57 +01:00
dinocosta
e53d9e3d01 refactor: only apply pattern items if regex is enabled 2025-08-26 16:28:57 +01:00
dinocosta
aa07594057 refactor: use regex over fancy-regex in pattern-items implementation 2025-08-26 16:28:57 +01:00
Conrad Irwin
0ab17c95fb Set up test properly 2025-08-26 16:28:57 +01:00
dinocosta
f1ba9b3d3d fix: fix clippy issues 2025-08-26 16:28:57 +01:00
dinocosta
e17af0400a test(buffer_search): add test for pattern items
Add a very simple test that verifies the behaviour of
`apply_pattern_items` when the search query is updated. In practice it
would be best to be able to actually simulate the whole flow where
`EditorEvent::Edited` is triggered but I haven't managed to figure out
how to do that just yet.
2025-08-26 16:28:57 +01:00
dinocosta
3d1113a3f3 refactor: use regex to remove pattern items from search query
This might be a bit of an overkill for the time being, but I expect that
when the array of pattern items grows, it might be faster to replace the
pattern items with a regex instead of iterating over the array.
2025-08-26 16:28:57 +01:00
dinocosta
83f00ce3c4 feat(buffer_search): allow pattern items in search query
Update the way the search query in the buffer search bar is handled in
order to support pattern items. Right now only two pattern items are
supported:

- `\c` – When \c is provided in the search query, it disables the case
sensitivity search option
- `\C` – When \C is provided in the search query, it enables the case
sensitivity search option

This feature takes precedence over the `BufferSearchBar.search_options`,
but it ensures that, if any search option was previously
enabled/disabled and it was disabled/enabled by a pattern item, it'll
return to its initial state when the pattern item is deleted.
2025-08-26 16:28:57 +01:00
Bennet Bo Fenner
858ab9cc23
Revert "ai: Auto select user model when there's no default" (#36932)
Reverts zed-industries/zed#36722

Release Notes:

- N/A
2025-08-26 13:55:09 +00:00
Peter Tripp
76dbcde628
Support disabling drag-and-drop in Project Panel (#36719)
Release Notes:

- Added setting for disabling drag and drop in project panel. `{
"project_panel": {"drag_and_drop": false } }`
2025-08-26 13:35:45 +00:00
Bennet Bo Fenner
372b3c7af6
acp: Enable feature flag for everyone (#36928)
Release Notes:

- N/A
2025-08-26 15:30:26 +02:00
Bennet Bo Fenner
10a1140d49
acp: Improve matching logic when adding new entry to agent_servers (#36926)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-26 11:18:50 +00:00
Bennet Bo Fenner
e96b68bc15
acp: Polish UI (#36927)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-26 10:55:45 +00:00
Ben Brandt
b249593abe
agent2: Always finalize diffs from the edit tool (#36918)
Previously, we wouldn't finalize the diff if an error occurred during
editing or the tool call was canceled.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-08-26 09:46:29 +00:00
Bennet Bo Fenner
c14d84cfdb
acp: Add button to configure custom agent in the configuration view (#36923)
Release Notes:

- N/A
2025-08-26 09:20:33 +00:00
Max Brunsfeld
64b14ef848
Fix Sqlite newline syntax in workspace migration (#36916)
Fixes one more case where I incorrectly tried to use a `\n` escape
sequence for a newline in sqlite.

Release Notes:

- N/A
2025-08-25 22:21:05 -07:00
Rui Ning
bf5ed6d1c9
Remote: Change "sh -c" to "sh -lc" to make config in $HOME/.profile effective (#36760)
Closes #ISSUE

Release Notes:

- The environment of original remote dev cannot be changed without sudo
because of the behavior of "sh -c". This PR changes "sh -c" to "sh -lc"
to let the shell source $HOME/.profile and support customized
environment like customized $PATH variable.
2025-08-25 21:40:53 -06:00
Romans Malinovskis
bb5cfe118f
Add "shift-r" and "g ." support for helix mode (#35468)
Related #4642
Compatible with #34136

Release Notes:

- Helix: `Shift+R` works as Paste instead of taking you to ReplaceMode
- Helix: `g .` goes to last modification place (similar to `. in vim)
2025-08-25 21:37:29 -06:00
Conrad Irwin
633ce23ae9
acp: Send user-configured MCP tools (#36910)
Release Notes:

- N/A
2025-08-26 00:55:24 +00:00
Max Brunsfeld
d43df9e841
Fix workspace migration failure (#36911)
This fixes a regression on nightly introduced in
https://github.com/zed-industries/zed/pull/36714

Release Notes:

- N/A
2025-08-26 00:27:52 +00:00
Conrad Irwin
f8667a8379
Remove unused files (#36909)
Closes #ISSUE

Release Notes:

- N/A
2025-08-25 22:23:58 +00:00
Conrad Irwin
1460573dd4
acp: Rename dev command (#36908)
Release Notes:

- N/A
2025-08-25 16:04:44 -06:00
Kirill Bulatov
65de969cc8
Do not show directories in the InvalidBufferView (#36906)
Follow-up of https://github.com/zed-industries/zed/pull/36764

Release Notes:

- N/A
2025-08-25 21:16:37 +00:00
Danilo Leal
628a9cd8ea
thread view: Add link to docs in the toolbar plus menu (#36883)
Release Notes:

- N/A
2025-08-25 17:34:55 -03:00
Gwen Lg
ad25aba990
remote_server: Improve error reporting (#33770)
Closes #33736

Use `thiserror` to implement error stack and `anyhow` to report is to
user.
Also move some code from main to remote_server to have better crate
isolation.

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-08-25 20:23:29 +00:00
Alvaro Parker
99cee8778c
tab_switcher: Add support for diagnostics (#34547)
Support to show diagnostics on the tab switcher in the same way they are
displayed on the tab bar. This follows the setting
`tabs.show_diagnostics`.

This will improve user experience when disabling the tab bar and still
being able to see the diagnostics when switching tabs

Preview:

<img width="768" height="523" alt="Screenshot From 2025-07-16 11-02-42"
src="https://github.com/user-attachments/assets/308873ba-0458-485d-ae05-0de7c1cdfb28"
/>


Release Notes:

- Added diagnostics indicators to the tab switcher

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-08-25 20:18:03 +00:00
Cole Miller
823a0018e5
acp: Show output for read_file tool in a code block (#36900)
Release Notes:

- N/A
2025-08-25 20:10:17 +00:00
Conrad Irwin
9cc006ff74
acp: Update error matching (#36898)
Release Notes:

- N/A
2025-08-25 14:07:10 -06:00
Michael Sloan
0470baca50
open_ai: Remove model field from ResponseStreamEvent (#36902)
Closes #36901

Release Notes:

- Fixed use of Open WebUI as an LLM provider.
2025-08-25 19:50:08 +00:00
John Tur
4605b96630
Fix constant thread creation on Windows (#36779)
See
https://github.com/zed-industries/zed/issues/36057#issuecomment-3215808649

Fixes https://github.com/zed-industries/zed/issues/36057

Release Notes:

- N/A
2025-08-25 12:45:28 -07:00
Danilo Leal
949398cb93
thread view: Fix some design papercuts (#36893)
Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Matt Miller <mattrx@gmail.com>
2025-08-25 21:07:30 +02:00
Cretezy
79e74b880b
workspace: Allow disabling of padding on zoomed panels (#31913)
Screenshot:

| Before | After |
| -------|------|
|
![image](https://github.com/user-attachments/assets/629e7da2-6070-4abb-b469-3b0824524ca4)
|
![image](https://github.com/user-attachments/assets/99e54412-2e0b-4df9-9c40-a89b0411f6d8)
|
|
![image](https://github.com/user-attachments/assets/e99da846-f39b-47b5-808e-65c22a1af47b)
|
![image](https://github.com/user-attachments/assets/ccd4408f-8cce-44ec-a69a-81794125ec99)
|


Release Notes:

- Added `zoomed_padding` to allow disabling of padding around zoomed
panels

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2025-08-25 19:02:19 +00:00
Bennet Bo Fenner
59af2a7d1f
acp: Add telemetry (#36894)
Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-08-25 20:51:23 +02:00
Danilo Leal
c786c0150f
agent: Add section for agent servers in settings view (#35206)
Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2025-08-25 14:45:24 -04:00
Cole Miller
5fd29d37a6
acp: Model-specific prompt capabilities for 1PA (#36879)
Adds support for per-session prompt capabilities and capability changes
on the Zed side (ACP itself still only has per-connection static
capabilities for now), and uses it to reflect image support accurately
in 1PA threads based on the currently-selected model.

Release Notes:

- N/A
2025-08-25 14:28:11 -04:00
Mikayla Maki
f1204dfc33
Revert "workspace: Disable padding on zoomed panels" (#36884)
Reverts zed-industries/zed#36012

We thought we didn't need this UI, but it turns out it was load bearing
:)

Release Notes:

- Restored the zoomed panel padding
2025-08-25 10:46:36 -07:00