auth: search-as-you-type picker and visual distinction for action items#5222
Merged
Conversation
…/switch/token The interactive profile pickers shown by `databricks auth switch`, `databricks auth logout`, `databricks auth token`, and `databricks auth login` now mark the default profile with a "[default]" tag and move it to the top of the list. The pickers used by login/token are identical (with "Create a new profile" and "Enter a host URL manually" entries), and the pickers used by switch/logout share a common implementation. Co-authored-by: Isaac
…onfig - pickAuthProfile gains a SelectedNoun option so logout prints "Selected profile" and switch prints "Default profile" while token and login keep "Using profile". - auth login now shows the picker even when no profiles are configured, so a first-time user can pick web-based discovery (Create a new profile) or a manual host URL from the start. The label adapts to "How would you like to log in?" in the empty-config case. Co-authored-by: Isaac
…ult-profile-picker # Conflicts: # NEXT_CHANGELOG.md
- The auth profile picker now always starts in search mode, so typing immediately filters the list. The highlighted item is the top match, effectively suggesting which profile to pick. - Action entries (Create a new profile, Enter a host URL manually) are rendered as faint text with "+" / "→" prefixes and no host/account suffix so the eye reads "profiles above, actions below" without a literal separator. - Action entries are kept visible regardless of the search query so the user can always reach them, including when no profile matches. Co-authored-by: Isaac
…er-search-mode # Conflicts: # NEXT_CHANGELOG.md # cmd/auth/profile_picker.go
mihaimitrea-db
approved these changes
May 8, 2026
denik
pushed a commit
that referenced
this pull request
May 20, 2026
…ms (#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.
TanishqDatabricks
pushed a commit
to TanishqDatabricks/cli
that referenced
this pull request
May 22, 2026
…ms (databricks#5222) Stacked on top of databricks#5218. ## Why Two follow-up refinements after the picker rework in databricks#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.
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.
Stacked on top of #5218.
Why
Two follow-up refinements after the picker rework in #5218:
/to type-to-filter, which most people don't know.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:
+/→prefixes and no host/account suffix, so the list visually reads "profiles above, actions below" without needing a literal separator.+ Create a new profileor→ Enter a host URL manuallyfrom the same screen.Test plan
buildPickerItemsand acceptance tests forauth switch/auth logout/auth token/auth logincontinue to pass../task checks,./task fmt-q,./task lint-qare clean.This pull request and its description were written by Isaac.