Commit dec925d
authored
auth: fix stale host prompt renders by shortening the prompt label (#5244)
## Why
In `databricks auth login`, after selecting `→ Enter a host URL
manually`, typing or pasting a workspace URL would leave the prompt
visibly stuck on screen — the same `✔ Databricks host …` line stacked up
many times before the next prompt appeared. Functionally everything
still worked, but the picker output looked broken.
## Changes
**Before:** The prompt label was
```
Databricks host (e.g. https://<databricks-instance>.cloud.databricks.com):
```
which is ~75 characters before the user even types anything. Once the
value pushed the line past the terminal width, promptui's `screenbuf`
(which only tracks logical lines, not wrapped physical lines) failed to
clear the previous render on each keystroke, and stale copies stacked
up.
**Now:** The example is printed once on its own line above the prompt
and the prompt label is just `Databricks host`. With a realistic
workspace URL the whole line stays well under 80 characters and never
wraps in normal terminals.
```
Example: https://<databricks-instance>.cloud.databricks.com
✔ Databricks host: https://dogfood.staging.databricks.com/?o=60519214█
```
## Test plan
- [x] Reproduced the bug locally with a 100-col terminal and a typical
workspace URL.
- [x] Verified the fix with the same URL: prompt renders on a single
line, no stale duplicates.
- [x] `./task fmt-q`, `./task lint-q`, `./task checks` clean.
- [x] `go test ./cmd/auth/...` passes.1 parent 3e4cf68 commit dec925d
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | | - | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
| |||
0 commit comments