on main help sign in
chore(ui,styles): color edits and copyedits for the oAuth view
commit9c4a3162ec8bef5703d8920d442e373032567bc1 authorChristian Rocha <christian@rocha.is> dateMon 27 Apr 2026, 23:00 (6 months ago) parent8ebab21
3 files changed+28−27
internal/ui/dialog/oauth.go+17−17 internal/ui/styles/quickstyle.go+10−10 internal/ui/styles/themes.go+1
internal/ui/dialog/oauth.go+17−17
@@ -222,7 +222,7 @@ func (m *OAuth) headerContent() string {
222222 textStyle = t.Dialog.PrimaryText
223223 dialogStyle = t.Dialog.View.Width(m.width)
224224 headerOffset = titleStyle.GetHorizontalFrameSize() + dialogStyle.GetHorizontalFrameSize()
225− dialogTitle = fmt.Sprintf("Authenticate with %s", m.oAuthProvider.name())
225+ dialogTitle = fmt.Sprintf("Let’s authenticate with %s", m.oAuthProvider.name())
226226 )
227227 if m.isOnboarding {
228228 return textStyle.Render(dialogTitle)
@@ -232,13 +232,13 @@ func (m *OAuth) headerContent() string {
232232
233233func (m *OAuth) innerDialogContent() string {
234234 var (
235− t = m.com.Styles
236− whiteStyle = t.Dialog.OAuth.Instructions
237− primaryStyle = t.Dialog.OAuth.Enter
238− greenStyle = t.Dialog.OAuth.Success
239− linkStyle = t.Dialog.OAuth.Link
240− errorStyle = t.Dialog.OAuth.ErrorText
241− mutedStyle = t.Dialog.OAuth.StatusText
235+ t = m.com.Styles
236+ instructionStyle = t.Dialog.OAuth.Instructions
237+ enterKeyStyle = t.Dialog.OAuth.Enter
238+ successStyle = t.Dialog.OAuth.Success
239+ linkStyle = t.Dialog.OAuth.Link
240+ errorStyle = t.Dialog.OAuth.ErrorText
241+ statusTextStyle = t.Dialog.OAuth.StatusText
242242 )
243243
244244 switch m.State {
@@ -248,8 +248,8 @@ func (m *OAuth) innerDialogContent() string {
248248 Width(m.width - 2).
249249 Align(lipgloss.Center).
250250 Render(
251− greenStyle.Render(m.spinner.View()) +
252− mutedStyle.Render("Initializing..."),
251+ successStyle.Render(m.spinner.View()) +
252+ statusTextStyle.Render("Initializing..."),
253253 )
254254
255255 case OAuthStateDisplay:
@@ -257,9 +257,9 @@ func (m *OAuth) innerDialogContent() string {
257257 Margin(0, 1).
258258 Width(m.width - 2).
259259 Render(
260− whiteStyle.Render("Press ") +
261− primaryStyle.Render("enter") +
262− whiteStyle.Render(" to copy the code below and open the browser."),
260+ instructionStyle.Render("Press ") +
261+ enterKeyStyle.Render("enter") +
262+ instructionStyle.Render(" to copy the code below and open the browser."),
263263 )
264264
265265 codeBox := lipgloss.NewStyle().
@@ -273,16 +273,16 @@ func (m *OAuth) innerDialogContent() string {
273273 )
274274
275275 link := linkStyle.Hyperlink(m.verificationURL, "id=oauth-verify").Render(m.verificationURL)
276− url := mutedStyle.
276+ url := statusTextStyle.
277277 Margin(0, 1).
278278 Width(m.width - 2).
279− Render("Browser not opening? Refer to\n" + link)
279+ Render("Browser not opening? Pay a visit to:\n" + link)
280280
281281 waiting := lipgloss.NewStyle().
282282 Margin(0, 1).
283283 Width(m.width - 2).
284284 Render(
285− greenStyle.Render(m.spinner.View()) + mutedStyle.Render("Verifying..."),
285+ successStyle.Render(m.spinner.View()) + statusTextStyle.Render("Verifying..."),
286286 )
287287
288288 return lipgloss.JoinVertical(
@@ -299,7 +299,7 @@ func (m *OAuth) innerDialogContent() string {
299299 )
300300
301301 case OAuthStateSuccess:
302− return greenStyle.
302+ return successStyle.
303303 Margin(1).
304304 Width(m.width - 2).
305305 Render("Authentication successful!")
internal/ui/styles/quickstyle.go+10−10
@@ -14,13 +14,14 @@ import (
1414 "github.com/charmbracelet/x/exp/charmtone"
1515)
1616
17−// quickStyleOpts is the palette of colors used by quickStyle to build a
18−// complete Styles value. Each field maps to a semantic role in the UI.
17+// quickStyleOpts is the palette of colors used by quickStyle to simplify the
18+// process of building a theme.
1919type quickStyleOpts struct {
2020 // Brand.
2121 primary color.Color
2222 secondary color.Color
2323 accent color.Color
24+ keyword color.Color
2425
2526 // Default foreground and background colors.
2627 fgBase color.Color
@@ -55,12 +56,11 @@ type quickStyleOpts struct {
5556 successMostSubtle color.Color
5657}
5758
58−// quickStyle builds a complete Styles value from a palette of semantic
59−// colors. Themes should populate quickStyleOpts and call this rather than
60−// re-implementing every style rule.
59+// quickStyle builds the default Styles (that is, the default theme, Charmtone
60+// Pantera) from a palette of semi-semanticly-named colors.
6161//
62−// The idea here is that you can do most of the work with quickStyle, then
63−// add overrides as needed.
62+// The idea here is that you can do most of the work on a theme with quickStyle,
63+// then add overrides as needed.
6464func quickStyle(o quickStyleOpts) Styles {
6565 var (
6666 base = lipgloss.NewStyle().Foreground(o.fgBase)
@@ -863,11 +863,11 @@ func quickStyle(o quickStyleOpts) Styles {
863863
864864 // OAuth dialog
865865 s.Dialog.OAuth.Spinner = base.Foreground(o.successMoreSubtle)
866− s.Dialog.OAuth.Instructions = lipgloss.NewStyle().Foreground(o.primary)
867− s.Dialog.OAuth.UserCode = lipgloss.NewStyle().Bold(true).Foreground(o.primary)
866+ s.Dialog.OAuth.Instructions = lipgloss.NewStyle().Foreground(o.fgBase)
867+ s.Dialog.OAuth.UserCode = lipgloss.NewStyle().Bold(true).Foreground(o.fgBase)
868868 s.Dialog.OAuth.Success = lipgloss.NewStyle().Foreground(o.successMoreSubtle)
869869 s.Dialog.OAuth.Link = lipgloss.NewStyle().Foreground(o.successMostSubtle).Underline(true)
870− s.Dialog.OAuth.Enter = lipgloss.NewStyle().Foreground(o.primary)
870+ s.Dialog.OAuth.Enter = lipgloss.NewStyle().Foreground(o.keyword)
871871 s.Dialog.OAuth.ErrorText = lipgloss.NewStyle().Foreground(o.error)
872872 s.Dialog.OAuth.StatusText = lipgloss.NewStyle().Foreground(o.fgMoreSubtle)
873873 s.Dialog.OAuth.UserCodeBg = o.bgLeastVisible
internal/ui/styles/themes.go+1
@@ -21,6 +21,7 @@ func CharmtonePantera() Styles {
2121 primary: charmtone.Charple,
2222 secondary: charmtone.Dolly,
2323 accent: charmtone.Bok,
24+ keyword: charmtone.Blush,
2425
2526 fgBase: charmtone.Ash,
2627 fgMoreSubtle: charmtone.Squid,