Skip to content

Comments

Refactor table rendering to use consistent console.RenderTable formatting#92

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-91
Aug 18, 2025
Merged

Refactor table rendering to use consistent console.RenderTable formatting#92
pelikhan merged 3 commits intomainfrom
copilot/fix-91

Conversation

Copy link
Contributor

Copilot AI commented Aug 18, 2025

The GitHub CLI extension gh-aw was using manual table formatting with fixed-width columns and manual separators in its CLI commands, which looked inconsistent compared to GitHub CLI's professional appearance. This PR refactors the table rendering to use the existing console.RenderTable system that provides GitHub CLI-style formatting with TTY-aware styling, dynamic column sizing, and professional headers.

Changes Made

Before (Manual formatting)

ID              Display Name         Status       MCP      HTTP Transport
--              ------------         ------       ---      -------------
claude          Claude Code          Stable       Yes      Yes         
codex           Codex                Experimental Yes      No          

After (Professional table rendering)

Available Agentic Engines
                         
ID     | Display Name | Status       | MCP | HTTP Transport
------ | ------------ | ------------ | --- | --------------
claude | Claude Code  | Stable       | Yes | Yes           
codex  | Codex        | Experimental | Yes | No            

Technical Implementation

  1. Replaced manual table formatting in listAgenticEngines function (lines 160-164) that used fixed-width printf statements with console.TableConfig structure
  2. Replaced manual table formatting in StatusWorkflows function (lines 1102-1103) with similar professional rendering
  3. Maintained all existing functionality including verbose/non-verbose modes and all status information
  4. Applied consistent styling with TTY-aware colors, dynamic column sizing, and professional separators

The implementation uses the existing console.RenderTable function with TableConfig that includes:

  • Dynamic column width calculation based on content
  • Professional header styling with TTY detection
  • Consistent formatting across all CLI commands
  • Better visual alignment and readability

Testing

  • All existing tests continue to pass
  • Added new tests for verbose table rendering functionality
  • Manual testing confirms visual consistency with GitHub CLI commands like gh run list
  • Code formatting and linting validation complete

The table rendering now provides a professional appearance consistent with GitHub CLI standards while preserving all existing functionality.

Fixes #91.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.contoso.com
    • Triggering command: /tmp/go-build3083132726/b270/cli.test -test.testlogfile=/tmp/go-build3083132726/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build2112566358/b270/cli.test -test.testlogfile=/tmp/go-build2112566358/b270/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)
    • Triggering command: /tmp/go-build446760869/b001/cli.test -test.testlogfile=/tmp/go-build446760869/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 18, 2025 16:06
…ting

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] [copilot] consistent table rendering Refactor table rendering to use consistent console.RenderTable formatting Aug 18, 2025
Copilot AI requested a review from pelikhan August 18, 2025 16:09
@pelikhan pelikhan marked this pull request as ready for review August 18, 2025 16:25
@pelikhan pelikhan requested a review from dsyme August 18, 2025 16:32
@pelikhan pelikhan merged commit f0e1f33 into main Aug 18, 2025
6 checks passed
@pelikhan pelikhan deleted the copilot/fix-91 branch August 18, 2025 20:41
pelikhan added a commit that referenced this pull request Sep 6, 2025
* Add --no-emit flag and Agent Cook workflow for generating agentic workflows (#92)

* Initial plan

* Add --no-emit flag and agent-cook workflow

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Address PR feedback: Remove write permissions, use XML tags for specifications, add code blocks in PR template, and reference instructions

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Update XML formatting and strengthen safe-outputs guidance

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Add turn count extraction and display to logs command (#91)

* Initial plan

* Add turn count extraction and display to logs command

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

* Fix Codex turn counting pattern matching for exec and tool commands

* Format and lint code according to project standards

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
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.

[copilot] consistent table rendering

2 participants