feat: add interactive file search/filter (feature #1)
Pressing / opens a filter bar at the bottom of the screen. As the user
types, the active pane's entries are filtered in real-time using
case-insensitive substring matching. The .. entry is always preserved.
Key bindings:
/ - open filter input (re-opens with previous query if active)
Esc - clear filter and restore full list
Enter - commit filter (keeps filtering active, closes input bar)
Up/Down - navigate the filtered list while typing
PgUp/Dn - scroll the filtered list
Filter is automatically cleared when navigating to a different directory
(Enter on a folder, Backspace to parent, opening an archive).
Modified files:
- internal/ui/keymap.go: added Filter key binding (/)
- internal/ui/model.go: filterMode, filterQuery, filterInput fields;
filteredPane() helper for View rendering; filter handling in Update();
renderFilterBar() for the bottom bar UI; clearFilter() helper;
adjustCursorForFilter() to keep cursor in bounds
Created files:
- plans/feature-roadmap.md
This commit is contained in:
parent
bba8783f10
commit
08c095e74f
3 changed files with 204 additions and 5 deletions
|
|
@ -24,6 +24,7 @@ type KeyMap struct {
|
|||
Open key.Binding
|
||||
Back key.Binding
|
||||
Switch key.Binding
|
||||
Filter key.Binding
|
||||
Refresh key.Binding
|
||||
DirSize key.Binding
|
||||
Copy key.Binding
|
||||
|
|
@ -57,6 +58,7 @@ func DefaultKeyMap() KeyMap {
|
|||
SelectDown: key.NewBinding(key.WithKeys("shift+down", "J"), key.WithHelp("S-↓/J", "select down")),
|
||||
PageUp: key.NewBinding(key.WithKeys("pgup"), key.WithHelp("PgUp", "page up")),
|
||||
PageDown: key.NewBinding(),
|
||||
Filter: key.NewBinding(key.WithKeys("/"), key.WithHelp("/", "filter")),
|
||||
Open: key.NewBinding(key.WithKeys("enter", "right"), key.WithHelp("Enter", "open")),
|
||||
Back: key.NewBinding(key.WithKeys("backspace", "left"), key.WithHelp("←", "parent")),
|
||||
Switch: key.NewBinding(key.WithKeys("tab", "h", "l"), key.WithHelp("Tab/h/l", "switch pane")),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue