Added a warning badge variant and updated comments header#27986
Conversation
No ref - Added a new warning Badge variant - Used the new badge for pin/unpin comment - Tweaked header styles to improve the badge layout
WalkthroughThis PR introduces a new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
| @@ -1,4 +1,4 @@ | |||
| import {Badge, Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from '@tryghost/shade/components'; | |||
| import {Badge, Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants} from '@tryghost/shade/components'; | |||
There was a problem hiding this comment.
I'd much rather just import Badge, but we need badgeVariants because the pinned badge is interactive. At some point we could consider hoisting that behaviour into the component itself.
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 `@apps/shade/src/components/ui/badge.stories.tsx`:
- Around line 53-58: The new Story object Warning is missing the per-story docs
one-line description; update the Warning Story (export const Warning) to include
a parameters.docs.description.story string describing when to use the warning
variant (e.g., one-line usage hint) so it follows the Shade stories contract,
adding the parameters block alongside args within the Warning object.
In `@apps/shade/src/components/ui/badge.tsx`:
- Around line 19-20: The warning badge mapping in the Badge component uses a
hard-coded color token ('text-yellow-600')—replace that with your theme's
semantic warning text token (the token paired with bg-state-warning/20) in the
'warning' entry so the mapping reads e.g. 'border-transparent
bg-state-warning/20 <YOUR_WARNING_TEXT_TOKEN>'; update the 'warning' key in
badge.tsx accordingly (look for the 'warning:' mapping in the Badge component)
to maintain semantic, token-driven theming.
🪄 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: CHILL
Plan: Pro
Run ID: 1a6b4313-b38f-4fad-a189-1c10d04e2d82
📒 Files selected for processing (5)
apps/posts/src/views/comments/components/comment-content.tsxapps/posts/src/views/comments/components/comment-header.tsxapps/shade/src/components/ui/badge.stories.tsxapps/shade/src/components/ui/badge.tsxapps/shade/test/unit/components/ui/badge.test.tsx
| @@ -1,4 +1,4 @@ | |||
| import {Badge, Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger} from '@tryghost/shade/components'; | |||
| import {Badge, Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants} from '@tryghost/shade/components'; | |||
No ref
New variant

Comment header updates