Skip to content

file_finder: Remove project's root name from the file finder history#46957

Merged
SomeoneToIgnore merged 11 commits intozed-industries:mainfrom
CCXLV:fix-45135
Feb 13, 2026
Merged

file_finder: Remove project's root name from the file finder history#46957
SomeoneToIgnore merged 11 commits intozed-industries:mainfrom
CCXLV:fix-45135

Conversation

@CCXLV
Copy link
Contributor

@CCXLV CCXLV commented Jan 15, 2026

Closes #45135

Since neither the project search nor file finder search was showing project's root name, including it in the history was unnecessary, especially when the user had project_panel.hide_root set to true.

Release Notes:

  • Made file finder to respect project_panel.hide_root settings

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 15, 2026
@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jan 15, 2026
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried adding a test (as every such logical thing needs one!) but then realized this is a wrong fix?

If I have 2 worktrees (directories) added, I want to have worktree prefix shown for history items either.
Otherwise, the search will show the prefix but the history items won't which looks very odd:

bad.mov

@CCXLV
Copy link
Contributor Author

CCXLV commented Feb 12, 2026

Does that also mean that if I have project_panel.hide_root set to true and if I have multiple worktrees that setting should be ignored?

@SomeoneToIgnore
Copy link
Contributor

No, I think that's a valid case where we have to hide the prefixes.
In my video though, I have the defaults for this setting, false, and it works wrong.

@CCXLV
Copy link
Contributor Author

CCXLV commented Feb 12, 2026

Alright I'll take a look at it in a few hours.

@CCXLV
Copy link
Contributor Author

CCXLV commented Feb 12, 2026

With current changes it respects the project panel settings and hides the projects root based on the hide_root.

But even tho you said that the prefixes should also be hidden if there are more than one folders in the worktree, it kinda gets confusing, because even the hide_root set to true the folders are separated in the worktree. So maybe in case of multiple folders with even hide_root set to true the prefixes should still be visible?

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, good point, I also start to notice that after looking at

// Whether to hide the root entry when only one folder is open in the window.

documentation bit on the hide_root.

Fully agree: we should behave consistently (and have a test for it) + mention that file finder is also affected by this setting, in the default.json and wherever else (rustdocs?) so people are aware of all side-effects.

@CCXLV
Copy link
Contributor Author

CCXLV commented Feb 12, 2026

Made the changes. Happy to adjust further if needed.

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Splendid, thank you so much.

@SomeoneToIgnore SomeoneToIgnore enabled auto-merge (squash) February 13, 2026 15:57
@SomeoneToIgnore SomeoneToIgnore merged commit abaabce into zed-industries:main Feb 13, 2026
28 checks passed
@CCXLV CCXLV deleted the fix-45135 branch February 13, 2026 16:06
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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zed still includes project directory in file search results after hiding root

2 participants