Skip to content

feat: ANSI-safe aligned table rendering - #290

Merged
Patel230 merged 1 commit into
mainfrom
feat/ansi-safe-tables
Sep 7, 2026
Merged

feat: ANSI-safe aligned table rendering#290
Patel230 merged 1 commit into
mainfrom
feat/ansi-safe-tables

Conversation

@Patel230

@Patel230 Patel230 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds theme.PrintTable, a table renderer that computes column widths on ANSI-stripped visible width. text/tabwriter counts ANSI escape bytes as cell width, so any colored cell (header or value) shifts alignment — plugin status's existing colored header already misaligned.

Migrates six plain list tables to it (trust list, search, agent list, plugin status, plugin events, plugin marketplace list), giving them a consistent muted header that stays aligned under color.

Verification

  • go build ./..., go vet ./cmd/ ./internal/theme/, gofumpt -l clean.
  • go test ./... exit 0.
  • New TestPrintTable* unit tests cover alignment, color-not-breaking-alignment, short rows, empty header.
  • Smoke: env -u NO_COLOR FORCE_COLOR=1 graycode trust list shows muted colored header with correctly aligned columns.

Add theme.PrintTable, which computes column widths on ANSI-stripped visible
width so colored cells never break alignment (text/tabwriter counts escape
bytes as width). Migrate the plain list tables (trust list, search, agent
list, plugin status, plugin events, plugin marketplace list) to it, giving
them a consistent muted colored header and fixing the latent misalignment in
plugin status's already-colored header.
@Patel230
Patel230 merged commit bad3744 into main Sep 7, 2026
25 of 26 checks passed
@Patel230
Patel230 deleted the feat/ansi-safe-tables branch September 7, 2026 07:06
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.

1 participant