Pickers: Show the number of selected items in the tree and collection item picker modals - #23606
Conversation
Add a localized selected-items footer to the collection and tree picker modals when multi-select is enabled. This keeps the current selection visible as users browse or search, making bulk picking clearer.
|
Claude finished @madsrasmussen's task in 3m 41s —— View job PR ReviewTarget: Adds a reactive "N items selected" count bar above the footer in
Suggestions
Approved with Suggestions for improvementGood to go, but please carefully consider the importance of the suggestions. Labels applied: |
There was a problem hiding this comment.
Pull request overview
Adds a persistent, localized “selected items” count bar to the multi-select variants of the tree picker and collection item picker modals, keeping selection feedback visible while browsing/searching.
Changes:
- Track selection length in both picker modals and render a footer info bar when
multipleis enabled and there is a selection. - Add styling for the new footer bar to match existing “selected” action bar visuals.
- Introduce a new localization key (
picker_selectedCount) and provide translations across several languages.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/core/tree/tree-picker-modal/tree-picker-modal.element.ts | Adds selection count state and renders a footer selection-count bar for multi-select tree picker. |
| src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-item-picker-modal/collection-item-picker-modal.element.ts | Adds selection count state and renders a footer selection-count bar for multi-select collection item picker. |
| src/Umbraco.Web.UI.Client/src/assets/lang/zh.ts | Adds picker.selectedCount localization entry. |
| src/Umbraco.Web.UI.Client/src/assets/lang/zh-tw.ts | Adds picker.selectedCount localization entry. |
| src/Umbraco.Web.UI.Client/src/assets/lang/vi.ts | Adds picker.selectedCount localization entry. |
| src/Umbraco.Web.UI.Client/src/assets/lang/tr.ts | Adds picker.selectedCount localization entry. |
| src/Umbraco.Web.UI.Client/src/assets/lang/sv.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/ro.ts | Adds picker.selectedCount localization entry (language-specific pluralization rules). |
| src/Umbraco.Web.UI.Client/src/assets/lang/pt.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/pt-br.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/nl.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/nb.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/ko.ts | Adds picker.selectedCount localization entry. |
| src/Umbraco.Web.UI.Client/src/assets/lang/ja.ts | Adds picker.selectedCount localization entry. |
| src/Umbraco.Web.UI.Client/src/assets/lang/it.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/fr.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/es.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/en.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/de.ts | Adds picker.selectedCount localization entry (with pluralization). |
| src/Umbraco.Web.UI.Client/src/assets/lang/da.ts | Adds picker.selectedCount localization entry (with pluralization). |
Suppressed comments (2)
src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-item-picker-modal/collection-item-picker-modal.element.ts:86
_selectionConfiguration.selectionfilters outnullvalues (seeupdated()), but_selectionCountis based on the raw selection array length. If the modal value ever containsnull, the UI will show fewer selected items than the count shown in the new footer bar. Consider counting only non-null uniques to keep the count consistent with what the collection components can actually represent.
This issue also appears on line 189 of the same file.
#observePickerSelection() {
this.observe(
this.#pickerContext.selection.selection,
(selection) => {
this._selectionCount = selection.length;
this.updateValue({ selection });
this.requestUpdate();
},
'umbPickerSelectionObserver',
);
src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-item-picker-modal/collection-item-picker-modal.element.ts:195
#renderSelectionCount()currently checks_hasSelection, which can be true even when the displayed count is 0 (e.g., if the selection array contains onlynullvalues). After filteringnullvalues for_selectionCount, it’s safer to render the bar only when_selectionCount > 0.
#renderSelectionCount() {
if (!this._selectionConfiguration.multiple || !this._hasSelection) return nothing;
return html`
<div id="selection-info" slot="footer">${this.localize.term('picker_selectedCount', this._selectionCount)}</div>
`;
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
We will fix the aria-attribute in another PR. We need to address this issue across the different selection experiences in the back office. A live region must already be in the accessibility tree before its content changes. Adding the attribute to a node that is inserted together with its text produces inconsistent results across NVDA, JAWS, and VoiceOver. This means we will need to duplicate the markup and visually hide it. It will make sense to add this once we have it componentized. |



Description
Adds a selection count to the two picker modals, so the current selection stays visible while
browsing or searching.
Picking several items in a tree or collection picker gives no running feedback today. Once you
expand into a branch or start searching, the already-picked items scroll out of view and the only
signal that anything is selected is the enabled Choose button. This adds a bar above the modal
footer showing how many items are currently selected.
What changed
umb-tree-picker-modalandumb-collection-item-picker-modaleach render a info barin
umb-body-layout'sfooterslot, directly above the Close/Choose actions.browsing, searching and paging.
The bar is deliberately duplicated in both modals to keep this change contained within the two pickers it targets. We can generalize it later.
How to test
Multi-select tree picker — bar shows
deselect.
Single-select picker — no bar
Collection item picker
configured for multiple selection.