Skip to content

[plan] Refactor gateway_logs.go manual ASCII table to use console.RenderTable #21176

@github-actions

Description

@github-actions

Objective

Replace the manual Unicode box-drawing ASCII table in pkg/cli/gateway_logs.go with console.RenderTable(TableConfig{...}) to gain adaptive colors, TTY-aware rendering, and consistent border styling.

Context

Identified in the Terminal Stylist audit (discussion #21126). The file currently builds tables manually using Unicode box-drawing characters and fmt.Fprintf column alignment (~40 lines). This should be refactored to use the existing console.RenderTable infrastructure.

File to Modify

pkg/cli/gateway_logs.go — Manual ASCII table rendering (20-40 lines)

Current pattern (approximate):

var sb strings.Builder
sb.WriteString("┌──────────┬──────────┐\n")
sb.WriteString(fmt.Sprintf("│ %-8s │ %-8s │\n", col1, col2))
// ... more manual box-drawing ...
fmt.Fprintf(os.Stderr, sb.String())

Target pattern:

fmt.Fprintln(os.Stderr, console.RenderTable(console.TableConfig{
    Headers: []string{"Column1", "Column2"},
    Rows:    [][]string{...},
}))

Approach

  1. Inspect pkg/cli/gateway_logs.go to identify the full extent of manual table rendering
  2. Review console.RenderTable signature and TableConfig fields in pkg/console/
  3. Identify the table data (headers, rows) being rendered manually
  4. Replace the manual rendering with console.RenderTable(TableConfig{...})
  5. Also fix any remaining raw fmt.Fprintf(os.Stderr, ...) calls in the file with appropriate console formatters
  6. Run make fmt && make test-unit to validate

Acceptance Criteria

  • Manual Unicode box-drawing table code removed from gateway_logs.go
  • Table rendered using console.RenderTable(TableConfig{...})
  • All remaining raw fmt.Fprintf(os.Stderr, ...) in the file replaced with console formatters
  • Visual output is equivalent (same columns and data)
  • make fmt passes with no changes
  • make test-unit passes

Generated by Plan Command for issue #discussion #21126 ·

  • expires on Mar 18, 2026, 5:12 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions