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
Audited under ariston-ui Wave AshUI-3.7 comp-fidelity audit. The :segmented_button_group canonical widget is missing a count prop per segment — comps show count badges like "ADRs (12)".
Comp gap (audit finding EX-6, extension table line 241)
Comps for Explorer filter bar show segments like "ADRs (12)", "Specs (8)", "Plans (3)" — segment label + count badge. The canonical widget currently accepts {value, label} per option.
Proposed extension
Adding optional count attr per option:
options: [%{value: term(),label: String.t(),count: integer()|nil# NEW; default nil; when set, renders count badge after label}]
Default value rationale
count: nil = no badge rendered (default behavior preserved)
Open questions for Pascal
Badge shape: inline "(N)" parenthetical, or styled badge (rounded background, separate from label)? Comp suggests styled badge.
Position: trailing (after label) or leading? Comp shows trailing.
Zero-count behavior: hide badge entirely, render "0", render "—"? Comp examples don't clarify. Proposal: show badge with "0" for explicit zero-count categories; hide for nil.
Large counts: cap at "99+"? Spec-it explicitly or leave it consumer-side?
Composition with :unread_badge: should we compose with the existing :unread_badge canonical widget (cleanest), or render inline (smallest delta)? :unread_badge already has threshold-capping logic.
Loading state: when count is being computed (e.g., async filter), should there be a :loading placeholder? Out of scope for v1?
ARIA: badge gets aria-label="{count} {label}" for screen readers? Or aria-hidden="true" since the label includes the count? Per WCAG, redundant text isn't a problem.
ARIA implications
Badge: <span class="live-ui-segmented-button-group-option-count" aria-hidden="true">{count}</span> (label includes accessible context)
Alternatively: <span class="...-count" aria-label="{count} items">{count}</span> if standalone semantic
Cross-references
Comp-audit: ariston-ui docs/wave-ashui-3-7-comp-fidelity-audit.md extension table line 241
DRAFT extension proposal — Pascal's design call on composition with :unread_badge (per Q5) determines the implementation shape. Small extension if inline; composition refactor if :unread_badge reuse.
Context
Audited under ariston-ui Wave AshUI-3.7 comp-fidelity audit. The
:segmented_button_groupcanonical widget is missing acountprop per segment — comps show count badges like "ADRs (12)".Canonical-kind grep proof:
packages/unified-ui/lib/unified_ui/widget_components.ex:85—kind: :segmented_button_group, family: :form_control_and_composerpackages/live_ui/lib/live_ui/renderer.exdef render(%{element: %Element{kind: :segmented_button_group}})— confirm current option shapeComp gap (audit finding EX-6, extension table line 241)
Comps for Explorer filter bar show segments like "ADRs (12)", "Specs (8)", "Plans (3)" — segment label + count badge. The canonical widget currently accepts
{value, label}per option.Proposed extension
Adding optional
countattr per option:Default value rationale
count: nil= no badge rendered (default behavior preserved)Open questions for Pascal
nil.:unread_badge: should we compose with the existing:unread_badgecanonical widget (cleanest), or render inline (smallest delta)?:unread_badgealready has threshold-capping logic.:loadingplaceholder? Out of scope for v1?aria-label="{count} {label}"for screen readers? Oraria-hidden="true"since the label includes the count? Per WCAG, redundant text isn't a problem.ARIA implications
<span class="live-ui-segmented-button-group-option-count" aria-hidden="true">{count}</span>(label includes accessible context)<span class="...-count" aria-label="{count} items">{count}</span>if standalone semanticCross-references
docs/wave-ashui-3-7-comp-fidelity-audit.mdextension table line 241:unread_badgeprecedent:packages/unified-ui/lib/unified_ui/widget_components.ex:204(composition consideration per Q5)docs/wave-ashui-3-7-a-retrospective.mdStatus
DRAFT extension proposal — Pascal's design call on composition with
:unread_badge(per Q5) determines the implementation shape. Small extension if inline; composition refactor if:unread_badgereuse.