fix(markdown): align code tables by display width#55596
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 3:47 PM ET / 19:47 UTC. Summary PR surface: Source +25, Tests +67. Total +92 across 4 files. Reproducibility: yes. Current main still uses UTF-16 string length for markdown code-table sizing, and the inspected Telegram baseline proof shows the CJK/emoji column shift that the candidate corrects. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the shared markdown-core and terminal-core width fix after required checks and the active exact-head Mantis proof finish, then let the linked Markdown table alignment issue close from the merge. Do we have a high-confidence way to reproduce the issue? Yes. Current main still uses UTF-16 string length for markdown code-table sizing, and the inspected Telegram baseline proof shows the CJK/emoji column shift that the candidate corrects. Is this the best way to solve the issue? Yes. Reusing terminal-core AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ee9d9ea6dbb7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +25, Tests +67. Total +92 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
|
@openclaw-mantis please generate the Telegram desktop proof for this PR. |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIFs showing Markdown code tables with CJK and emoji cells shifting on Main and aligning in this PR.
Motion-trimmed clips: |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Pearl Branchling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Maintainer review is complete and land-ready at exact head Best-fix judgment: yes. The shared Markdown renderer now calls terminal-core's existing Proof:
Lineage/content recheck: compared with previously reviewed head Current-main recheck: |
Co-authored-by: Sparkyrider <[email protected]>
Co-authored-by: Sparkyrider <[email protected]>
Dependency graph guard clearedThis PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh
|
|
Merged via squash.
|




What Problem This Solves
Markdown tables rendered in
codemode used JavaScript UTF-16 string length to size columns. CJK and emoji cells therefore received the wrong padding, so table borders did not align in shared Telegram and Discord output.Closes #55512.
Why This Change Was Made
This branch was rewritten on current
mainafter the Markdown renderer moved intopackages/markdown-core. The renderer now reuses terminal-core's canonical grapheme-awarevisibleWidthimplementation for both width collection and row padding. The shared width helper was also tightened to distinguish Unicode text presentation from valid emoji, keycap, flag, and ZWJ sequences without adding a dependency or duplicating width policy.User Impact
Code-formatted Markdown tables containing CJK text, emoji, or mixed-width cells now keep their columns aligned. Narrow text-presentation symbols stay narrow, and terminal tables share the corrected emoji-sequence behavior. ASCII-only tables are unchanged. There are no config, protocol, dependency, or migration changes.
Evidence
1f04e303d5a46857519486c69de93474571993df.b0b5d055be352bba656cbf8ca3ca2eddcac5f8e7, the production and test tree is unchanged. The only content removal was the contributor-branchCHANGELOG.mdline, deferred to the maintainer release-note lane; the commits were then rebased and ancestry-preserving force-pushed with all seven PR-local commits maintainer-signed and both contributor co-author trailers intact.cbx_eca8262d6ca3) focused proof: 41/41 tests passed in run_23d254b679b5.4f9a371c9530e9d2eb2912a44054a44228a59612produced both expected regression failures in run_6a494e96909b.0.82), with no accepted or actionable findings.Original contribution preserved with co-author credit to @sparkyrider.