Skip to content

Add Search modal for project-wide text search#46478

Open
ozacod wants to merge 94 commits intozed-industries:mainfrom
ozacod:feat/search-popup
Open

Add Search modal for project-wide text search#46478
ozacod wants to merge 94 commits intozed-industries:mainfrom
ozacod:feat/search-popup

Conversation

@ozacod
Copy link
Copy Markdown
Contributor

@ozacod ozacod commented Jan 9, 2026

Closes #8279

Implemented a new modal for project-wide search. This reuses the logic from the existing search implementation but presents it in a popup window for better accessibility.

quick_search.mov

Release Notes:

  • Added search box feature as popup window.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jan 9, 2026
@ozacod ozacod changed the title Add Search modal for project-wide text search Feat: Add Search modal for project-wide text search Jan 9, 2026
@maxdeviant maxdeviant changed the title Feat: Add Search modal for project-wide text search Add Search modal for project-wide text search Jan 9, 2026
@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 9, 2026

I noticed PR #44530 mid-development. While the functionality is similar, I am submitting this as an alternative implementation because it reuses the existing search logic, which might keep the codebase simpler. Happy to discuss which approach is preferred.

@ozacod ozacod changed the title Add Search modal for project-wide text search Feat: Add Search modal for project-wide text search Jan 9, 2026
@maxdeviant maxdeviant changed the title Feat: Add Search modal for project-wide text search Add Search modal for project-wide text search Jan 9, 2026
@ozacod ozacod changed the title Add Search modal for project-wide text search Feat: Add Search modal for project-wide text search Jan 9, 2026
@ozacod ozacod changed the title Feat: Add Search modal for project-wide text search Add Search modal for project-wide text search Jan 9, 2026
@ozacod ozacod marked this pull request as draft January 10, 2026 18:16
@ozacod ozacod force-pushed the feat/search-popup branch from 8f5aa46 to f6bf001 Compare January 10, 2026 18:17
@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 10, 2026

Completed Features

  • Full editor capability in the preview window with auto-save on edit
  • Draggable window positioning
  • Resizable preview pane height
  • Adjustable split between results list and preview
  • Syntax highlighting preserved in search result snippets
  • Match highlighting in both the results list and preview editor
  • Replace capabilities (Replace Next & Replace All)
  • Double-click navigation to open files
  • All standard search features (Case Sensitive, Whole Word, Regex, Include/Exclude filters)

I would appreciate any feedback or suggestions, and ideas on how to improve further.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 11, 2026

  • Multiline search support (It was already available with current project search however was showing \n instead of escaping properly)
Screenshot 2026-01-11 at 03 34 30

@ozacod ozacod marked this pull request as ready for review January 11, 2026 00:36
@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 14, 2026

Search highlights blend correctly with syntax highlighting
Screenshot 2026-01-15 at 02 50 31

@jonatino
Copy link
Copy Markdown

I was one of the original people to request this. You've absolutely perfected what I had in mind! I think this intellij-style quick popup instant search is an excellent alternative to the dedicated search tab. Thank you @ozacod!!!

@victorcl
Copy link
Copy Markdown

This looks nice, I use vim splits and I always get a little confused on how zed opens the project wide search on the split I am on instead of a modal like it does for the file search. Would it be possible to open files on vertical/horizontal splits with this?

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 15, 2026

This looks nice, I use vim splits and I always get a little confused on how zed opens the project wide search on the split I am on instead of a modal like it does for the file search. Would it be possible to open files on vertical/horizontal splits with this?

Screenshot 2026-01-15 at 21 12 05

Thank you for the idea, added this (I am not good at UI).

@jonatino
Copy link
Copy Markdown

Not a maintainer but I looked through the code and it looks good imo. Very clean implementation. Also cloned ur fork and tested it out on my machine and it works exactly how I thought it would. Great job <3

@notmeta
Copy link
Copy Markdown

notmeta commented Jan 16, 2026

