feat(trees): Keep file-tree search open and interactive#1022
Conversation
Before, a click on a row closed an open file-tree search and returned to the full tree. Now the click keeps the search open. The user can then select results and refine the search. A row click now always keeps the search open. The click plan returns closeSearch: false. The field stays on the plan. It gives the close decision one place to change later.
Before, Enter selected the focused match and closed an open file-tree search. Now Enter selects the focused match and keeps the search open. The user can then select several matches without a new search. The Enter handler no longer records a viewport offset, sets the restore-focus flag, or calls closeSearch. Focus stays in the search input. The inline rename path (F2) still closes the search and restores the scroll. This change also updates the affected tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6536e10b8b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
cc @suveshmoza |
6536e10 to
2040197
Compare
|
Codex correctly flagged that the Searching I kept the code faithful to the diffy patch and reworded the PR and commit to describe only the reachable (collapse) behavior. @suveshmoza was a trigger for the expand/reveal intended as a follow-up or could that path be dropped? |
|
It can be dropped |
Before, a hide-non-matches search expanded only the matches and their ancestors, and the user could not change that layout. Now the user can collapse a matched directory during the search to hide its matches. The search keeps that choice until the user clears the search. The controller keeps a set of the directories the user collapsed. On each search refresh it keeps those directories collapsed but still visible, and filters the visible rows from that state. It also prunes stale directories, remaps them through tree mutations, and clears the set when the search closes. The controller now tracks matches outside the visibility pass, so match navigation still uses the full match set.
2040197 to
0dc991a
Compare
|
Dropped the Renamed the test to |
Before, a file-tree search was a temporary mode. It closed as soon as the user clicked a row or pressed Enter, and the user could not change which directories the search expanded. Now the search stays open, and the user can work inside the results.
What the user can now do
How it works
Each commit is a self-contained change:
closeSearch: false.Source of the change
These commits port the
@pierre/treespatch from the diffy project into the TypeScript source. The original patch changed the builtdist/, so this PR applies the same behavior tosrc/. The upstream patch also carried anexpand/reveal override, but @suveshmoza confirmed it is not needed, so this PR drops it and keeps only the reachable collapse behavior. This PR also updates the affected tests and adds a controller test for the collapse override.Test plan
moon run root:format root:lintmoonx trees:typecheckmoonx trees:testmoonx trees:test-e2e