Skip to content

regression(map): #1357 cluster role pills lost the count number — show letter+count not letter-only #1360

@Kpa-clawbot

Description

@Kpa-clawbot

Symptom

Operator feedback on the #1357 deploy: cluster role pills now show only the role letter (R/C/M/S/O) — the per-role count number is no longer rendered. The count is present in aria-label / title for screen readers, but a sighted operator can't see at a glance "this cluster has 60 repeaters and 30 companions."

Pre-#1357: pills showed the count number on the colored fill.
Post-#1357: pills show only the letter.

Root cause

In the #1357 fix for the WCAG 1.4.1 violation, the pill body was switched from n (count) to letter (role identity). The intent was to add the letter as the primary non-color carrier of role identity; the regression was dropping the count instead of pairing them.

public/map.js makeClusterIcon builds: <span class="mc-pill">R</span> where it used to be <span class="mc-pill">60</span>.

Fix

Pill body becomes <letter><count> (e.g. R60, C30). Letter is the WCAG carrier; count is the data. Both at 10px monospace fit in the existing pill width up to 4-digit counts.

  • DOM: <span class="mc-pill">R60</span>
  • aria-label="60 repeaters" (unchanged, still screen-reader friendly).
  • Min-width may need a bump if 3+ digit counts overflow; verify with a synthetic 1000-node cluster scenario.

Acceptance criteria

  • Every visible role pill in a cluster renders BOTH the letter and the count, concatenated (e.g. R60, C30, M5, S1, O2).
  • aria-label and title on each pill remain unchanged ("N <role>s").
  • All five role letters still derived from ROLE_LETTERS (no hardcoded letters in DOM build).
  • Existing fix(#1356): WCAG 2.2 AA map a11y — cluster bubbles, role pills, multi-byte labels #1357 tests still pass — letter assertions remain valid because letter is still in pill body.
  • New assertion: pill body matches /^[RCMSO]\d+$/ for non-zero counts.
  • WCAG 1.4.3 small-text contrast still passes (dark #1a1a1a on Wong hues, unchanged).
  • Visual: 3-digit count fits without overflow; 4+ digit gets handled gracefully (CSS overflow or truncation).

Out of scope

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions