Skip to content

fix(repl): honor table column alignment in the TUI renderer (#143) - #145

Merged
justrach merged 1 commit into
mainfrom
fix/table-align-143
Jul 10, 2026
Merged

fix(repl): honor table column alignment in the TUI renderer (#143)#145
justrach merged 1 commit into
mainfrom
fix/table-align-143

Conversation

@justrach

Copy link
Copy Markdown
Owner

Closes #143.

renderTable skipped the separator row and always left-justified cells, so :--:/--: alignment was ignored in the terminal while the GUI's ChatTable honored it. Now the separator row is parsed into per-column TableAlign (left/center/right) and applied to header + data rows, matching the GUI (which aligns both <th> and <td>).

Verified: zig build · zig build repl-test 16/16 (new test asserts right-align pads left, center pads both sides, left stays flush).

🤖 Generated with Claude Code

renderTable skipped the separator row entirely and always left-justified
every cell, so `:--:`/`--:` alignment was ignored in the terminal while the
GUI's ChatTable honored it — the same markdown table rendered differently on
the two surfaces.

Parse the separator row (raw_rows[1]) into per-column TableAlign
(left/center/right from the leading/trailing `:`) and apply it when padding
cells — to the header and data rows, matching ChatTable which aligns both
<th> and <td>. Escaped-pipe splitting and the record fallback are unchanged.

Verified: zig build; zig build repl-test 16/16 (new test asserts right-align
pads left, center pads both sides, left stays flush).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@justrach
justrach merged commit 7bbe99e into main Jul 10, 2026
6 checks passed
@justrach
justrach deleted the fix/table-align-143 branch July 15, 2026 10:23
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.

REPL table renderer: column alignment (:--:/---:) ignored in the TUI

1 participant