Skip to content

[copilot] consistent table rendering #91

@pelikhan

Description

@pelikhan

The GitHub CLI extension gh-aw currently uses manual table formatting with fixed-width columns in its CLI commands, but it should use consistent table styling that matches the GitHub CLI's professional appearance. The codebase already has a complete table rendering system in pkg/console/console.go (RenderTable function with TableConfig) that implements GitHub CLI-style formatting with TTY-aware styling, dynamic column sizing, and professional headers. However, current CLI commands in pkg/cli/commands.go are using manual fmt.Printf statements instead of this existing table system.

Your task is to refactor the table rendering in the gh-aw CLI to achieve consistency with GitHub CLI commands like 'gh runs list'. Specifically:

Replace the manual table formatting in the ListWorkflows function (lines 160-164 in pkg/cli/commands.go) that currently uses fixed-width printf statements with dashes for separators
Replace the manual table formatting in the StatusWorkflows function (lines 1102-1103 in pkg/cli/commands.go) with similar manual printf patterns
Use the existing console.RenderTable function with TableConfig instead of manual formatting
Ensure the resulting tables have dynamic column sizing, TTY-aware colors and styling, and professional appearance consistent with GitHub CLI
The existing RenderTable system in pkg/console/console.go provides all necessary functionality including automatic column width calculation, professional header styling, TTY detection, and consistent formatting. The implementation should be a straightforward refactor replacing manual fmt.Printf calls with console.TableConfig structures and console.RenderTable function calls.

After implementation, test the output by comparing 'gh-aw list' and 'gh-aw status' commands with GitHub CLI commands like 'gh run list' to ensure visual consistency in spacing, alignment, colors, and overall presentation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions