Skip to content

fix(cli): align table columns by display width - #1608

Draft
Chase J (chajac) wants to merge 1 commit into
mainfrom
chajac/list-unicode-widths
Draft

Chase J (chajac) wants to merge 1 commit into
mainfrom
chajac/list-unicode-widths

Conversation

@chajac

@chajac Chase J (chajac) commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Overview of Changes

Tables can misalign when text contains wide characters or combining marks. This change measures terminal display width when it pads columns. The existing fast-string-width package supplies the measurements.

Base: main.

Testing

Naming, lint, format, type, unused-code, and build checks passed. The full test suite passed: 2,485 tests, no failures.

bash scripts/check-naming.sh
bun run typecheck
bun run lint --max-warnings 0
bun run format:check
bun run knip
bun run test
bun run build

Tests cover ASCII text, wide characters, emoji, combining marks, and terminal color codes.

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Essentials

Run ID: b8fdba96-7df9-43e0-b18f-bae85940ee3d

📥 Commits

Reviewing files that changed from the base of the PR and between 02bc628 and 5d22b52.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .changeset/table-display-width.md
  • package.json
  • src/core/displayWidth.test.ts
  • src/core/displayWidth.ts
  • src/core/renderTable.test.ts
  • src/core/renderTable.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.


Walkthrough

The CLI adds displayWidth and padColumns helpers backed by fast-string-width. renderTable uses these helpers to measure headers and cells and to add display-column padding. Tests cover CJK characters, combining marks, emoji, symbols, ANSI styling, and column alignment. A patch changeset documents the table alignment update.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Unblocks: 5 PRs

Suggested reviewers: theonly1me

Merge Risk: ⚪ Minimal · up to 5d22b

The table renderer now uses display-column width for Unicode and ANSI-styled values, with focused helper and rendering coverage. No merge-blocking issue remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits format, uses the allowed fix(cli) scope, uses imperative wording, clearly describes the display-width alignment change, and is under 72 characters.
Description check ✅ Passed The description includes the required overview, testing details, verification commands, and completed checklist. It clearly explains the display-width alignment change and reports test coverage and re…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chajac/list-unicode-widths

Comment @coderabbitai help to get the list of available commands.

@chajac
Chase J (chajac) added this pull request to stack #1614 September 14, 2026 11:03
@chajac
Chase J (chajac) force-pushed the chajac/list-unicode-widths branch from 5d22b52 to e746617 Compare September 16, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant