Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

docs: note ambiguous-width limitation of block-art banner - #1177

Merged
BYK merged 1 commit into
mainfrom
docs/banner-cjk-width-limitation
Jul 2, 2026
Merged

BYK merged 1 commit into
mainfrom
docs/banner-cjk-width-limitation

Conversation

@BYK

@BYK BYK commented Jul 2, 2026

Copy link
Copy Markdown
Member

Follow-up to #1169 addressing Seer's MEDIUM review comment.

What

Documents a known limitation of the block-art banner and fixes a stale doc.

Seer flagged that bannerLinesWidth measures width in Unicode code points, which assumes each Block Elements glyph (U+2580–U+259F) is one terminal cell. Those glyphs are East Asian Ambiguous width, so a terminal configured to render ambiguous characters as wide (some CJK setups) draws them double-width and the banner can wrap.

Why document rather than "fix"

  • The premise is correct, but there is no portable way to detect a terminal's ambiguous-width setting.
  • Seer's suggested fix (string-width) is a no-op by default — string-width also treats ambiguous characters as narrow unless you pass {ambiguousIsNarrow:false}, which would then wrongly double-count on the overwhelming majority of (non-CJK / ambiguous=narrow) terminals.
  • Impact is limited to the decorative, TTY-gated banner (worst case: cosmetic wrap, no crash), and the plain ASCII text mark is unaffected.

So this is an inherent limitation of block-element art. We document it on bannerLinesWidth rather than add a dependency or an unreliable locale heuristic.

Also

Fixes stale threshold values in the bannerLinesForWidth JSDoc (66/52, not the pre-brand-art 78/58).

Testing

  • biome check / tsc --noEmit → clean. Doc-only change; no behavior change.

Document that bannerLinesWidth counts code points, which assumes single-width
block glyphs; in CJK terminals configured with ambiguous-as-wide, the Block
Elements glyphs render double-width and the banner may wrap. This isn't
portably detectable (and string-width also treats ambiguous as narrow by
default), so it's an accepted limitation — the plain text mark is unaffected.
Addresses Seer review feedback on #1169.

Also fixes stale threshold values in the bannerLinesForWidth doc (66/52, not
78/58) after the brand-art update.
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1177/

Built to branch gh-pages at 2026-07-02 18:31 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 5175 uncovered lines.
✅ Project coverage is 81.6%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.59%    81.60%    +0.01%
==========================================
  Files          405       405         —
  Lines        28124     28124         —
  Branches     18328     18328         —
==========================================
+ Hits         22946     22949        +3
- Misses        5178      5175        -3
- Partials      1880      1879        -1

Generated by Codecov Action

@BYK
BYK merged commit 44eb8d4 into main Jul 2, 2026
30 checks passed
@BYK
BYK deleted the docs/banner-cjk-width-limitation branch July 2, 2026 19:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant