Skip to content

auth: search-as-you-type picker and visual distinction for action items#5222

Open
simonfaltum wants to merge 5 commits intomainfrom
simonfaltum/auth-picker-search-mode
Open

auth: search-as-you-type picker and visual distinction for action items#5222
simonfaltum wants to merge 5 commits intomainfrom
simonfaltum/auth-picker-search-mode

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

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

  • Existing unit tests for buildPickerItems and acceptance tests for auth switch / auth logout / auth token / auth login continue to pass.
  • ./task checks, ./task fmt-q, ./task lint-q are clean.
  • 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.

…/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
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 8, 2026 12:09 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 8, 2026 12:09 — with GitHub Actions Inactive
Base automatically changed from simonfaltum/auth-default-profile-picker to main May 8, 2026 12:22
…er-search-mode

# Conflicts:
#	NEXT_CHANGELOG.md
#	cmd/auth/profile_picker.go
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 8, 2026 12:26 — with GitHub Actions Inactive
@simonfaltum simonfaltum temporarily deployed to test-trigger-is May 8, 2026 12:26 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants