refactor(ui): tag, popover, inverse tooltip per pawwork ds (slice 06, issue #440)#458
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates styling and component configurations across three UI components (popover, tag, tooltip) in the design system. Changes include tokenized CSS properties, consolidated component variants, new Storybook stories showcasing updated primitives and interaction states, minor prop adjustments, and animation timing refinements. ChangesPopover Styling & Consumer Primitives
Tag Component Simplification
Tooltip Styling & Animation Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Code Review
This pull request refines the List, Popover, Tag, and Tooltip components by simplifying typography, adding animations, and introducing new primitives like popover items and search slots. Feedback identifies several instances of hardcoded hex colors and animation durations that should be replaced with design tokens for better theme support. It is also recommended to differentiate the visual states of interactive elements and use semantic background tokens to ensure the components function correctly in dark mode.
Drops the two-tier size prop; locks to height 20 / padding 0-6 / weight 500 / --fg-strong / #fff bg / 0.5px --border-weak / --radius-sm. Stories simplified to Basic + OnSurfaces smoke across three surfaces.
…r pawwork ds Container now uses --surface-base / --radius-md / --ring-base + --shadow-floating / padding 4 (via popover-body). Removes hard-coded 14px radius, --surface-raised, and min/max-width from component CSS (callers set min-width 184 inline per spec). Gutter changed to 8px. Adds popover-item / popover-item-icon / popover-item-shortcut / popover-separator slots + data-variant="danger" tier. data-force-state on items enables static screenshot coverage of hover/focus/selected/disabled.
…ring
Adds [data-slot="popover-search"] — no border, no radius, padding 10/12,
1px --border-weaker bottom divider, per DESIGN.md L188. input :focus-visible
uses the brand focus ring (0 0 0 1px #FF5910, 0 0 0 3px rgba(255,89,16,0.20))
inlined per spec ("调用处内联"). WithSearch story added with autofocus for
static :focus-visible screenshot.
Surface: --fg-strong bg + --bg-cream text (inverse), --radius-sm, padding 8/12, --shadow-floating. Removes border and hard-coded 2px vertical padding. Font set to sans 13/500/1.2 inline per DESIGN.md L190. Uncomments Kobalte Arrow (size=5) for the 5×5 caret; fill is auto-detected from background-color. openDelay set to 0 for immediate appearance; closeDelay already 0. Fade-in uses tooltip-fadein keyframe over --duration-base; [data-closed] cancels animation for instant disappearance on leave.
…alte [data-expanded]
- Move openDelay/closeDelay before {...others} so callers (e.g. new-session button
with openDelay={2000}) are not silently overridden.
- sync() now only queries [data-expanded] (Kobalte popup marker) to suppress tooltips;
native aria-expanded on panel toggles no longer blocks tooltip display.
- Increase Arrow size from 5 to 8 for visible caret.
909974c to
1a2eddb
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/ui/src/components/popover.css (1)
79-83: ⚡ Quick winTokenize the search input focus ring instead of hard-coding orange values.
Using design tokens here keeps focus treatment consistent across themes and future palette updates.Proposed adjustment
&:focus-visible { outline: none; border-radius: 2px; - box-shadow: 0 0 0 1px `#ff5910`, 0 0 0 3px rgba(255, 89, 16, 0.2); + box-shadow: var(--ring-interactive-base); }🤖 Prompt for 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. In `@packages/ui/src/components/popover.css` around lines 79 - 83, Replace the hard-coded orange values in the &:focus-visible rule with design tokens: swap `#ff5910` and rgba(255,89,16,0.2) used in the box-shadow and any outline color into appropriate CSS tokens (e.g., var(--focus-ring-color) and var(--focus-ring-ambient) or your project's equivalent token names) so the focus treatment uses tokens consistently; update the box-shadow and any border/outlines inside the &:focus-visible selector to reference those tokens instead of literal hex/rgba values.
🤖 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.
Nitpick comments:
In `@packages/ui/src/components/popover.css`:
- Around line 79-83: Replace the hard-coded orange values in the &:focus-visible
rule with design tokens: swap `#ff5910` and rgba(255,89,16,0.2) used in the
box-shadow and any outline color into appropriate CSS tokens (e.g.,
var(--focus-ring-color) and var(--focus-ring-ambient) or your project's
equivalent token names) so the focus treatment uses tokens consistently; update
the box-shadow and any border/outlines inside the &:focus-visible selector to
reference those tokens instead of literal hex/rgba values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ef165d06-9846-4e05-8c37-d230c94792df
📒 Files selected for processing (9)
packages/ui/src/components/popover.csspackages/ui/src/components/popover.stories.tsxpackages/ui/src/components/popover.tsxpackages/ui/src/components/tag.csspackages/ui/src/components/tag.stories.tsxpackages/ui/src/components/tag.tsxpackages/ui/src/components/tooltip.csspackages/ui/src/components/tooltip.stories.tsxpackages/ui/src/components/tooltip.tsx
Use var(--duration-base) instead of 0.12s for open/close animation and var(--shadow-xs-border-focus) instead of hardcoded #ff5910 values for the search input focus ring.
|
Re CodeRabbit nitpick (review 4229642402, popover.css L79-83): fixed in aad007c — replaced hardcoded |
Summary
Slice 06 of issue #440 — rewrites Tag, Popover, and Tooltip to the PawWork design system. Also fixes two pre-existing Tooltip bugs found during manual testing.
Why
Part of the packages/ui + packages/app full visual rewrite (#440, permanent fork from upstream). Slice 06 covers the three interaction-surface primitives that appear throughout the app (model picker tags, command popovers, icon-button tooltips).
Related Issue
Part of #440 (slice 06). Does not close #221 — the list search focus ring requires a JS-level fix (
focus({ focusVisible: false })) that is out of scope here; tracked separately.Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
tag.css: single rest-state, no size variants,--surface-raisedbg (dark-mode adaptive; replaces hotfix's size-variant restoration)tooltip.tsxsync(): was checking[aria-expanded="true"]which blocked tooltip on sidebar toggle — narrowed to[data-expanded]onlytooltip.tsxprop order:openDelay/closeDelaymoved before{...others}so callers (e.g. new-session buttonopenDelay={2000}) are not silently overriddenRisk Notes
CSS-only changes to
packages/uiprimitives; no packages/app files changed. No new dependencies. No data, permissions, or migration concerns. Thearia-expandedfix is behaviour-restoring (tooltip was broken before, now works as expected).How To Verify
Manual smoke (Electron, light + dark):
Screenshots or Recordings
Manual testing confirmed via Electron. Before/after static screenshots pending — Storybook Matrix stories cover the key visual states (ForcedOpen, 4-placement Matrix, MenuMatrix, OnSurfaces).
Checklist
dev, and my PR title and commit messages use Conventional Commits in English