Skip to content

Fix mixed-language table alignment for 2.1.1 - #12

Merged
ShawnBaek merged 2 commits into
masterfrom
agent/fix-mixed-language-table-alignment-2-1-1
Jul 19, 2026
Merged

Fix mixed-language table alignment for 2.1.1#12
ShawnBaek merged 2 commits into
masterfrom
agent/fix-mixed-language-table-alignment-2-1-1

Conversation

@ShawnBaek

Copy link
Copy Markdown
Owner

Summary

  • render terminal cells with one space of left and right padding
  • keep the header separator while removing separators between ordinary data rows
  • calculate mixed CJK, Hangul, and emoji presentation widths consistently
  • add exact ASCII and Unicode output tests for English, Chinese, Korean, and mixed scripts within a single value
  • update README examples to match the new command-line table layout

Why

Unicode grapheme count does not always equal terminal display width. CJK and Hangul characters occupy two terminal columns, while emoji presentation selectors can change a symbol from one column to two. The renderer also drew borders from content widths without accounting for cell padding, which could make mixed-language tables appear misaligned.

Impact

Existing print(...), TableStyle, TableSpacing, and Logger.table(...) APIs are unchanged. Only rendered table formatting and width handling change.

Version

Target release: 2.1.1. SwiftPM package versions are Git-tag based, so the merged commit should be tagged 2.1.1 to publish the version.

Validation

  • 58 Swift package tests pass
  • exact ASCII and Unicode border assertions pass
  • EN/CN/Korean column combinations pass
  • values such as 안녕 Hello, 你好 Hello, and 你好 안녕 align correctly

@ShawnBaek
ShawnBaek marked this pull request as ready for review July 19, 2026 15:16
@ShawnBaek
ShawnBaek merged commit 13c48e7 into master Jul 19, 2026
1 check passed
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