Conversation
WalkthroughAdded Changes
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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: 1
🤖 Fix all issues with AI agents
In `@src/components/ui/select.tsx`:
- Around line 115-133: SelectItem currently renders SelectPrimitive.ItemText but
omits a selected-item marker; update the SelectItem component to include
<SelectPrimitive.ItemIndicator> (rendering your check/icon element) alongside
the ItemText so selected options show a visual indicator; place the
ItemIndicator before the ItemText, ensure it uses existing CSS classes or add a
small utility class for spacing/alignment (matching the "relative flex ...
items-center gap-1.5" container), and keep all existing props and children
handling in SelectItem.
🧹 Nitpick comments (1)
src/components/ui/select.tsx (1)
91-91: Non-English comment.The inline comment is in Italian. For consistency and broader team accessibility, consider switching to English.
- // il menu matcha la larghezza del trigger + // match the dropdown width to the trigger width
| function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) { | ||
| return ( | ||
| <SelectPrimitive.Item | ||
| data-slot="select-item" | ||
| className={cn( | ||
| "relative flex w-full select-none cursor-pointer items-center gap-1.5", | ||
| "rounded-buttonsM px-5 py-2.5", | ||
| "typo-body-medium text-text-primary", | ||
| "outline-none", | ||
| "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", | ||
| "data-[highlighted]:bg-blue-tertiary/10", | ||
| className | ||
| )} | ||
| {...props} | ||
| > | ||
| <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText> | ||
| </SelectPrimitive.Item> | ||
| ) | ||
| } |
There was a problem hiding this comment.
No selected-item indicator — intentional?
SelectItem wraps children in ItemText but never renders SelectPrimitive.ItemIndicator. Without it, users have no visual cue for which option is currently selected when the dropdown is open. Most Radix Select implementations include a check icon via ItemIndicator.
If this is a deliberate design decision, ignore this. Otherwise:
Proposed fix
+import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
-import { ChevronDownIcon, ChevronUpIcon } from "lucide-react" function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
return (
<SelectPrimitive.Item
data-slot="select-item"
className={cn(
- "relative flex w-full select-none cursor-pointer items-center gap-1.5",
+ "relative flex w-full select-none cursor-pointer items-center gap-1.5 pl-8",
"rounded-buttonsM px-5 py-2.5",
"typo-body-medium text-text-primary",
"outline-none",
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
"data-[highlighted]:bg-blue-tertiary/10",
className
)}
{...props}
>
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
+ <SelectPrimitive.ItemIndicator>
+ <CheckIcon className="h-4 w-4" />
+ </SelectPrimitive.ItemIndicator>
+ </span>
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
</SelectPrimitive.Item>
)
}🤖 Prompt for AI Agents
In `@src/components/ui/select.tsx` around lines 115 - 133, SelectItem currently
renders SelectPrimitive.ItemText but omits a selected-item marker; update the
SelectItem component to include <SelectPrimitive.ItemIndicator> (rendering your
check/icon element) alongside the ItemText so selected options show a visual
indicator; place the ItemIndicator before the ItemText, ensure it uses existing
CSS classes or add a small utility class for spacing/alignment (matching the
"relative flex ... items-center gap-1.5" container), and keep all existing props
and children handling in SelectItem.
Closes #15