fix(#1360): cluster pill shows letter+count — restore count visibility regressed by #1357#1362
Conversation
Pure-string assertions over public/map.js mirroring #1356 pattern. Fails on current master where pill body is just `letter`. Wires test-issue-1360-pill-letter-count.js into deploy.yml right after test-issue-1356-map-a11y.js.
Restore the count number that #1357 inadvertently dropped from cluster role pills. The pill body now concatenates the role letter (WCAG carrier from #1356) with the per-role count (operator-facing data), producing R60 / C30 / M5 / S1 / O2 style rendering on the map. aria-label and title unchanged ("60 repeaters") — already correct. DOM, classes, CSS variables, border-style ramp, multi-byte labels — all untouched. Verified locally: - test-issue-1360-pill-letter-count.js: PASS - test-issue-1356-map-a11y.js: 40/40 PASS (letter still first char) - test-issue-1293-marker-shapes.js: 23/23 PASS - test-marker-outline-weight.js: 6/6 PASS
Kent Beck Gate (round 1) — TDD + test qualityVerdict: APPROVED TDD red→green history (verified)
Six Questions1. Show me the test that fails when this change is reverted. 2. Smallest test for the regression. 3. Could a wrong impl pass?
4. Edge cases NOT tested.
5. Test names describe behavior or implementation? 6. Pure-string approach defensible? Must-fix0. Out-of-scope nits (for future hardening, not this PR)
Gate verdict: PASS — ship it. |
Independent review (round 1)Verdict: NEEDS-WORK (2 must-fix) Tiny, well-scoped diff. The 1-line change in Must-fix
Out-of-scope (not blockers)
Confirmed clean
|
Adversarial follow-up to PR #1362: JS cap (public/map.js, makeClusterIcon): - If per-role count n > 999, render pill body as letter+"999+" (e.g. "R999+") instead of letter+raw digits. Bounds visual width for pathological clusters. CSS guard (public/style.css, .mc-pill): - Add max-width: 4ch + overflow:hidden + text-overflow:ellipsis as defense-in-depth if a render slips past the JS cap. - Replaces prior overflow:visible (SC 1.4.12 letter-spacing) — the 4-char-cap content (letter + ≤4 digits) does not need aggressive letter-spacing overrides, so the tradeoff is acceptable. Tests (test-issue-1360-pill-letter-count.js): - +1 assertion: makeClusterIcon source contains the n > 999 → "999+" cap. - +2 assertions: .mc-pill rule declares max-width AND text-overflow:ellipsis. - Mutation-verified: removing the cap fails ONLY the new cap assertion. - Existing 6 #1360 assertions and full #1356 (40) suite stay green.
The defense-in-depth max-width:4ch added in #1362 clamps the BOX (including the 1px 3px padding), leaving ~2.5ch for text — enough for 'R6' but not 'R60', so multi-digit cluster pills render as 'R…'. Drop the max-width entirely. JS in map.js already caps counts at '999+' (max 5 chars: 'R999+'), which is the load-bearing safety. Keep overflow:hidden + text-overflow:ellipsis as belt-only graceful-degrade if the JS cap is ever bypassed. Also updates the #1360 follow-up test to match — the max-width assertion codified the over-aggressive guard, not behavior we want to preserve.
…igit count visibility (#1365) Red commit: 482ffe6 (CI: pending) ## What Drops `max-width: 4ch` from `.mc-cluster .mc-pill` in `public/style.css`. Keeps `overflow: hidden` + `text-overflow: ellipsis` as belt-only graceful degradation. ## Why #1362 added `max-width: 4ch` as defense-in-depth for the `999+` JS cap. But `4ch` is applied to the BOX including the `1px 3px` padding, so effective text width is ~2.5ch — enough for `R6` but not `R60`. Result: post-merge regression on staging where multi-digit cluster pills render `R…` instead of `R60`/`C30`. The JS cap in `public/map.js` already clamps counts to `999+` (max 5 chars: `R999+`). That's the load-bearing safety. The CSS `max-width` was overcaution and went too aggressive. Option A from the issue: drop the cap entirely, keep ellipsis as graceful-degrade if JS ever fails. ## TDD red→green - RED: `test-issue-1364-pill-no-clamp.js` asserts `.mc-pill` CSS does NOT contain `max-width: 4ch` (regression guard) and DOES contain `overflow: hidden` + `text-overflow: ellipsis` (graceful degradation). Fails on the unchanged CSS. - GREEN: deletes the `max-width: 4ch;` line from `.mc-pill`. Test passes. Wired into `.github/workflows/deploy.yml` alongside the #1360 test. ## Visual verification Open `/map` zoomed-out on staging. Cluster pills must render full counts (`R60`, `C30`, `R250`, capped `R999+`) — no `R…` ellipsis. No horizontal scrollbar even on synthetic 4-digit injection. Fixes #1364 --------- Co-authored-by: openclaw-bot <bot@openclaw.local>
Red commit: c0de33a (CI: https://github.com/Kpa-clawbot/CoreScope/actions/runs/26416117686)
Green commit: c268248 — CI: https://github.com/Kpa-clawbot/CoreScope/actions/runs/26416069319
What
Fix #1360 regression: cluster role pills on
/mapshow ONLY the role letter (R/C/M/S/O); the per-role count number that was visible pre-#1357 is gone. This PR restores the count by concatenating it after the letter inside the pill body, so each pill renders asR60,C30,M5, etc.public/map.jsmakeClusterIcon: pill body becomesletter + n(wasletter).aria-label/title("60 repeaters") untouched — already correct.--mc-*constants, border-style ramp, multi-byte labels — untouched.Adversarial follow-up (commit on top of green)
makeClusterIconclampsn > 999→"999+", so pathological clusters render as e.g.R999+instead ofR10000. Pill width stays bounded..mc-pill:max-width: 4ch; overflow: hidden; text-overflow: ellipsis;as defense-in-depth if a render slips past the JS cap.Why
#1357 fixed WCAG 1.4.1 for cluster role pills by promoting the role letter to the pill body, but in doing so dropped the count number that sighted operators relied on for at-a-glance per-role counts. The letter is the WCAG carrier; the count is the data. Both belong in the pill body — they always did before #1357. The audit's intent was to PAIR them, not REPLACE one with the other.
TDD red→green
c0de33a9): addedtest-issue-1360-pill-letter-count.jswith assertions that pill body concatenatesletter + nand is no longer the bareletter. Fails by assertion against currentmaster. Red CI: https://github.com/Kpa-clawbot/CoreScope/actions/runs/26416117686c268248d): one-line change inpublic/map.js(letter + '</span>'→letter + n + '</span>'). All assertions pass. Green CI: https://github.com/Kpa-clawbot/CoreScope/actions/runs/26416069319"999+"cap + CSS width guard + 3 new assertions. a11y(map): cluster bubbles + role pills + multi-byte hash labels encode signal by color only (WCAG 1.4.1) #1356 (40), a11y(map+legend): use shape variation per role/type (not color only) + avoid blue-on-blue dot stacking + colorblind-safe palette #1293, andmarker-outline-weighttests remain green..github/workflows/deploy.ymlright aftertest-issue-1356-map-a11y.js.Visual verification
Open https://analyzer.00id.net/#/map after deploy and confirm cluster pills display
R<count>,C<count>,M<count>, etc. (e.g.R60 C30 M5) instead of bare letters.aria-label="60 repeaters"remains for screen readers. For very large clusters, pills cap atR999+/C999+etc.Fixes #1360