The other implementation seems to be getting more traction (it's been around a bit longer, to be fair), but coming from Jetbrains-based IDEs I much prefer this one. Hopefully this one can be considered too!

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 16, 2026

Not a maintainer but I looked through the code and it looks good imo. Very clean implementation. Also cloned ur fork and tested it out on my machine and it works exactly how I thought it would. Great job <3
@jonatino Thanks for verifying

@gustavotrott
Copy link
Copy Markdown

The other implementation seems to be getting more traction (it's been around a bit longer, to be fair), but coming from Jetbrains-based IDEs I much prefer this one. Hopefully this one can be considered too!

This PR has ~1,000 fewer lines than the other one, which is a huge advantage.

@Malix-Labs
Copy link
Copy Markdown

This PR seems to answer most of the concerns of #8279

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 20, 2026

I’ve just pushed the update for search history (The foundation was already in current project search). Up/down keys are being used to navigate history in current project search, since those keys are already being used for navigation between matches in quick search, search history panel is added and can be opened via cmd-h and history entries can be navigated via arrow keys.
history1
history2

@rushter
Copy link
Copy Markdown

rushter commented Jan 20, 2026

@ozacod thanks for your PR, was waiting for something like this for almost a year.

Is it possible to scroll the code in search using keyboard?
In my current editor (not Zed), I've hacked this and now I can use alt+j/alt-k to quickly scroll the document preview just a little bit without leaving the search . This is useful since sometimes you just want to have a quick look at function implementation and go back to the code.

I see that you can use mouse to scroll it, but can we do this using keyboard without leaving the search bar?

Let's say I search for fn init(). I get multiple results. I want them selectable using up/down, but I also want to scroll the code that I see in the preview. After reading the whole function implementation, I want to press ESC, close the modal and continue working on the code.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 20, 2026

@rushter
Yes, preview panel is actually live editor instance. All operations( editing/scrolling etc) work same as they do in the main editor.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 21, 2026

Hi @maxbrunsfeld , this is ready for review. I built this by reusing nearly all the existing project-search logic, so the actual new code contribution is quite small. I tried to address the visual and UI concerns raised in the discussions. I'd appreciate a look when you have time.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Jan 22, 2026

I haven't pushed this last change to avoid overcomplicating the current PR, but I wanted to demonstrate that the layout is indeed toggleable between IntelliJ and Telescope styles. I believe it will satisfy both preferences. Their functionalities etc are exactly same, just layout is different.

Stacked/Intellij
stacked
Telescope
telescope

@gustavotrott
Copy link
Copy Markdown

gustavotrott commented Apr 1, 2026

Thanks for the feedback. Fixed it in a similar way.

Now it's great! Thanks.


Talking about performance, I’ve noticed a case where the search modal struggles on my machine.

It happens when /dist is included in the search. I tested this with a project including only the following file:
https://github.com/gustavotrott/bbb-plugin-remote-camera/blob/main/dist/RemoteCameraPlugin.js

When searching for CAMERAS_ONLY, Zed becomes very slow.

@SomeoneToIgnore SomeoneToIgnore removed request for a team April 8, 2026 07:29
@yara-blue
Copy link
Copy Markdown
Member

yara-blue commented Apr 8, 2026

@ozacod wonderful work on this PR! You really went above and beyond by literally maintaining it for months! It's my goal for the next few weeks to land this. Let's see how far we can get.

In the next few days I'll be diving into the implementation fixing small stuff as I see them. I'll surface any bigger concerns here so we can discuss them.

Its high time we have 🔭 in Zed

@gustavotrott
Copy link
Copy Markdown

gustavotrott commented Apr 8, 2026

It was not visually appealing if the path is long. So I made the path column width relatively sized again.

It looks much better now. However, I would prefer truncating the beginning of the path instead of the end.

Many files share the same path prefix, so keeping the end visible makes it easier to differentiate between them.
See:

If it's not too complex, it would also be helpful to show a tooltip with the full path when hovering over a truncated path of a result item.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Apr 11, 2026

@yara-blue Thank you. I really enjoyed working with the community to bring these features to life. They gave incredible feedback throughout the process. I think this may even exceed the expectations, since it gives users to the flexibility if both Intellij-style and telescope-style views.
If you don't mind, could you take it from here for now? I am a bit busy these days.

@smnatale
Copy link
Copy Markdown

Very much looking forward to this thank you @ozacod

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Apr 21, 2026

It was not visually appealing if the path is long. So I made the path column width relatively sized again.

It looks much better now. However, I would prefer truncating the beginning of the path instead of the end.

Many files share the same path prefix, so keeping the end visible makes it easier to differentiate between them. See:

If it's not too complex, it would also be helpful to show a tooltip with the full path when hovering over a truncated path of a result item.

It is way better now. Thanks @gustavotrott
file-path
hover-path

@ask4fusora
Copy link
Copy Markdown

Oh yeah, can we have SeedSelectionToSearch please?

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Apr 22, 2026

Oh yeah, can we have SeedSelectionToSearch please?

Did you mean pre-filling the search with the current editor selection? If so, it's already wired up.

@ask4fusora
Copy link
Copy Markdown

Thanks.

@ask4fusora
Copy link
Copy Markdown

May I ask one more question if SearchSelection (the feature where you select a range, and the search result will only be limited to that range) is also implemented?

It would be useful to traverse through old codebases where a function span thousand of lines.

@ozacod
Copy link
Copy Markdown
Contributor Author

ozacod commented Apr 22, 2026

May I ask one more question if SearchSelection (the feature where you select a range, and the search result will only be limited to that range) is also implemented?

It would be useful to traverse through old codebases where a function span thousand of lines.

it is available for single buffer search in Zed. Since quick-search or current project-search (cmd+shift+f) covers multi buffer, I don't see a meaningful application.

@ask4fusora
Copy link
Copy Markdown

You are right. My inquiry is not a meaningful necessity.
Though, to me, it's a considerable UX enhancement.
I personally feel searching in large text, even in single buffer, feels more intuitive using a telescope search than using vim search.

Hope that clears things up. I will be grateful if u would let me know if u will be considering implementing this, not be implementing this but would open to contributions, or not be accepting this feature request at all.

@ozacod ozacod force-pushed the feat/search-popup branch from 566c50c to 09d577e Compare April 22, 2026 20:05
@yara-blue
Copy link
Copy Markdown
Member

@yara-blue Thank you. I really enjoyed working with the community to bring these features to life. They gave incredible feedback throughout the process. I think this may even exceed the expectations, since it gives users to the flexibility if both Intellij-style and telescope-style views.
If you don't mind, could you take it from here for now? I am a bit busy these days.

happily! We are doing quality week now so that comes in between unfortunately. But soon ill be on this.

@ask4fusora The PR is already huge (understandable for the feature). I'd like to keep this as is (ofc bugfixes are welcome!) until it's landed in Zed. Once it's landed that is most certainly not the end of it! At that point we'll look at where to take the feature next, ideas and contributions from the community will again be most welcome then! But now we need to take a pause and focus on getting telescope landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telescope-style search box