Commit 8568caa
authored
auth: search-as-you-type picker and visual distinction for action items (#5222)
Stacked on top of #5218.
## Why
Two follow-up refinements after the picker rework in #5218:
1. The picker only entered search mode automatically when there were
more than 5 profiles. For smaller lists the user had to press `/` to
type-to-filter, which most people don't know.
2. The action entries (`Create a new profile`, `Enter a host URL
manually`) sat in the list visually identical to real profiles, even
though they're functionally different.
## Changes
**Before:** Typing in the picker only filtered the list when
`len(profiles) > 5`. Action items rendered the same as profiles.
**Now:**
- Picker always starts in search mode, so typing immediately filters the
list. The cursor stays on the top remaining match — Enter takes that
one. This is the "type, options shrink, top match is the suggestion" UX.
- Action items render as faint text with `+` / `→` prefixes and no
host/account suffix, so the list visually reads "profiles above, actions
below" without needing a literal separator.
- The searcher always returns true for action entries, so they stay
visible no matter what the user types. If the typed query matches
nothing, the user can still pick `+ Create a new profile` or `→ Enter a
host URL manually` from the same screen.
## Test plan
- [x] Existing unit tests for `buildPickerItems` and acceptance tests
for `auth switch` / `auth logout` / `auth token` / `auth login` continue
to pass.
- [x] `./task checks`, `./task fmt-q`, `./task lint-q` are clean.
- [x] Built locally and exercised the picker manually with 1, 3, and 8
profiles to confirm the search field is always visible and the action
entries always appear in the filtered list.
This pull request and its description were written by Isaac.1 parent 4bba7bd commit 8568caa
2 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
125 | | - | |
126 | | - | |
| 131 | + | |
| 132 | + | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
| |||
0 commit comments