Skip to content

Commit dfa60fa

Browse files
authored
Extract inline lipgloss styles and harden ShowWelcomeBanner styling (#39246)
1 parent 8aa0aaa commit dfa60fa

4 files changed

Lines changed: 41 additions & 7 deletions

File tree

pkg/cli/compile_schedule_calendar.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,20 @@ func intensityChar(count int) string {
200200
func intensityStyle(count int, isTerminal bool) lipgloss.Style {
201201
if !isTerminal {
202202
// Keep glyph rendering unchanged while preventing ANSI escapes in piped output.
203-
return lipgloss.NewStyle()
203+
return lipgloss.Style{}
204204
}
205205

206206
switch {
207207
case count == 0:
208-
return lipgloss.NewStyle().Foreground(styles.ColorComment)
208+
return styles.ScheduleCalendarEmpty
209209
case count == 1:
210-
return lipgloss.NewStyle().Foreground(styles.ColorInfo)
210+
return styles.ScheduleCalendarLow
211211
case count <= 3:
212-
return lipgloss.NewStyle().Foreground(styles.ColorSuccess)
212+
return styles.ScheduleCalendarMedium
213213
case count <= 6:
214-
return lipgloss.NewStyle().Foreground(styles.ColorWarning)
214+
return styles.ScheduleCalendarHigh
215215
default:
216-
return lipgloss.NewStyle().Bold(true).Foreground(styles.ColorError)
216+
return styles.ScheduleCalendarCritical
217217
}
218218
}
219219

pkg/console/terminal.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"os"
66

7+
"github.com/github/gh-aw/pkg/styles"
78
"github.com/github/gh-aw/pkg/tty"
89
)
910

@@ -39,8 +40,12 @@ func ClearLine() {
3940
// Use this at the start of interactive commands (add, trial, init) for a consistent experience.
4041
func ShowWelcomeBanner(description string) {
4142
ClearScreen()
43+
header := "🚀 Welcome to GitHub Agentic Workflows!"
44+
if tty.IsStderrTerminal() {
45+
header = styles.Header.Render(header)
46+
}
4247
fmt.Fprintln(os.Stderr, "")
43-
fmt.Fprintln(os.Stderr, "🚀 Welcome to GitHub Agentic Workflows!")
48+
fmt.Fprintln(os.Stderr, header)
4449
fmt.Fprintln(os.Stderr, "")
4550
fmt.Fprintln(os.Stderr, description)
4651
fmt.Fprintln(os.Stderr, "")

pkg/styles/theme.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,26 @@ var TreeEnumerator = lipgloss.NewStyle().
347347
// TreeNode style for tree node content
348348
var TreeNode = lipgloss.NewStyle().
349349
Foreground(ColorForeground)
350+
351+
// Schedule calendar intensity styles for the heatmap renderer
352+
353+
// ScheduleCalendarEmpty style for zero-trigger slots - muted
354+
var ScheduleCalendarEmpty = lipgloss.NewStyle().
355+
Foreground(ColorComment)
356+
357+
// ScheduleCalendarLow style for low-intensity calendar slots - cyan
358+
var ScheduleCalendarLow = lipgloss.NewStyle().
359+
Foreground(ColorInfo)
360+
361+
// ScheduleCalendarMedium style for medium-intensity calendar slots - green
362+
var ScheduleCalendarMedium = lipgloss.NewStyle().
363+
Foreground(ColorSuccess)
364+
365+
// ScheduleCalendarHigh style for high-intensity calendar slots - orange
366+
var ScheduleCalendarHigh = lipgloss.NewStyle().
367+
Foreground(ColorWarning)
368+
369+
// ScheduleCalendarCritical style for critical-intensity calendar slots - bold red
370+
var ScheduleCalendarCritical = lipgloss.NewStyle().
371+
Bold(true).
372+
Foreground(ColorError)

pkg/styles/theme_wasm.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,10 @@ var (
8181
Header = WasmStyle{}
8282
TreeEnumerator = WasmStyle{}
8383
TreeNode = WasmStyle{}
84+
85+
ScheduleCalendarEmpty = WasmStyle{}
86+
ScheduleCalendarLow = WasmStyle{}
87+
ScheduleCalendarMedium = WasmStyle{}
88+
ScheduleCalendarHigh = WasmStyle{}
89+
ScheduleCalendarCritical = WasmStyle{}
8490
)

0 commit comments

Comments
 (0)