Skip to content

fix(fancy): replace width-1 icons for start and trace to fix timestamp alignment - #442

Closed
marceli1404 wants to merge 1 commit into
unjs:mainfrom
marceli1404:fix/start-type-alignment
Closed

marceli1404 wants to merge 1 commit into
unjs:mainfrom
marceli1404:fix/start-type-alignment

Conversation

@marceli1404

@marceli1404 marceli1404 commented Jul 29, 2026 •

Copy link
Copy Markdown

Fixes #394

Root Cause

The fancy reporter calculates timestamp alignment using \stringWidth(left)\ where \left\ includes the type icon. All type icons have a \string-width\ of 2:

Type Icon \string-width\
error/fatal/fail ✖ 2
ready/success ✔ 2
warn ⚠ 2
info ℹ 2
debug ⚙ 2
start ◐ 1 ← outlier
trace → 1 ← outlier

Because \start\ and \ race\ icons have \string-width\ 1 while every other type has 2, the \space\ calculation in \ ormatLogObj\ gives them one extra space — shifting their timestamp one character to the right.

Fix

Replace the two outlier icons with ones that have \string-width\ 2:

  • \start: ◐ (U+25D0, sw=1) → ▶ (U+25B6, sw=2) — play/run fits the semantic perfectly
  • \ race: → (U+2192, sw=1) → ➡ (U+27A1, sw=2) — same directional meaning

Summary by CodeRabbit

  • Style
    • Updated visual icons for trace and start log entries while preserving existing ASCII fallbacks.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 800f62fb-3c39-489f-9b6b-7bc2a64e08c6

📥 Commits

Reviewing files that changed from the base of the PR and between c47faac and 4d71f8f.

📒 Files selected for processing (1)
  • src/reporters/fancy.ts

📝 Walkthrough

Walkthrough

The fancy reporter changes the Unicode icons for trace and start log types while keeping their ASCII fallbacks unchanged. The fail icon remains unchanged.

Changes

Fancy reporter icon updates

Layer / File(s) Summary
Update log type icons
src/reporters/fancy.ts
trace now uses ➡ with → as its fallback, and start uses ▶ with o as its fallback. The fail mapping is unchanged.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: swapping narrow icons to fix timestamp alignment in the fancy reporter.
Linked Issues check ✅ Passed The change addresses issue #394 by fixing the misaligned start time label with wider icons.
Out of Scope Changes check ✅ Passed The PR stays focused on the fancy reporter icon width adjustment and does not introduce unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@marceli1404 marceli1404 closed this by deleting the head repository Sep 2, 2026
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.

The start method produces a misaligned time label

1 participant