diff --git a/AGENTS.md b/AGENTS.md index 67be37243c634d11b4fbb47b382722958b2a41db..6111ed3e386ca0f8055d47b8761c066ef3eff9a2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -209,6 +209,9 @@ Use `cmd.OutOrStdout()` and `cmd.ErrOrStderr()` for testability. Styles are in `internal/ui/styles.go`—use `ui.Success`, `ui.Error`, etc. rather than inline colors. +**Accessibility**: Avoid dim text (ANSI color 8)—it's unreadable in many terminal +color schemes. Use italic or other formatting for de-emphasized text instead. + ## Testing Table-driven tests with `t.Parallel()`. Use `_test` package suffix for black-box diff --git a/cmd/area/list.go b/cmd/area/list.go index 4cef09f0631b5528f1c77752ed65cedcfab4b1da..e634763a4cb3261e30392c77d199db0e851d2a91 100644 --- a/cmd/area/list.go +++ b/cmd/area/list.go @@ -63,9 +63,14 @@ func outputJSON(cmd *cobra.Command, areas []config.Area) error { func outputTable(cmd *cobra.Command, areas []config.Area) error { rows := make([][]string, 0, len(areas)) + truncated := false for _, area := range areas { - goals := formatGoals(area.Goals) + goals, wasTruncated := formatGoals(area.Goals) + if wasTruncated { + truncated = true + } + rows = append(rows, []string{area.Key, area.Name, goals}) } @@ -83,12 +88,16 @@ func outputTable(cmd *cobra.Command, areas []config.Area) error { fmt.Fprintln(cmd.OutOrStdout(), tbl.Render()) + if truncated { + fmt.Fprintln(cmd.OutOrStdout(), ui.Hint.Render("(+N) = more goals; run 'lune goal list -a AREA' to see all")) + } + return nil } -func formatGoals(goals []config.Goal) string { +func formatGoals(goals []config.Goal) (string, bool) { if len(goals) == 0 { - return "-" + return "-", false } keys := make([]string, len(goals)) @@ -97,10 +106,10 @@ func formatGoals(goals []config.Goal) string { } if len(keys) <= 3 { - return joinKeys(keys) + return joinKeys(keys), false } - return joinKeys(keys[:3]) + fmt.Sprintf(" (+%d)", len(keys)-3) + return joinKeys(keys[:3]) + fmt.Sprintf(" (+%d)", len(keys)-3), true } func joinKeys(keys []string) string { diff --git a/internal/ui/styles.go b/internal/ui/styles.go index 1cd984e86cfcd3674cf20a57ada97099c66af49f..cc2b39579cb4fcde9288b71485f1b8a3fba71029 100644 --- a/internal/ui/styles.go +++ b/internal/ui/styles.go @@ -42,6 +42,7 @@ var ( Warning = Style{lipgloss.NewStyle().Foreground(lipgloss.Color("3"))} // yellow Error = Style{lipgloss.NewStyle().Foreground(lipgloss.Color("1"))} // red Bold = Style{lipgloss.NewStyle().Bold(true)} + Hint = Style{lipgloss.NewStyle().Italic(true)} ) // Heading styles with backgrounds for contrast on any theme.