Description
Both Dashboard and HighContrast themes in getTheme() have nearly identical style definitions (~50 lines duplicated).
Location
main.go:182-238
Suggestion
Extract common styles into a base function:
func baseStyles() Theme {
return Theme{
HeaderPlan: lipgloss.NewStyle().Bold(true)...,
// ... common styles
}
}
func getTheme(mode RenderingMode) Theme {
t := baseStyles()
if mode == RenderingModeHighContrast {
// Override specific styles only
}
t.ErrorReplacer = createGuideReplacer(t.Error)
t.WarningReplacer = createGuideReplacer(t.Warning)
return t
}
Impact
- Easier maintenance
- Single source of truth for shared styles
- ~50 lines reduction
Created from code review of fix_errors_format_default branch
Description
Both Dashboard and HighContrast themes in
getTheme()have nearly identical style definitions (~50 lines duplicated).Location
main.go:182-238Suggestion
Extract common styles into a base function:
Impact
Created from code review of
fix_errors_format_defaultbranch