Skip to content

[WIP] [plan] Enhance table rendering with conditional styling and responsive widths#14368

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-9919-1036865607-24c63904-3836-4cec-a28b-0ad4fb61f86a
Closed

[WIP] [plan] Enhance table rendering with conditional styling and responsive widths#14368
Copilot wants to merge 1 commit intomainfrom
copilot/fix-9919-1036865607-24c63904-3836-4cec-a28b-0ad4fb61f86a

Conversation

Copy link
Contributor

Copilot AI commented Feb 7, 2026

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Enhance table rendering with conditional styling and responsive widths</issue_title>
<issue_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

  1. Add conditional cell styling based on content (status colors)
  2. Implement responsive column width management
  3. Update pkg/console/console.go table rendering functions
  4. 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

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Enhance table rendering with conditional styling and responsive widths

2 participants