Content
View differences
Updated by Alexander Coles 1 day ago
**As** a developer using `Primer::Alpha::SelectPanel` \[enter role of user\]
**I want to** show a live count of selected items in the show button without writing a custom Stimulus controller \[enter objective\]
**so that** multi-select panels (e.g. backlog filters) display selection counts with zero boilerplate. \[enter desired result\]
**Acceptance criteria**
* `with_show_button(counter: true)` renders a trailing `Counter` that updates on selection.
<br>
**Technical notes**
* The counter reflects the true tracked selection count (survives filtering / remote re-fetch), not just visible rows.
* Counter hides at zero; shows/updates live on select/deselect <br>
**Permissions and on initial connect.
visibility considerations**
* `counter_arguments:` customizes the Counter (scheme, limit, etc.); the `data-target` _To whom is forced and cannot be unwired. this feature visible?_
* `counter: true` combined with `icon:` raises `ArgumentError` outside production.
* Existing `dynamic_label` text behaviour _When is unchanged and may run simultaneously with the counter. it not visible?_
**Technical notes** **Translation considerations**
* Catalyst target `select-panel.dynamicLabelCount`; client writes `selectedItems.length` to `textContent` _Key terms and toggles `hidden`.
* Ruby sugar on phrases in the `show_button` slot auto-wires `Button#with_trailing_visual_counter` via the `merge_data` helper.
* Branch: `feature/DREAM-738-select-panel-dynamic-counter` key languages_
**Out of scope**
* Client-rendered list <br>
_Set the_ **To be informed/consulted teams** _field to include all teams necessary to be informed of selected labels, configurable separator, `<template>`/slot rendering, client-side number formatting. the changes._
**I want to** show a live count of selected items in the show button without writing a custom Stimulus controller
**so that** multi-select panels (e.g. backlog filters) display selection counts with zero boilerplate.
**Acceptance criteria**
* `with_show_button(counter: true)` renders a trailing `Counter` that updates on selection.
**Technical notes**
* Counter hides at zero; shows/updates live on select/deselect
**Permissions
* `counter: true` combined with `icon:` raises `ArgumentError` outside production.
* Existing `dynamic_label` text behaviour
**Technical notes**
* Catalyst target `select-panel.dynamicLabelCount`; client writes `selectedItems.length` to `textContent`
* Ruby sugar on
* Branch: `feature/DREAM-738-select-panel-dynamic-counter`
**Out of scope**
* Client-rendered list
_Set the_ **To be informed/consulted teams** _field to include all teams necessary to be informed