Repository navigation
feat: sticky file filter for the file tree - #164
Open
rod-stuchi wants to merge 1 commit into
Open
rod-stuchi wants to merge 1 commit into
rod-stuchi wants to merge 1 commit into
Conversation
Press `tab` in the `t` file search to switch it to sticky mode. On `enter`, the file tree then keeps only the matching files, so navigation (j/k, n/p, g/G) and directory diffs stay within the filtered set. - the active filter is shown in the search box with a pin icon - reopening `t` prefills the current filter so it can be edited; an empty query clears it - `esc` in normal mode clears the filter and keeps the cursor on the current file (an active diff search still takes `esc` first) - the filter survives watch-mode reloads, and is cleared if it no longer matches any file - remove the unused AcceptSuggestion `tab` binding from the search box (no suggestions were ever set)
This was referenced Nov 5, 2026
rod-stuchi
marked this pull request as ready for review
November 5, 2026 18:59
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Press
tabin thetfile search to switch it to sticky mode. Onenter, the file tree keeps only the matching files, so navigation (j/k,n/p,g/G) and directory diffs stay within the filtered set.tprefills the current filter so it can be edited; an empty query clears itescin normal mode clears the filter and keeps the cursor on the current file (an active diff search still takesescfirst)tabwas bound toAcceptSuggestionin the search box, but no suggestions are ever set, so that binding is removed andtabis reusedNo changes to the filetree package:
filetree.SetFilesis called with the filtered slice, so the existing navigation works on it as is.Related: #165 touches the same matching code; whichever lands second needs a small rebase.
How Did You Test this Change?
pkg/ui/tui_test.go: applying a sticky filter,nstaying within it, clearing withesc(cursor kept), plainenternot filtering, and the filter surviving aparsedDiffMsgreloadgo test ./...andgolangci-lintv2.12.2 (0 issues)go run . < examples/gh_dash_pr.diff:t→ query →tab→enterkeeps only the matches in the tree,j/kandn/pstay within them, reopeningtedits the filter, andescrestores the full treeAI Usage
Built with Claude Code (Claude Opus 5.5). I defined the behaviour (tab toggle inside
t,escto clear, prefill on reopen); Claude explored the codebase, wrote the implementation and tests, and I reviewed the diff and tested it manually.Images/Videos
ttyped 'section'tabenter