-
Notifications
You must be signed in to change notification settings - Fork 147
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Objective
Improve table rendering throughout the codebase by adding conditional cell styling, responsive column widths, and improved visual feedback for status information.
Context
Issue #14013 identified opportunities to leverage advanced lipgloss/table features. Current tables use basic zebra striping but could benefit from status-based coloring and intelligent column sizing.
Approach
- Add conditional cell styling based on content (status colors)
- Implement responsive column width management
- Update
pkg/console/console.gotable rendering functions - Apply enhancements to key commands:
status,logs,audit
Implementation Details
Conditional Cell Styling
styleFunc := func(row, col int) lipgloss.Style {
// Status-based coloring for specific columns
if col == statusColumn {
cellValue := allRows[row][col]
if cellValue == "failed" {
return lipgloss.NewStyle().
Foreground(styles.ColorError).
Bold(true)
} else if cellValue == "success" {
return lipgloss.NewStyle().
Foreground(styles.ColorSuccess)
}
}
// Zebra striping for other cells
if row%2 == 0 {
return styles.TableCell.PaddingLeft(1).PaddingRight(1)
}
return lipgloss.NewStyle().
Foreground(styles.ColorForeground).
Background(styles.ColorTableAltRow).
PaddingLeft(1).PaddingRight(1)
}Responsive Width Management
t := table.New().
Headers(config.Headers...).
Rows(config.Rows...).
Border(styles.RoundedBorder).
BorderStyle(styles.TableBorder).
StyleFunc(styleFunc).
Width(getTerminalWidth()).
MaxWidth(120)Files to Modify
- Update:
pkg/console/console.go- Enhance table rendering functions - Update:
pkg/cli/status.go- Apply conditional styling for workflow status - Update:
pkg/cli/logs.go- Apply conditional styling for log entries - Update:
pkg/cli/audit.go- Apply conditional styling for audit results - Update:
pkg/console/console_test.go- Add tests for conditional styling
Acceptance Criteria
- Status values (success, failed, pending) have distinct colors
- Tables adjust width based on terminal size
- Column widths are intelligently distributed
- MaxWidth prevents tables from being too wide
- Zebra striping remains for non-status columns
- Accessibility mode disables fancy styling
- Tests validate conditional styling logic
- Tables remain readable in narrow terminals (80 columns)
Related to Terminal Stylist Analysis: Console Output Patterns in gh-aw #14013
AI generated by Plan Command for #14013
- expires on Feb 8, 2026, 1:01 AM UTC
Reactions are currently unavailable