TUI: ignore surrounding whitespace when searching secret names
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
The filter lives in TuiApp::apply_filter() in crates/cli/src/tui/app.rs, where the empty check uses the trimmed query but matching uses the raw search_query. Read the existing filtering test near the in-memory fixtures in that file and add cases for leading/trailing, mixed-case, whitespace-only and internal-space queries. Done when cargo test -p sotto-cli --lib tui passes and the matched names are asserted, with search_query itself left unchanged.
Written by the indexing model from the issue text.
Description
The problem
The web vault trims surrounding whitespace before searching secret names. The terminal dashboard does not: TuiApp::apply_filter() trims the query only to detect an empty search, then uses the untrimmed query for non-empty matching.
This means data and data have different matching semantics in the dashboard, while both are equivalent in the web vault. Make surrounding whitespace insignificant for TUI search too, so an accidentally typed leading or trailing space does not hide otherwise matching names.
This is a small usability enhancement, not a change to stored secret names.
Acceptance criteria
- Use the trimmed query for case-insensitive TUI substring matching. Queries such as
data,data,dataandDATAreturn the same matching names. - Preserve the user's editable
search_querytext; normalise only the value used for matching so typing and Backspace remain predictable. - Preserve spaces inside a query rather than removing all whitespace. For example,
DA TAmust not becomeDATA. - Empty and whitespace-only searches continue to show the full list. Existing no-match handling, selection bounds and reveal/cache reset behaviour remain intact.
- Extend the existing filtering tests with leading/trailing whitespace, mixed case, whitespace-only and internal-space cases. Assert matching names rather than only result counts.
- Run
cargo test -p sotto-cli --lib tuiandcargo fmt --all --check.
Keep the scope to query normalisation and regression tests. Do not trim or rename stored secrets, change the web implementation, add fuzzy matching or change keyboard/mouse navigation.
Starting points
Evidence and scope
Source inspected on clean main e8ef823cedae31a1b4e435752bcb5e7485ecc69a. The TUI uses self.search_query.trim().is_empty() for the empty branch but self.search_query.to_lowercase() for matching. The web uses secretQuery.trim().toLocaleLowerCase(). Existing TUI filtering tests cover ordinary matching and no results, but not surrounding whitespace.
This is a source-verified behavioural difference and a proposed consistency improvement. The Rust binary was not built or run for this report, and no hands-on terminal reproduction is claimed.
Checked open and closed issues and open PRs. #793 covers mouse selection of filtered results, while this issue only changes how the search query is normalised. It is unrelated to #465 / PR #469, which concerns preserving secret identity while editing.
Suitable for a first contribution: a bounded Rust change with existing deterministic in-memory test fixtures. Follow CONTRIBUTING.md, use British English, and sign off commits with git commit -s.
- Dominant language
- Rust
- Stars
- 31
- Forks
- 42
- Avg merge
- 3d 21m
- Merged PRs (30d)
- 147
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsotto/sotto
-
Backups are staleOpenbackup-alert
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Web: show when a pending email verification request expiresPossibly taken @manosm19-netizen claimed this today. Openenhancement good first issue help wanted
Difficulty 2/5 Half a day Newbie friendliness 72/100
getsotto/sotto#827 · 1 comment ·
Maintainers usually reply within 1 day
-
TUI tests: verify binary secret edit rejection preserves stored bytesPossibly taken @dbdefault claimed this today. Opengood first issue help wanted test-coverage
Difficulty 2/5 3-5 days Newbie friendliness 62/100
getsotto/sotto#825 · 2 comments ·
Maintainers usually reply within 1 day
-
Docs: explain listing secret names and the ls JSON outputPossibly taken @Mohamedajab claimed this today. Opendocumentation good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openfootmanager/openfootmanager#1365 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 1-3 hours Newbie friendliness 90/100
JackMechem/marbble#305 ·
Maintainers usually reply within 1 day
-
ci:stability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 5 days
-
antora bug review-2026-11-11
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bovinemagnet/AdocFoundry#546 ·
Maintainers usually reply within 1 day