Skip to content

feat(ui): extract shared Badge + Kbd primitives (U0.5)#411

Merged
OBenner merged 2 commits into
developfrom
claude/ui-command-palette-u3
Jul 11, 2026
Merged

feat(ui): extract shared Badge + Kbd primitives (U0.5)#411
OBenner merged 2 commits into
developfrom
claude/ui-command-palette-u3

Conversation

@OBenner

@OBenner OBenner commented Jul 11, 2026

Copy link
Copy Markdown
Owner

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 __badge CSS).

  • Badge (libs/ui/src/primitives) — tone (good/info/warn/bad/neutral, from the shared BadgeTone) + size (sm dense card chip / md detail badge). The tone colors were byte-identical across screens; 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.

Why this doesn't include Storybook

The repo has no Storybook, and CI installs frontend deps via npm ci against the hoisted root lockfile (workspaces) then typechecks/builds apps/frontend against 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

  • New Features
    • Added reusable badges with small and medium sizes and multiple visual tones.
    • Added a consistent keyboard shortcut label style.
  • UI Improvements
    • Standardized task status, task detail badges, and keyboard shortcuts across the interface.
    • Badge appearance now remains consistent across board and task detail views.

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>
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 50 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: fd54db2f-a9a5-47e1-b1b3-3ac966078bf0

📥 Commits

Reviewing files that changed from the base of the PR and between 96e86ed and 3f28a1f.

📒 Files selected for processing (2)
  • libs/ui/src/primitives/Badge.tsx
  • libs/ui/src/primitives/Kbd.tsx
📝 Walkthrough

Walkthrough

Adds shared Badge and Kbd UI primitives, exports them from the UI package, and replaces screen-local badge and keyboard-hint markup and styling in KanbanBoard, TaskDetail, and BoardToolbar.

Changes

Shared UI primitives

Layer / File(s) Summary
Primitive contracts and styling
libs/ui/src/primitives/*, libs/ui/src/index.ts
Adds Badge and Kbd components, their CSS, prop types, and top-level exports.
Keyboard hint integration
libs/ui/src/screens/BoardToolbar.*
Renders the search shortcut with Kbd and removes the local keyboard-hint rule.
Badge rendering integration
libs/ui/src/screens/KanbanBoard.*, libs/ui/src/screens/TaskDetail.*
Renders status and task badges with Badge, mapping tone and size values while removing local badge styles.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • OBenner/Auto-Coding#386: Adds Kanban status-chip data and rendering that this PR updates to use the shared Badge primitive.

Suggested labels: area/frontend

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: extracting shared Badge and Kbd UI primitives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/ui-command-palette-u3

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2509f3a and 96e86ed.

📒 Files selected for processing (11)
  • libs/ui/src/index.ts
  • libs/ui/src/primitives/Badge.css
  • libs/ui/src/primitives/Badge.tsx
  • libs/ui/src/primitives/Kbd.css
  • libs/ui/src/primitives/Kbd.tsx
  • libs/ui/src/screens/BoardToolbar.css
  • libs/ui/src/screens/BoardToolbar.tsx
  • libs/ui/src/screens/KanbanBoard.css
  • libs/ui/src/screens/KanbanBoard.tsx
  • libs/ui/src/screens/TaskDetail.css
  • libs/ui/src/screens/TaskDetail.tsx

Comment thread libs/ui/src/primitives/Badge.tsx
Comment thread libs/ui/src/primitives/Kbd.tsx Outdated
…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>
@OBenner OBenner merged commit 98156b8 into develop Jul 11, 2026
15 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant