Add quick search modal - #44530
Conversation
|
THANK YOU! Can't wait to use it. While watching your video, I noticed the typed word wasn't highlighted in the preview window. I suggest to highlight the word too and not only the line! Also, about |
|
@gustavotrott I have a UX problem with that: |
|
Nice. This is the sort of experience I'd like to see for ALL modals as it's very similar to Helix. I wanted to do something like this for #43961 , but already a stretch to get a new modal. If you get any traction on this, I'd love to build this sort of thing into my PR. |
|
Testing this out now. @davidbonan First impression - this is a good feature, it seems to be a very popular request. Your implementation fits into the codebase pretty cleanly and seems high quality. Thank you for doing this! My only concerns are about UX inconsistency and elegance. Are there any opportunities to make this fit in better with the rest of Zed. I'm going to spend some time this morning exploring this. @baldwindavid I took a look at your PR too. It seems like, once we land this, you should restructure your PR to make use of some of the same code for previewing buffers, and make the modals look consistent. |
|
@maxbrunsfeld Thanks for the feedback. Could you provide one or two concrete examples of what you’re looking for in terms of UX consistency or elegance ? |
|
Just streaming out feedback as I test:
|
|
I pushed up one small change to prevent the result count header from briefly disappearing (causing vertical shifts) when searching. Can you address the latency issue, streaming in the results? Do you have thoughts on how that should work, or if there are any issues with adding that? |
|
@yara-blue this overlaps pretty heavily with the telescope design stuff we were talking to @danilo-leal and @mattermill about. |
|
Just off the top of my head some recent PRs, discussions, and issues are related:
I think that all of these are driving towards a request of an experience similar to the one in this quick search PR. This is basically how everything is presented in Helix. Not that we need to copy Helix, but I do think it would be beneficial to take a holistic approach to this. This PR seems like a great one to polish up to set the tone for future pickers. |
|
@maxbrunsfeld
|
|
Are you streaming the results in now? |
Yes in line 1558 you can see the stream process |
|
Thanks for explaining; I’ll manually test and review again |
|
@davidbonan The new UI looks great, streaming is looking good. I hit a problem when using it in the Could you test that scenario when you get a chance? Searching in a large repo like WebKit, Chromium or Linux |
|
hey @davidbonan nice work!, it might be worth us working together on this tbh, i've been working on basically the same things but with a focus on modular sources #44942. if not i understand but just a thought? |
1749ee2 to
a7dfbac
Compare
|
Manually testing this one more time, now that #45406 has landed. |
|
@davidbonan The UI is looking really good; I'm liking the larger size. It looks like we are starting and stopping language servers as we page through the different preview buffers. I think that there is some way of opening a buffer without starting language servers. We do that for instance when a buffer only appears as an excerpt in a multi-buffer. I think we should do that here. One other question - what do you think should happen when you click with the mouse on a certain spot in the preview buffer? Right now it puts your cursor there, and transfers focus to the preview buffer, and you can actually edit. If you edit, it opens that buffer in a tab below the modal, but the modal stays open. I think that's a bit odd. Maybe we should make the buffer read-only in this view. I also wonder if we should even keep the modal open if you click to the preview buffer. Maybe at that moment, we should just immediately open the buffer in a tab, and put the cursor at the location where you clicked. Thoughts? |
Yeah, classic multi-buffers are lazy with regards to spawning language servers. The main API for it is |
I think that would actually be a shame. Being able to edit the file directly inside the modal is extremely useful. I rely on this all the time in JetBrains editors. For example, when I need to make the same change across several different files, I just use quick search and apply the edits right there, jumping between files and adjusting each one without breaking the flow. Automatically closing the modal on click would also feel quite awkward and not very practical. Sometimes I just want to select some text in the preview to copy a snippet of code. With that behavior, it would immediately open the file in a tab, which is not what I want in that moment. I would much rather depend on a double click or pressing Enter to explicitly open the file. I am not sure what the best solution is to allow editing inside the Quick Search modal, but the current behavior in Zed where multiple files open stacked and are directly editable works really well for me. Having that same capability inside the Quick Search modal would be even better. If it is possible to reuse an approach similar to what already exists for editing inside Project Search, that would be great. Otherwise, not allowing edits there would feel like a clear downgrade. |
|
We can allow editing, but then we shouldn’t also open the file in the workspace below the modal. And I guess we would need to auto-save the buffer when you change the search query after editing in there, because otherwise the buffer might be dropped without saving your changes. |
|
Thanks for the feedback on the feature |
|
Just my two cents: If the quick search modal lets you edit, how is that really different from global search with multi-buffer? Feels like the same thing, just shown differently. I always thought quick search was meant for quickly finding and inspecting something, not editing. |
|
I really like this, but instead of a popup window, it would be nice if the found files show on the left (where project_panel, git_panel etc go) and the content for each shown in the main screen. |
Read the issue #8279 and you will understand the difference. |
|
Is there a keyboard shortcut to open all the results in multibuffer? |
|
I have a small suggestion after using this feature: I think this could make repeated navigation a bit smoother. |
|
This is looking really good so far! I made some changes to respect OpenExcerpts shortcuts in the quick search preview. I pushed them to davidbonan-quick-search-open-excerpts if you could review, or allow edits from maintainers. |
@mattermill Normally it’s already activated @maxbrunsfeld Before applying the changes or revert changes requested in the comments, I would like to have confirmation from the Zed team on what is wanted |
|
thanks for this, was a big feature missing from zed and performance seems excellent. only issue I have with it is it should not automatically search for the symbol under the cursor when launching, thats what gr(get refs) is for. its annoying having to delete the symbol instead of just typing what i want to search for immediately in neovim with snacks picker, search history can be traversed with ctrl + up/ctrl +down, thats often a pretty useful feature is there any way to set the font size on the left side results panel? |
|
Hi! Thanks for working on something so requested. There where a few other PR's trying to add a search modal. We picked up another and have now build on it where we feel confident we'll get it merged. Therefore I am closing this PR. Once we have pickers with preview it will be pretty minimal and only implemented for a few pickers. At that point we'd love your help. If you wanna get notified of the modal landing subscribe to #56037 |
Overhauls Zed's pickers to make them resizable and give them a preview. Closes zed-industries#8279 ### Background The most requested Zed feature has the last year has been a [Telescope like search box](zed-industries#8279) [discussion](zed-industries#22581). To understand why this is so popular we need to understand search can serve thee goals: - Navigation: fuzzy search is faster & easier then clicking in a file tree - Exploration: example, find a function by a word in its doc comment - Collecting: example, getting a list of functions to change The project search which shows results in a multibuffer is the perfect way to operate on a list of items. Navigation and Exploration need a lot of context around each result and offer fast navigation between them. For both of these live searching is also critical. The `telescope UI` is a picker with a preview to the right or below. It's offered in various editors and IDE's most famously Neovim (through the Telescope plugin), IntelliJ (natively), Helix (natively) and of course VScode (plugins) and it's _many_ forks. While having a UI like that for text search (our project search) is most requested the UX pattern is applied widely, from `find_all_references` to `bookmarks`. It enhances most pickers. Note that we have over 50 different picker modals! The community has tried to build something like this for Zed: - zed-industries#44530 - zed-industries#45307 - zed-industries#46478 - zed-industries#43790 These all became huge PR's that we could not merge for various reasons. This is a really hard feature to integrate in Zed! This PR got started as zed-industries#46478 and supercedes that. ### Design - Extend pickers to support an optional preview with minimal changes to the pickers themselves. - Make pickers resizable. - Complement the existing search do not replace it by having both UI's share the underlying search and allow freely switching between them. - Allow extending the preview to things other then files. - Maintain a clean design on all the pickers. ### Heigh level Implementation overview - Adds an `Option<Preview>` to `Picker` - Gives `PickerDelegate` a method to communicate a preview to the Picker - Overhaul the way pickers are drawn to allow for resizing them. Implemented on the `Shape` and `SizeBouds` structs. - Adds a high level way to draw the `footer` and `editor` so we do not need to change much to the pickers. - Adds a new text finder Picker - Adds a way to take a running search from project search and hand it to the text finder Picker and the other way round - Give the file finder a preview ### Next steps A more detailed list and how to help out will be added to the tracking issue for [Pickes with previews](zed-industries#56037) - Add more previews to more pickers! - Enable selectioning multiple items in pickers and performing actions on those - Open selected items in a multibuffer - Add a way to restore the last picker - Make popovers (picker attached to some menu) resizable as well ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase TODO (will be done post merge) --- Release Notes: - Added resizing via dragging to all picker modals. - Added a preview to the File finder, the preview can be to the right or below. - Added a Text finder picker with a preview as alternative project search UI. The search is shared and allowes switch between UIs while running. --------- Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com> Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Overhauls Zed's pickers to make them resizable and give them a preview. Closes #8279 ### Background The most requested Zed feature has the last year has been a [Telescope like search box](zed-industries/zed#8279) [discussion](zed-industries/zed#22581). To understand why this is so popular we need to understand search can serve thee goals: - Navigation: fuzzy search is faster & easier then clicking in a file tree - Exploration: example, find a function by a word in its doc comment - Collecting: example, getting a list of functions to change The project search which shows results in a multibuffer is the perfect way to operate on a list of items. Navigation and Exploration need a lot of context around each result and offer fast navigation between them. For both of these live searching is also critical. The `telescope UI` is a picker with a preview to the right or below. It's offered in various editors and IDE's most famously Neovim (through the Telescope plugin), IntelliJ (natively), Helix (natively) and of course VScode (plugins) and it's _many_ forks. While having a UI like that for text search (our project search) is most requested the UX pattern is applied widely, from `find_all_references` to `bookmarks`. It enhances most pickers. Note that we have over 50 different picker modals! The community has tried to build something like this for Zed: - zed-industries/zed#44530 - zed-industries/zed#45307 - zed-industries/zed#46478 - zed-industries/zed#43790 These all became huge PR's that we could not merge for various reasons. This is a really hard feature to integrate in Zed! This PR got started as zed-industries/zed#46478 and supercedes that. ### Design - Extend pickers to support an optional preview with minimal changes to the pickers themselves. - Make pickers resizable. - Complement the existing search do not replace it by having both UI's share the underlying search and allow freely switching between them. - Allow extending the preview to things other then files. - Maintain a clean design on all the pickers. ### Heigh level Implementation overview - Adds an `Option<Preview>` to `Picker` - Gives `PickerDelegate` a method to communicate a preview to the Picker - Overhaul the way pickers are drawn to allow for resizing them. Implemented on the `Shape` and `SizeBouds` structs. - Adds a high level way to draw the `footer` and `editor` so we do not need to change much to the pickers. - Adds a new text finder Picker - Adds a way to take a running search from project search and hand it to the text finder Picker and the other way round - Give the file finder a preview ### Next steps A more detailed list and how to help out will be added to the tracking issue for [Pickes with previews](zed-industries/zed#56037) - Add more previews to more pickers! - Enable selectioning multiple items in pickers and performing actions on those - Open selected items in a multibuffer - Add a way to restore the last picker - Make popovers (picker attached to some menu) resizable as well ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase TODO (will be done post merge) --- Release Notes: - Added resizing via dragging to all picker modals. - Added a preview to the File finder, the preview can be to the right or below. - Added a Text finder picker with a preview as alternative project search UI. The search is shared and allowes switch between UIs while running. --------- Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com> Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com> zed-upstream: ccf4058b7a6b05207d4f1dd25106ec5fc439cc74
Overhauls Zed's pickers to make them resizable and give them a preview. Closes zed-industries#8279 ### Background The most requested Zed feature has the last year has been a [Telescope like search box](zed-industries#8279) [discussion](zed-industries#22581). To understand why this is so popular we need to understand search can serve thee goals: - Navigation: fuzzy search is faster & easier then clicking in a file tree - Exploration: example, find a function by a word in its doc comment - Collecting: example, getting a list of functions to change The project search which shows results in a multibuffer is the perfect way to operate on a list of items. Navigation and Exploration need a lot of context around each result and offer fast navigation between them. For both of these live searching is also critical. The `telescope UI` is a picker with a preview to the right or below. It's offered in various editors and IDE's most famously Neovim (through the Telescope plugin), IntelliJ (natively), Helix (natively) and of course VScode (plugins) and it's _many_ forks. While having a UI like that for text search (our project search) is most requested the UX pattern is applied widely, from `find_all_references` to `bookmarks`. It enhances most pickers. Note that we have over 50 different picker modals! The community has tried to build something like this for Zed: - zed-industries#44530 - zed-industries#45307 - zed-industries#46478 - zed-industries#43790 These all became huge PR's that we could not merge for various reasons. This is a really hard feature to integrate in Zed! This PR got started as zed-industries#46478 and supercedes that. ### Design - Extend pickers to support an optional preview with minimal changes to the pickers themselves. - Make pickers resizable. - Complement the existing search do not replace it by having both UI's share the underlying search and allow freely switching between them. - Allow extending the preview to things other then files. - Maintain a clean design on all the pickers. ### Heigh level Implementation overview - Adds an `Option<Preview>` to `Picker` - Gives `PickerDelegate` a method to communicate a preview to the Picker - Overhaul the way pickers are drawn to allow for resizing them. Implemented on the `Shape` and `SizeBouds` structs. - Adds a high level way to draw the `footer` and `editor` so we do not need to change much to the pickers. - Adds a new text finder Picker - Adds a way to take a running search from project search and hand it to the text finder Picker and the other way round - Give the file finder a preview ### Next steps A more detailed list and how to help out will be added to the tracking issue for [Pickes with previews](zed-industries#56037) - Add more previews to more pickers! - Enable selectioning multiple items in pickers and performing actions on those - Open selected items in a multibuffer - Add a way to restore the last picker - Make popovers (picker attached to some menu) resizable as well ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase TODO (will be done post merge) --- Release Notes: - Added resizing via dragging to all picker modals. - Added a preview to the File finder, the preview can be to the right or below. - Added a Text finder picker with a preview as alternative project search UI. The search is shared and allowes switch between UIs while running. --------- Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com> Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Overhauls Zed's pickers to make them resizable and give them a preview. Closes zed-industries#8279 ### Background The most requested Zed feature has the last year has been a [Telescope like search box](zed-industries#8279) [discussion](zed-industries#22581). To understand why this is so popular we need to understand search can serve thee goals: - Navigation: fuzzy search is faster & easier then clicking in a file tree - Exploration: example, find a function by a word in its doc comment - Collecting: example, getting a list of functions to change The project search which shows results in a multibuffer is the perfect way to operate on a list of items. Navigation and Exploration need a lot of context around each result and offer fast navigation between them. For both of these live searching is also critical. The `telescope UI` is a picker with a preview to the right or below. It's offered in various editors and IDE's most famously Neovim (through the Telescope plugin), IntelliJ (natively), Helix (natively) and of course VScode (plugins) and it's _many_ forks. While having a UI like that for text search (our project search) is most requested the UX pattern is applied widely, from `find_all_references` to `bookmarks`. It enhances most pickers. Note that we have over 50 different picker modals! The community has tried to build something like this for Zed: - zed-industries#44530 - zed-industries#45307 - zed-industries#46478 - zed-industries#43790 These all became huge PR's that we could not merge for various reasons. This is a really hard feature to integrate in Zed! This PR got started as zed-industries#46478 and supercedes that. ### Design - Extend pickers to support an optional preview with minimal changes to the pickers themselves. - Make pickers resizable. - Complement the existing search do not replace it by having both UI's share the underlying search and allow freely switching between them. - Allow extending the preview to things other then files. - Maintain a clean design on all the pickers. ### Heigh level Implementation overview - Adds an `Option<Preview>` to `Picker` - Gives `PickerDelegate` a method to communicate a preview to the Picker - Overhaul the way pickers are drawn to allow for resizing them. Implemented on the `Shape` and `SizeBouds` structs. - Adds a high level way to draw the `footer` and `editor` so we do not need to change much to the pickers. - Adds a new text finder Picker - Adds a way to take a running search from project search and hand it to the text finder Picker and the other way round - Give the file finder a preview ### Next steps A more detailed list and how to help out will be added to the tracking issue for [Pickes with previews](zed-industries#56037) - Add more previews to more pickers! - Enable selectioning multiple items in pickers and performing actions on those - Open selected items in a multibuffer - Add a way to restore the last picker - Make popovers (picker attached to some menu) resizable as well ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase TODO (will be done post merge) --- Release Notes: - Added resizing via dragging to all picker modals. - Added a preview to the File finder, the preview can be to the right or below. - Added a Text finder picker with a preview as alternative project search UI. The search is shared and allowes switch between UIs while running. --------- Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com> Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Overhauls Zed's pickers to make them resizable and give them a preview. Closes zed-industries#8279 ### Background The most requested Zed feature has the last year has been a [Telescope like search box](zed-industries#8279) [discussion](zed-industries#22581). To understand why this is so popular we need to understand search can serve thee goals: - Navigation: fuzzy search is faster & easier then clicking in a file tree - Exploration: example, find a function by a word in its doc comment - Collecting: example, getting a list of functions to change The project search which shows results in a multibuffer is the perfect way to operate on a list of items. Navigation and Exploration need a lot of context around each result and offer fast navigation between them. For both of these live searching is also critical. The `telescope UI` is a picker with a preview to the right or below. It's offered in various editors and IDE's most famously Neovim (through the Telescope plugin), IntelliJ (natively), Helix (natively) and of course VScode (plugins) and it's _many_ forks. While having a UI like that for text search (our project search) is most requested the UX pattern is applied widely, from `find_all_references` to `bookmarks`. It enhances most pickers. Note that we have over 50 different picker modals! The community has tried to build something like this for Zed: - zed-industries#44530 - zed-industries#45307 - zed-industries#46478 - zed-industries#43790 These all became huge PR's that we could not merge for various reasons. This is a really hard feature to integrate in Zed! This PR got started as zed-industries#46478 and supercedes that. ### Design - Extend pickers to support an optional preview with minimal changes to the pickers themselves. - Make pickers resizable. - Complement the existing search do not replace it by having both UI's share the underlying search and allow freely switching between them. - Allow extending the preview to things other then files. - Maintain a clean design on all the pickers. ### Heigh level Implementation overview - Adds an `Option<Preview>` to `Picker` - Gives `PickerDelegate` a method to communicate a preview to the Picker - Overhaul the way pickers are drawn to allow for resizing them. Implemented on the `Shape` and `SizeBouds` structs. - Adds a high level way to draw the `footer` and `editor` so we do not need to change much to the pickers. - Adds a new text finder Picker - Adds a way to take a running search from project search and hand it to the text finder Picker and the other way round - Give the file finder a preview ### Next steps A more detailed list and how to help out will be added to the tracking issue for [Pickes with previews](zed-industries#56037) - Add more previews to more pickers! - Enable selectioning multiple items in pickers and performing actions on those - Open selected items in a multibuffer - Add a way to restore the last picker - Make popovers (picker attached to some menu) resizable as well ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content adheres to Zed's UI standards ([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) and [icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md) guidelines) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable ## Showcase TODO (will be done post merge) --- Release Notes: - Added resizing via dragging to all picker modals. - Added a preview to the File finder, the preview can be to the right or below. - Added a Text finder picker with a preview as alternative project search UI. The search is shared and allowes switch between UIs while running. --------- Co-authored-by: ozacod <47009516+ozacod@users.noreply.github.com> Co-authored-by: ozacod <ozacod@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com>



Summary
Implements a quick search modal for project-wide searching.
Features
This modal allows users to quickly search for files and content within the project. It includes a picker for displaying search results and a preview editor for showing the selected result.
Enregistrement.de.l.ecran.2025-12-10.a.12.04.48.mov
Performances tested on large codebase (monorepo and zed project).
Related issue #8279
Release Notes: