Skip to content

fix(components): allow partial ui overrides on items - #6979

Merged
benjamincanac merged 1 commit into
nuxt:v4from
lazerg:fix/issue-6974-partial-item-ui
Sep 21, 2026
Merged

benjamincanac merged 1 commit into
nuxt:v4from
lazerg:fix/issue-6974-partial-item-ui

Conversation

@lazerg

@lazerg lazerg commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #6974

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

The per-item ui field is typed as Pick<Component['slots'], ...>. Pick only keeps a key optional if the source type declares it that way, and Component['slots'] falls back to an index signature whenever the generated #build/ui/* theme types don't resolve — in a Vue project without the #build/ui/* path alias, for example. Picking literal keys off an index signature makes every one of them required, so setting a single slot like ui: { linkLeadingIcon: '...' } fails to type-check with "missing the following properties: label, link, content, item, and 18 more", even though tv() merges partial slot overrides fine at runtime.

Wrapped each of those picks in Partial, which matches the runtime behaviour and is a no-op when the theme types do resolve. Same change on every component carrying a per-item ui field, since they all share the pattern.

v5 carries the same pattern, so let me know if you want a companion PR there.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@github-actions github-actions Bot added the v4 #4488 label Sep 18, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: f6f76ae8-bdad-4bbf-b896-63d77437b850

📥 Commits

Reviewing files that changed from the base of the PR and between a96823d and d03e9c3.

📒 Files selected for processing (25)
  • src/runtime/components/Accordion.vue
  • src/runtime/components/Breadcrumb.vue
  • src/runtime/components/Carousel.vue
  • src/runtime/components/CheckboxGroup.vue
  • src/runtime/components/CommandPalette.vue
  • src/runtime/components/ContextMenu.vue
  • src/runtime/components/DropdownMenu.vue
  • src/runtime/components/FooterColumns.vue
  • src/runtime/components/InputMenu.vue
  • src/runtime/components/Listbox.vue
  • src/runtime/components/NavigationMenu.vue
  • src/runtime/components/PageAnchors.vue
  • src/runtime/components/PageLinks.vue
  • src/runtime/components/ProgressGroup.vue
  • src/runtime/components/RadioGroup.vue
  • src/runtime/components/Select.vue
  • src/runtime/components/SelectMenu.vue
  • src/runtime/components/Splitter.vue
  • src/runtime/components/Stepper.vue
  • src/runtime/components/Tabs.vue
  • src/runtime/components/Timeline.vue
  • src/runtime/components/Tree.vue
  • src/runtime/components/content/ContentNavigation.vue
  • src/runtime/components/content/ContentSurround.vue
  • src/runtime/components/content/ContentToc.vue

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change updates 25 exported ui properties across component item and content link interfaces. Each selected slot configuration now uses Partial<Pick<...>> instead of Pick<...>. Callers can provide only selected slot overrides. No runtime logic or templates changed.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d03e9

No actionable current-head risk is established; the PR is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #6974 requires partial per-item ui overrides for NavigationMenuItem and similar types. The PR changes NavigationMenuItem.ui from Pick<...> to Partial<Pick<...>>, so a value such as `{ …
Out of Scope Changes check ✅ Passed The changes only wrap selected slot Pick types in Partial for per-item or per-link ui fields. Issue #6974 explicitly includes similar components, so these changes support the same type-correctio…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Title check ✅ Passed The title clearly and concisely describes the main change: allowing partial per-item ui overrides across components.
Description check ✅ Passed The description is directly related to the changeset. It explains the TypeScript issue, the Partial<Pick<...>> fix, runtime behavior, affected components, and linked issue.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@codspeed

codspeed Bot commented Sep 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing lazerg:fix/issue-6974-partial-item-ui (d03e9c3) with v4 (a96823d)

Open in CodSpeed

@pkg-pr-new

pkg-pr-new Bot commented Sep 18, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6979

commit: d03e9c3

@benjamincanac benjamincanac left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! 😊

@benjamincanac
benjamincanac merged commit c617565 into nuxt:v4 Sep 21, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationMenuItem's ui type requires every slot key instead of allowing partial overrides

2 participants