Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: universal styled search filter with / key#274

Merged
clangenb merged 2 commits into
mainfrom
feat/universal-search-filter-271
Mar 9, 2026
Merged

feat: universal styled search filter with / key#274
clangenb merged 2 commits into
mainfrom
feat/universal-search-filter-271

Conversation

@eldara-cruncher
Copy link
Copy Markdown
Collaborator

@eldara-cruncher eldara-cruncher commented Mar 9, 2026

Summary

  • New views/searchinput/ component (styled search box matching the : command bar) that handles / filtering at the app level
  • Added Filterable interface — 7 views (stacks, services, nodes, contexts, secrets, configs, networks) implement it to receive search queries from the app-level search box
  • Views without Filterable (logs, inspect) keep their own / search handling unchanged; sub-lists (usedBy) retain FilterableList's internal ModeSearching
  • Footer shows compact (filtered) suffix instead of a dedicated filter line; ESC clears active filter on all views

Closes #271

Follow-up: #275 tracks migrating logs, inspect, and help views to the unified search box (phases 2–4).

Test plan

  • go build compiles
  • go test ./... — all unit tests pass (including 9 new searchinput tests)
  • golangci-lint run ./... — 0 issues
  • Manual: press / on stacks view → styled box appears, type query → list filters live, Enter → box closes but filter stays, Esc → filter clears
  • Manual: press / on logs view → view's own search activates (NOT the new search box)
  • Manual: press : while search box open → ignored; press / while command input open → ignored

🤖 Generated with Claude Code

Replace the plain footer-text filter UI with a styled search input box
(matching the `:` command bar) that works at the app level across all 7
filterable views (stacks, services, nodes, contexts, secrets, configs,
networks).

- New `views/searchinput/` component mirroring `commandinput/`
- `Filterable` interface in `views/view/interface.go` (opt-in via type assertion)
- App intercepts `/`, opens styled search box, routes SearchQueryMsg/SearchClearedMsg
- Views that don't implement Filterable (logs, inspect) keep their own `/` handling
- Sub-lists (usedBy, inspect) retain FilterableList's internal ModeSearching
- Footer now shows compact "(filtered)" suffix instead of a dedicated filter line
- ESC clears active filter on all 7 views when search box is closed

Closes #271

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@clangenb
Copy link
Copy Markdown
Collaborator

clangenb commented Mar 9, 2026

Nice, I can confirm that it works. However, I would like to see the term we are searching for after pressing enter. I suppose the easiest way would be to keep the search box visible, but maybe hint that we are not in the editing mode. Suggest a nice UX for this.

After confirming a search with Enter, the box stays visible with dimmed
styling instead of disappearing. Press `/` to resume editing, Esc to
clear and dismiss. Removes redundant `(filtered)` footer suffix.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown
Collaborator

@clangenb clangenb left a comment

Choose a reason for hiding this comment

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

Tested, LGTM!

@clangenb clangenb requested a review from mosonyi March 9, 2026 15:52
@mosonyi
Copy link
Copy Markdown
Collaborator

mosonyi commented Mar 9, 2026

I tested as well, really good. Can we extend this search UI to the search in logs?

@clangenb
Copy link
Copy Markdown
Collaborator

clangenb commented Mar 9, 2026

I tested as well, really good. Can we extend this search UI to the search in logs?

This is a follow up issue: #275

@clangenb clangenb merged commit 99000d9 into main Mar 9, 2026
11 checks passed
@eldara-cruncher eldara-cruncher deleted the feat/universal-search-filter-271 branch June 5, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Universal Filter with /

3 participants