Skip to content

Commit 3ad1ad3

Browse files
fix: improve confirm prompt button visibility in appkit theme (#4925)
## Summary - The Yes/No confirm buttons in `databricks apps init` inherited `ThemeBase` defaults (ANSI colors 0/7), making it very hard to tell which option was currently selected. - Style the focused button with bold yellow underlined text and the blurred button with dim adaptive gray, removing background rectangles for a cleaner text-only look. - Uses `lipgloss.AdaptiveColor` for the blurred button so it's legible on both light and dark terminals. ### After <img width="515" height="135" alt="image" src="https://github.com/user-attachments/assets/0de502e9-0786-468d-84ef-1ad032212622" /> ## Test plan - [ ] Run `databricks apps init` and verify the Yes/No confirm prompt clearly highlights the selected option with yellow bold underlined text - [ ] Test on both light and dark terminal backgrounds to confirm legibility Co-authored-by: MarioCadenas <MarioCadenas@users.noreply.github.com> Co-authored-by: simon <4305831+simonfaltum@users.noreply.github.com>
1 parent e8391f4 commit 3ad1ad3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

libs/apps/prompt/prompt.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var (
3131
colorGray = lipgloss.Color("#A1A1AA") // Light gray, legible on dark backgrounds
3232
colorYellow = lipgloss.Color("#FFAB00") // Databricks yellow / amber
3333
colorOrange = lipgloss.Color("#FF5F40") // Databricks orange (code blocks)
34+
colorDimmed = lipgloss.AdaptiveColor{Light: "#A1A1AA", Dark: "#52525B"}
3435
)
3536

3637
// AppkitTheme returns a custom theme for appkit prompts.
@@ -41,6 +42,19 @@ func AppkitTheme() *huh.Theme {
4142
t.Focused.Description = t.Focused.Description.Foreground(colorGray)
4243
t.Focused.SelectedOption = t.Focused.SelectedOption.Foreground(colorYellow)
4344
t.Focused.TextInput.Placeholder = t.Focused.TextInput.Placeholder.Foreground(colorGray)
45+
bracketBorder := lipgloss.Border{Left: "[", Right: "]"}
46+
t.Focused.FocusedButton = t.Focused.FocusedButton.
47+
Foreground(colorYellow).
48+
Background(lipgloss.Color("")).
49+
Bold(true).
50+
BorderStyle(bracketBorder).
51+
BorderLeft(true).BorderRight(true).
52+
BorderTop(false).BorderBottom(false).
53+
BorderForeground(colorYellow)
54+
t.Focused.BlurredButton = t.Focused.BlurredButton.
55+
Foreground(colorDimmed).
56+
Background(lipgloss.Color("")).
57+
Bold(false)
4458

4559
return t
4660
}

0 commit comments

Comments
 (0)