Skip to content

fix(widgets): use column-width truncation for double-width text in Badge #3066#3067

Open
itssagarK wants to merge 2 commits into
Karanjot786:mainfrom
itssagarK:fix/badge-double-width-truncation
Open

fix(widgets): use column-width truncation for double-width text in Badge #3066#3067
itssagarK wants to merge 2 commits into
Karanjot786:mainfrom
itssagarK:fix/badge-double-width-truncation

Conversation

@itssagarK

@itssagarK itssagarK commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Title

fix(widgets): use column-width truncation for double-width text in Badge

### Summary of Changes
- Updated `Badge._renderSelf` in `packages/widgets/src/display/Badge.ts` to use `truncate(padded,

innerWidth, ''). - Added unit test in packages/widgets/src/display/Badge.test.ts` for double-width character
truncation.

Closes #3066 

Type of Change

  • 🐛 Bug fix (type:bug)
  • ✨ Feature (type:feature)
  • 📝 Docs (type:docs)
  • 🧪 Tests (type:testing)
  • ♻️ Refactor (type:refactor)
  • 🎨 Design / UX (type:design)
  • ♿ Accessibility (type:accessibility)
  • ⚡ Performance (type:performance)
  • 🔧 DevOps / CI (type:devops)
  • 🔒 Security (type:security)

Checklist

  • ⭐ You starred the repo. The needs-star check blocks your merge otherwise.
  • Tests pass locally: bun vitest run
  • Build passes: bun run build
  • Typecheck passes: bun run typecheck
  • You read CONTRIBUTING.md.
  • Your PR title follows type: short description.
  • Widget state mutators call markDirty() (if your change affects rendering).
  • No new any types without an inline comment explaining why.
  • No unrelated refactors bundled into this PR.

GSSoC 2026 Participation

  • You are a GSSoC 2026 contributor.
  • Your GSSoC profile: https://gssoc.girlscript.org/profile/____

Screenshots / Recordings (UI changes)

Notes for the Reviewer

@itssagarK
itssagarK requested a review from Karanjot786 as a code owner July 25, 2026 15:59
@github-actions github-actions Bot added type:bug +10 pts. Bug fix. area:widgets @termuijs/widgets type:testing +10 pts. Tests. labels Jul 25, 2026
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@itssagarK, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ef177d9d-953b-49fe-bdf8-bcf880631a2b

📥 Commits

Reviewing files that changed from the base of the PR and between 46503a5 and c05e2c3.

📒 Files selected for processing (1)
  • packages/widgets/src/display/Badge.test.ts
✨ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:widgets @termuijs/widgets type:bug +10 pts. Bug fix. type:testing +10 pts. Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant