You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(SelectMenu/InputMenu): add a limit for visible selected labels - #7480
Add an optional maxSelectedLabels prop to SelectMenu and InputMenu in multiple mode. When the selection exceeds the limit, the component shows a localized count such as “5 selected”. Set the limit to 0 to show the count whenever at least one item is selected.
The #selection-summary slot exposes count so apps can show context-specific text such as “5 countries selected”.
InputMenu keeps its two-step Backspace behavior while the summary is visible. With an empty input, the first press highlights the summary and the second removes the last selected item.
No actionable comments were generated in the recent review.
Walkthrough
InputMenu and SelectMenu add a maxSelectedLabels prop and a selection-summary slot for multiple-selection mode. When the selected-item count exceeds the configured non-negative limit, each component displays the custom summary or a translated default. InputMenu hides individual tags while keeping them mounted. Locale messages, component tests, and documentation are also added.
Merge Risk: Minimal · up to ed8c8 · assessed changes only
Path filters excluded changed files. This rating applies only to the assessed changes.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the feature added: an optional limit on visible selected labels in SelectMenu and InputMenu. The changeset adds maxSelectedLabels to both components, a selection-summary slot, locale s…
Linked Issues check
Issue #6759 has one direct, open, coding-related scope. Its requirements are: (1) an optional maxSelectedLabels prop on SelectMenu and InputMenu; (2) a summary, such as '5 items selected', when …
Out of Scope Changes check
All changes connect to issue #6759 or to its direct implementation: - SelectMenu.vue and InputMenu.vue: the prop, the slot, and the summary rendering. - src/runtime/types/locale.ts and the local…
Description check
The description states that the PR adds an optional maxSelectedLabels prop to SelectMenu and InputMenu in multiple mode. It also explains the count display at the limit, the selection-summary slot exp…
Full details: Title check
Explanation
The title names the feature added: an optional limit on visible selected labels in SelectMenu and InputMenu. The changeset adds maxSelectedLabels to both components, a selection-summary slot, locale strings, and tests, so the title matches the main change. Wording follows the conventional commit style used by the author.
Full details: Linked Issues check
Explanation
Issue #6759 has one direct, open, coding-related scope. Its requirements are: (1) an optional maxSelectedLabels prop on SelectMenu and InputMenu; (2) a summary, such as '5 items selected', when the selection exceeds the limit; (3) a slot or render function to customise the summary text. The changes in the reviewed head implement each requirement:
Requirement 1: maxSelectedLabels?: number is added to SelectMenuProps and InputMenuProps. The limit is applied as Math.max(0, maxSelectedLabels).
Requirement 2: In multiple mode, when the selected count exceeds the limit, both components show a summary. The default text is the localised selection.summary message, added to the locale files and to the Messages type. SelectMenu.vue replaces the joined values with the summary. InputMenu.vue hides the tags but keeps them mounted.
Requirement 3: A selection-summary slot receives count and ui. It is declared in SelectMenuSlots and InputMenuSlots.
Tests: SelectMenu.spec.ts and InputMenu.spec.ts cover the summary threshold, the equal-to-limit case, and the custom slot.
The assessment relies on the whole-PR summary and the spec and documentation descriptions. I did not inspect the source hunks directly. Snapshot files were excluded by the ignored-files rule, so they were not used as evidence.
Full details: Out of Scope Changes check
Explanation
All changes connect to issue #6759 or to its direct implementation:
SelectMenu.vue and InputMenu.vue: the prop, the slot, and the summary rendering.
src/runtime/types/locale.ts and the locale files: the selection.summary message needed for the default localised text. The issue asks for localised count text, so these support the requirement.
src/theme/input-menu.ts: a selectionSummary theme slot for styling the summary. This supports the summary display.
InputMenu two-step Backspace behaviour: not named in the issue. It is a supporting behaviour. Without it, Backspace would remove hidden selected items with no visible feedback. It is limited to the summary-visible state and does not change other behaviour.
Documentation in input-menu.md and select-menu.md: documents the new prop and slot.
No unrelated functional change was identified. The SelectMenu documentation section is marked 'Soon'. This is a documentation status choice and does not indicate out-of-scope code.
Full details: Description check
Explanation
The description states that the PR adds an optional maxSelectedLabels prop to SelectMenu and InputMenu in multiple mode. It also explains the count display at the limit, the selection-summary slot exposing count, and the two-step Backspace behaviour in InputMenu. The changeset includes these components, the locale messages, and the documentation, so the description matches the changes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between bf93b9c and ed8c83e.
Files ignored due to path filters: 2
test/components/__snapshots__/InputMenu-vue.spec.ts.snap is excluded by !**/*.snap
test/components/__snapshots__/InputMenu.spec.ts.snap is excluded by !**/*.snap
Files selected for processing: 71
docs/content/docs/2.components/input-menu.md
docs/content/docs/2.components/select-menu.md
src/runtime/components/InputMenu.vue
src/runtime/components/SelectMenu.vue
src/runtime/locale/ar.ts
src/runtime/locale/az.ts
src/runtime/locale/be.ts
src/runtime/locale/bg.ts
src/runtime/locale/bn.ts
src/runtime/locale/ca.ts
src/runtime/locale/ckb.ts
src/runtime/locale/cs.ts
src/runtime/locale/da.ts
src/runtime/locale/de.ts
src/runtime/locale/de_ch.ts
src/runtime/locale/el.ts
src/runtime/locale/en.ts
src/runtime/locale/es.ts
src/runtime/locale/et.ts
src/runtime/locale/eu.ts
src/runtime/locale/fa_ir.ts
src/runtime/locale/fi.ts
src/runtime/locale/fr.ts
src/runtime/locale/gl.ts
src/runtime/locale/he.ts
src/runtime/locale/hi.ts
src/runtime/locale/hr.ts
src/runtime/locale/hu.ts
src/runtime/locale/hy.ts
src/runtime/locale/id.ts
src/runtime/locale/is.ts
src/runtime/locale/it.ts
src/runtime/locale/ja.ts
src/runtime/locale/ka.ts
src/runtime/locale/kk.ts
src/runtime/locale/km.ts
src/runtime/locale/ko.ts
src/runtime/locale/ky.ts
src/runtime/locale/lb.ts
src/runtime/locale/lo.ts
src/runtime/locale/lt.ts
src/runtime/locale/lv.ts
src/runtime/locale/mn.ts
src/runtime/locale/ms.ts
src/runtime/locale/nb_no.ts
src/runtime/locale/nl.ts
src/runtime/locale/pl.ts
src/runtime/locale/pt.ts
src/runtime/locale/pt_br.ts
src/runtime/locale/ro.ts
src/runtime/locale/ru.ts
src/runtime/locale/sk.ts
src/runtime/locale/sl.ts
src/runtime/locale/sq.ts
src/runtime/locale/sr.ts
src/runtime/locale/sr_latn.ts
src/runtime/locale/sv.ts
src/runtime/locale/tg.ts
src/runtime/locale/th.ts
src/runtime/locale/tr.ts
src/runtime/locale/ug_cn.ts
src/runtime/locale/uk.ts
src/runtime/locale/ur.ts
src/runtime/locale/uz.ts
src/runtime/locale/vi.ts
src/runtime/locale/zh_cn.ts
src/runtime/locale/zh_tw.ts
src/runtime/types/locale.ts
src/theme/input-menu.ts
test/components/InputMenu.spec.ts
test/components/SelectMenu.spec.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Merging this PR will improve performance by 37.53%
1 warning
⚠️1 benchmark with a significant change ran on different hardware
Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
Resolves #6759
❓ Type of change
📚 Description
Add an optional
maxSelectedLabelsprop toSelectMenuandInputMenuin multiple mode. When the selection exceeds the limit, the component shows a localized count such as “5 selected”. Set the limit to0to show the count whenever at least one item is selected.The
#selection-summaryslot exposescountso apps can show context-specific text such as “5 countries selected”.InputMenukeeps its two-step Backspace behavior while the summary is visible. With an empty input, the first press highlights the summary and the second removes the last selected item.📝 Checklist