fix(fancy): replace width-1 icons for start and trace to fix timestamp alignment#412
fix(fancy): replace width-1 icons for start and trace to fix timestamp alignment#412terminalchai wants to merge 1 commit into
Conversation
…p alignment The fancy reporter aligns log messages with timestamps using string-width to measure the left-hand side. All type icons ( ℹ ) have a string-width of 2, but \start\ used (U+25D0) and \ race\ used (U+2192) which both have a string-width of 1. This 1-wide vs 2-wide mismatch caused the timestamp to appear shifted one character to the right for \start\ and \ race\ compared to every other log type. Fix: replace the two outlier icons with ones that have string-width 2: - start: (sw 1) (U+25B6, sw 2) — 'play/run' fits the semantic - trace: (sw 1) (U+27A1, sw 2) — same directional meaning Closes unjs#394
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated Unicode icons in the fancy reporter's log type symbols. The trace log type now displays "➡" instead of "→", and the start log type displays "▶" instead of "o", with fallbacks for environments without Unicode support. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #394
Root Cause
The fancy reporter calculates timestamp alignment using
stringWidth(left)whereleftincludes the type icon. All type icons have astring-widthof 2:string-width✖✔⚠ℹ⚙◐→Because
startandtraceicons havestring-width1 while every other type has 2, thespacecalculation informatLogObjgives them one extra space — shifting their timestamp one character to the right.Fix
Replace the two outlier icons with ones that have
string-width2:start:◐(U+25D0, sw=1) →▶(U+25B6, sw=2) — play/run fits the semantic perfectlytrace:→(U+2192, sw=1) →➡(U+27A1, sw=2) — same directional meaningBefore / After
Summary by CodeRabbit