feat(ui): extract shared Badge + Kbd primitives (U0.5)#411
Conversation
Foundational primitives for the shared design system, de-duplicating the
tonal-pill visual language that had drifted across three screens.
- Badge (libs/ui/primitives): tone (good/info/warn/bad/neutral, from the
shared BadgeTone) + size ('sm' dense card chip / 'md' detail badge).
The tone colors were identical everywhere; size preserves the two
historical sizings exactly.
- Kbd: inline keyboard-hint text.
- refactored KanbanBoard (statusChip + outcome badges → Badge size=sm),
TaskDetail (badges → Badge size=md), BoardToolbar (⌘K → Kbd); removed
the now-duplicated .ac-kanban__badge / .ac-task-detail__badge /
.ac-toolbar__kbd CSS.
Pixel-identical, verified live via computed styles: sm = min-height 22 /
0 7px / 10.5px·780 / radius 6 / nowrap; md = 2px 8px / 11px·600; tones
resolve to the same tokens. libs/ui + Electron tsc 0, 24 adapter tests
green, no stale badge classes remain.
Storybook + Button/Input primitives follow separately (U0.5b) to isolate
the Storybook dependency's impact on the hoisted-lockfile frontend CI.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Oleg Miagkov <mrobenner@gmail.com>
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds shared ChangesShared UI primitives
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/ui/src/primitives/Badge.tsx`:
- Around line 18-28: Update the Badge component and BadgeProps to accept and
forward remaining span attributes, including className, data-*, aria-*, id, and
event handlers, onto the rendered span while preserving the existing size and
tone class behavior.
In `@libs/ui/src/primitives/Kbd.tsx`:
- Around line 9-11: Replace the span returned by the Kbd component with a
semantic kbd element, preserving the ac-kbd class and children.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3cb1e9f7-4f68-4fa8-8c3b-cd7c84a6a3cf
📒 Files selected for processing (11)
libs/ui/src/index.tslibs/ui/src/primitives/Badge.csslibs/ui/src/primitives/Badge.tsxlibs/ui/src/primitives/Kbd.csslibs/ui/src/primitives/Kbd.tsxlibs/ui/src/screens/BoardToolbar.csslibs/ui/src/screens/BoardToolbar.tsxlibs/ui/src/screens/KanbanBoard.csslibs/ui/src/screens/KanbanBoard.tsxlibs/ui/src/screens/TaskDetail.csslibs/ui/src/screens/TaskDetail.tsx
…view) - Badge: props extend HTMLAttributes<HTMLSpanElement> — className is merged with the ac-badge classes and aria-*/data-*/handlers forward to the span, so consumers don't need a wrapper for standard attributes - Kbd: renders the semantic <kbd> element instead of a <span>; the .ac-kbd class already sets font-family/size, so visual output is unchanged. Rest attributes forward likewise. Verified: libs/ui + Electron tsc 0; badge computed styles unchanged in the live demo (22px / 0 7px / 10.5px / 780). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Oleg Miagkov <mrobenner@gmail.com>
|



What
First U0.5 foundational primitives for the shared design system, de-duplicating the tonal-pill visual language that had drifted across three screens (each with its own
__badgeCSS).libs/ui/src/primitives) —tone(good/info/warn/bad/neutral, from the sharedBadgeTone) +size(smdense card chip /mddetail badge). The tone colors were byte-identical across screens;sizepreserves the two historical sizings exactly.<Badge size=sm>), TaskDetail (badges →<Badge size=md>), BoardToolbar (⌘K →<Kbd>); removed the now-duplicated.ac-kanban__badge/.ac-task-detail__badge/.ac-toolbar__kbdCSS.Why this doesn't include Storybook
The repo has no Storybook, and CI installs frontend deps via
npm ciagainst the hoisted root lockfile (workspaces) then typechecks/buildsapps/frontendagainst it. A large Storybook dependency tree is exactly the lockfile/nesting change that has reddened all frontend CI before. So I'm landing the durable, zero-dep primitives here and staging Storybook + the Button/Input primitives as a separate U0.5b PR where the dependency's CI impact can be isolated and watched without blocking this.Verification
Pixel-identical, confirmed live via computed styles: sm = min-height 22 / padding 0 7px / 10.5px·780 / radius 6 / nowrap; md = 2px 8px / 11px·600; both tones resolve to the same tokens (info =
--blue/--blue-soft).libs/ui+ Electron tsc 0, 24 adapter/filter tests green, zero stale badge/kbd classes remain.🤖 Generated with Claude Code
Summary by CodeRabbit