Repository navigation
feat(Select/Listbox/Combobox/Menu/ContextMenu/DropdownMenu/Menubar/ColorSwatchPicker): add slot prop to *Item and forceMount to *ItemIndicator - #2562
Conversation
…t` to `SelectItemIndicator`
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: unovue/reka-ui/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (30)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughItem components now expose selected or checked state through scoped slots. Select and Listbox indicators support optional force mounting and checked-state attributes. Documentation and tests cover these changes. ChangesItem state slots and indicators
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The selected slot reports item state correctly in multiple-selection mode. No identified issue currently prevents merging after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The new slot values reflect existing selection state, and mounting an unselected indicator requires an explicit option. No new security boundary or sensitive-data path was identified in the inspected components, though the broader security coverage is incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (27 skipped: 27 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/Select/SelectItem.vue`:
- Line 180: The slot in SelectItem.vue is passing the ComputedRef isSelected
instead of the raw boolean, so update the template to pass the unwrapped value
(use isSelected.value) to satisfy the slot type contract; locate the <slot
:selected="isSelected" /> usage in SelectItem.vue and replace it so consumers
receive a plain boolean, and audit similar patterns in Radio.vue and
TooltipRoot.vue where slot props are declared as unwrapped values but the Ref is
passed—change those to pass .value as well.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2db09e47-5527-4261-8bc2-81f8365c7af1
📒 Files selected for processing (2)
packages/core/src/Select/SelectItem.vuepackages/core/src/Select/SelectItemIndicator.vue
|
@kricsleo thank you 💙 do you think we can apply this to combobox too (and any other select-like components I might have missed where such a feature makes sense)? |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/Listbox/ListboxItemIndicator.vue`:
- Line 28: The Presence prop binding mixes forced and state-driven mounting;
change the Presence usage in ListboxItemIndicator.vue to pass present and
forceMount separately by setting :present="itemContext.isSelected.value" and
:forceMount="forceMount" so Presence can correctly handle transitions; locate
the Presence element (currently using :present="forceMount ||
itemContext.isSelected.value") and replace the expression with the two props,
and apply the same pattern to other components using the same combined
expression (e.g., Toast, Tooltip, Tabs, RadioGroup, Popover, Menu, HoverCard,
Dialog, Select, Checkbox, Collapsible, Combobox).
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: c446a63b-d950-423f-8e1b-56898d052469
📒 Files selected for processing (11)
packages/core/src/ColorSwatchPicker/ColorSwatchPickerItem.vuepackages/core/src/Combobox/ComboboxItem.vuepackages/core/src/ContextMenu/ContextMenuCheckboxItem.vuepackages/core/src/ContextMenu/ContextMenuRadioItem.vuepackages/core/src/DropdownMenu/DropdownMenuCheckboxItem.vuepackages/core/src/DropdownMenu/DropdownMenuRadioItem.vuepackages/core/src/Listbox/ListboxItem.vuepackages/core/src/Listbox/ListboxItemIndicator.vuepackages/core/src/Menu/MenuRadioItem.vuepackages/core/src/Menubar/MenubarCheckboxItem.vuepackages/core/src/Menubar/MenubarRadioItem.vue
✅ Files skipped from review due to trivial changes (1)
- packages/core/src/Menubar/MenubarCheckboxItem.vue
selected slot prop to SelectItem and forceMount to SelectItemIndicator*Item and forceMount to *ItemIndicator
|
Added relevant features to more components. |
zernonia
left a comment
There was a problem hiding this comment.
Nice addition — fills a real gap. A few suggestions inline. One blocking item: forceMount leaks onto the DOM in both indicators. Also worth adding a test for the new Presence/forceMount behavior (e.g. in Select/Select.test.ts): indicator unmounts when unselected, stays mounted with forceMount, and forcemount doesn't leak to the DOM.
zernonia
left a comment
There was a problem hiding this comment.
Thanks for extending this across the families! Before we merge:
- Please rebase on v2:
ComboboxItem.vuenow has av-memo, just keep both it and the newv-slot. - The
forcemountattribute leaks onto the DOM inSelectItemIndicator/ListboxItemIndicator(v-bind="props"); bindingas/as-childexplicitly likeCheckboxIndicatoravoids it. - Could the new indicators also emit
data-statelikeCheckboxIndicator/MenuItemIndicator, soforceMountcan drive animations? - Let's settle on one slot prop name: the Menu radio items expose
checkedwhile checkbox items exposemodelValue. Please also exposecheckedfromMenuCheckboxItemand adddefineSlotsto the ContextMenu/DropdownMenu/Menubar wrappers. - A small test (unmounts when unselected, stays mounted with
forceMount, noforcemountattribute) andpnpm docs:gen.
Happy to help if you're short on time!
…ators - stop forceMount leaking as a DOM attribute on Select/ListboxItemIndicator - add data-state to Select/ListboxItemIndicator for forceMount animations - expose checked from MenuCheckboxItem, matching radio items - add defineSlots to SelectItem, ColorSwatchPickerItem and menu wrappers - add tests and regenerate API docs Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolve ColorSwatchPickerItem conflict: keep the item part surface and forward the ListboxItem slot props added in unovue#2562. Update the picker characterization test, which pinned the duplicate listener call fixed by unovue#2938, and regenerate ColorSwatchPickerRoot meta. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🔗 Linked issue
resolves #2547
❓ Type of change
📚 Description
📸 Screenshots (if appropriate)
📝 Checklist
Summary by CodeRabbit
forceMountto remain mounted regardless of selection, with state information available for styling and animation.