You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(file-explorer): clear the Find files filter once per reveal request - #45448
If you used "Reveal in Explorer" on a file Orca can't show in the tree (for example something inside a hidden dotfile folder), the Find files box in the file explorer stopped taking normal letters and digits. Each letter you typed was erased right away, until you restarted Orca. Now the box gets cleared once when you reveal a file, and after that whatever you type stays.
Files
Added
Deleted
Net
Test
1
$\color{#1a7f37}{\Huge{\mathbf{+}}}$60
0
$\color{#1a7f37}{\Huge{\mathbf{+}}}$60
Prod
2
$\color{#1a7f37}{\Huge{\mathbf{+}}}$56
$\color{#cf222e}{\Huge{\mathbf{−}}}$7
$\color{#1a7f37}{\Huge{\mathbf{+}}}$49
What Changed
Before: a reveal request that never finishes (the target sits under a hidden folder such as .github/) stays pending in the store. The effect that clears the Find files query ran again every time the query became non-empty while that reveal was pending, so every keystroke got wiped. Korean IME composition looked like it worked because composition text isn't committed to the query until it ends.
After: the new useClearNameFilterForReveal hook remembers which reveal request it already handled, using a ref compared by object identity. For each new reveal it clears the query once, and only when the Files tree is actually showing. If you type a query after that clear, the pending reveal gets dropped (clearPendingExplorerReveal), so it can't resolve against filtered rows later or stay stuck.
use-file-explorer-tree-pane-state.ts now calls the hook in place of the inline effect.
Why
The old effect had no record of having handled a reveal, so a reveal that never resolved turned it into a filter-clearing loop. Clearing once per request keeps the original intent: a reveal should show the file even if a filter is active. The user's typing also wins over a reveal that is stale or can't be reached. Other options were to make hidden-folder reveals always resolve or to time out pending reveals. Both are broader changes and would still let a later query get wiped.
Repro in an e2e probe: reveal .github/workflows/ci.yml (under a hidden dotfile folder, so the reveal stays pending), then type readme into Find files. The "Terminal error" toast is noise from the shared e2e host and has nothing to do with this change.
Before (main): the query is wiped and the box stays empty.
After (this PR): the query stays and filters down to README.md.
Testing
Added use-clear-name-filter-for-reveal.test.ts. It covers (1) a query typed while a reveal is stuck pending is kept and the reveal is dropped, and (2) the query is cleared exactly once per reveal shown in the Files tree, and a new reveal clears it again. Both fail on main.
Headless Electron e2e probe (remote macOS arm64): on main, Latin typing, Korean IME then Latin, and typing after an auto-reveal all end with an empty query and the reveal still pending. On this branch the query is kept (readme, 노트s, notes, claude) and the pending reveal is null. A reveal that can resolve still selects the target (index.ts).
Perf: renderer-only. The effect runs on reveal changes and when the filter flips between empty and non-empty, not on every keystroke. Microbench of the effect body: no reveal 1.62us to 1.85us median, other-worktree reveal 1.62us to 1.73us, stuck reveal 3.12us to 1.67us (the stuck case no longer re-renders on every keystroke). No new I/O, polling or subprocess work.
Static gates on the touched files: oxlint anti-slop, code-quality native plugins, ast-grep, changed-code quality gate, oxfmt. All clean.
Platforms: macOS. The logic is platform-independent renderer state and doesn't touch paths, shortcuts, or SSH or remote protocols.
Risk
The riskiest part is that a query typed after a reveal now cancels a reveal that is still pending. If someone filters while a slow reveal is loading, the reveal won't jump to the file afterward. That is intended: their typing takes priority. Revealing again works as before. Renderer-only, with no saved data or protocol changes. Back it out with a plain revert.
A pending reveal that never resolves (for example a file under a hidden
dotfile folder) kept re-running the effect that clears the name filter,
so every Latin keystroke in Find files was wiped until restart.
The clear now runs once per reveal request, and only while the files
tree is visible. A query typed after that clear cancels the pending
reveal so it cannot resolve against filtered rows or stay stuck.
Fixes#38050
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Walkthrough
The tree pane now delegates pending-reveal handling to useClearNameFilterForReveal. The hook checks the active worktree and visible-files path, clears an active name filter for a qualifying reveal, and clears a repeated pending reveal when a filter is active. Tests cover hidden reveals and reveals that become visible.
Severity of issue fixed: Medium
Merge Risk: Minimal · up to ed05e
This change stops the Find files query from being cleared repeatedly while a reveal is pending. No concrete merge-blocking risk was found, and the change is mergeable. Typing while a slow reveal is pending cancels it, which is an accepted tradeoff.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Objective [#38050]: Find files must accept Latin letters and digits, and must not stay in a state that drops them until restart. The reviewed head adds useClearNameFilterForReveal (navigation/use-clea…
To decide this check, provide evidence that the reporter's scenario uses a pending reveal. Examples are a log or trace from the affected session showing a pendingExplorerReveal around the time the query was cleared, or a reproduction of the…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the file-explorer area and the fix: the Find files filter is cleared once per reveal request. The raw summary confirms the new hook clears the name filter once per reveal and drops the…
Description check
The description follows the repository template. It has ELI5, What Changed, Why, Linked Issue (Fixes #38050), Visual Proof with before and after images, Testing with the test file and an e2e probe, an…
Out of Scope Changes check
The whole-PR diff (merge base 4dbf4b9 to head ed05e7e) changes three files. These are the new hook use-clear-name-filter-for-reveal.ts, its test file use-clear-name-filter-for-reveal.test.ts, and use-…
Full details: Title check
Explanation
The title names the file-explorer area and the fix: the Find files filter is cleared once per reveal request. The raw summary confirms the new hook clears the name filter once per reveal and drops the pending reveal when the user types. The title is specific, follows conventional commit style, and fits the main change.
Full details: Description check
Explanation
The description follows the repository template. It has ELI5, What Changed, Why, Linked Issue (Fixes #38050), Visual Proof with before and after images, Testing with the test file and an e2e probe, and Risk with a level and a revert path. The Testing checklist is not ticked, and the AI Disclosure, Review, and Agent skill upstream boundary sections are not filled in. Those gaps are minor. The Visual Proof section is complete. The Linked Issue has a number. The Risk section names the riskiest part and the back-out path.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff (merge base 4dbf4b9 to head ed05e7e) changes three files. These are the new hook use-clear-name-filter-for-reveal.ts, its test file use-clear-name-filter-for-reveal.test.ts, and use-file-explorer-tree-pane-state.ts. The pane-state diff removes the inline pendingExplorerReveal effect, replaces it with a call to the new hook with the same inputs, and removes the unused useEffect import. The hook and tests implement the query-clearing behavior that the PR and #38050 describe. The typing-cancels-pending-reveal behavior is a stated design choice in the PR description, and it is part of the fix for the repeated clear. No unrelated files or changes were found in the diff.
Full details: Linked Issues check
Explanation
Objective [#38050]: Find files must accept Latin letters and digits, and must not stay in a state that drops them until restart. The reviewed head adds useClearNameFilterForReveal (navigation/use-clear-name-filter-for-reveal.ts), which replaces the inline effect in use-file-explorer-tree-pane-state.ts. The hook clears the query once per pendingExplorerReveal object (ref identity). A query typed after that clear calls clearPendingExplorerReveal. This removes a repeated query-clearing loop while a reveal stays pending. That loop is a plausible mechanism for the reported symptom, where typed values were cleared within a few hundred ms. The issue does not confirm this mechanism. The issue reports no deterministic reproduction, and its own hypotheses are keystroke routing above the input and useFileExplorerTreeLoadEffects resetting the query. The PR's reproduction uses a hidden-folder reveal (for example .github/workflows/ci.yml), which the issue does not mention. The PR shows the mechanism on main in an e2e probe, and shows the fix on this branch. The unit tests cover the stuck-reveal and once-per-reveal cases. The evidence does not show that the reporter's incident was caused by this path, or that the other hypothesized paths are ruled out. The PR does not address useFileExplorerTreeLoadEffects. Testing claims beyond the reported unit and e2e results are author-reported.
Resolution
To decide this check, provide evidence that the reporter's scenario uses a pending reveal. Examples are a log or trace from the affected session showing a pendingExplorerReveal around the time the query was cleared, or a reproduction of the issue's own steps (no hidden-folder reveal) that passes on this branch. Alternatively, show that useFileExplorerTreeLoadEffects cannot clear the query in the reported state. Also confirm that clearPendingExplorerReveal exists in the store at the reviewed head.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
If you used "Reveal in Explorer" on a file Orca can't show in the tree (for example something inside a hidden dotfile folder), the Find files box in the file explorer stopped taking normal letters and digits. Each letter you typed was erased right away, until you restarted Orca. Now the box gets cleared once when you reveal a file, and after that whatever you type stays.
What Changed
.github/) stays pending in the store. The effect that clears the Find files query ran again every time the query became non-empty while that reveal was pending, so every keystroke got wiped. Korean IME composition looked like it worked because composition text isn't committed to the query until it ends.useClearNameFilterForRevealhook remembers which reveal request it already handled, using a ref compared by object identity. For each new reveal it clears the query once, and only when the Files tree is actually showing. If you type a query after that clear, the pending reveal gets dropped (clearPendingExplorerReveal), so it can't resolve against filtered rows later or stay stuck.use-file-explorer-tree-pane-state.tsnow calls the hook in place of the inline effect.Why
The old effect had no record of having handled a reveal, so a reveal that never resolved turned it into a filter-clearing loop. Clearing once per request keeps the original intent: a reveal should show the file even if a filter is active. The user's typing also wins over a reveal that is stale or can't be reached. Other options were to make hidden-folder reveals always resolve or to time out pending reveals. Both are broader changes and would still let a later query get wiped.
Linked Issue
Fixes #38050
Visual Proof
Repro in an e2e probe: reveal
.github/workflows/ci.yml(under a hidden dotfile folder, so the reveal stays pending), then typereadmeinto Find files. The "Terminal error" toast is noise from the shared e2e host and has nothing to do with this change.Before (main): the query is wiped and the box stays empty.
After (this PR): the query stays and filters down to README.md.
Testing
use-clear-name-filter-for-reveal.test.ts. It covers (1) a query typed while a reveal is stuck pending is kept and the reveal is dropped, and (2) the query is cleared exactly once per reveal shown in the Files tree, and a new reveal clears it again. Both fail on main.vitest --config config/vitest.config.ts src/renderer/src/components/right-sidebar/file-explorer: 4 files, 11 tests pass.readme,노트s,notes,claude) and the pending reveal is null. A reveal that can resolve still selects the target (index.ts).Risk
The riskiest part is that a query typed after a reveal now cancels a reveal that is still pending. If someone filters while a slow reveal is loading, the reveal won't jump to the file afterward. That is intended: their typing takes priority. Revealing again works as before. Renderer-only, with no saved data or protocol changes. Back it out with a plain revert.
Level: Low
Reported by @zieunx