Files
meshcore-analyzer/.github
Kpa-clawbot 0f7c03ccaf fix(#1293): role-aware marker shapes + outline-ring highlight (#1334)
Fixes #1293

## What

Marker shape now varies per role (WCAG 1.4.1 — colour is no longer the
only carrier of role identity), and the live map's selection/highlight
no longer stacks same-colour concentric markers.

| Role      | Shape    | Why |
|-----------|----------|-----|
| repeater  | circle   | default, most common |
| companion | square   | flat sides, easy to distinguish from circle |
| room      | hexagon  | tessellation hint = group |
| sensor    | triangle | "alert-like" silhouette |
| observer  | diamond  | network-infrastructure suggestion |

Existing role colours are preserved; the shape is the new differentiator
so red/green colourblind operators can still tell roles apart.

## How

- `public/roles.js`: new `window.ROLE_SHAPES` map (single source of
truth), `ROLE_STYLE.shape` synced, shared
`window.makeRoleMarkerSVG(role, color, size)` helper that emits
self-contained `<svg>` strings — including a new `hexagon` branch.
- `public/map.js`: `makeMarkerIcon` switch picks up the `hexagon` case.
- `public/live.js`: `addNodeMarker` now builds an `L.divIcon` via
`makeRoleMarkerSVG` (was a flat `L.circleMarker` — colour only). A
hidden stroke-only `_highlightRing` is allocated per marker; `pulseNode`
grows + fades that ring instead of recolouring the marker fill, so the
blue-on-blue concentric stacking the issue called out cannot occur.
`rescaleMarkers`, `pruneStaleNodes`, matrix mode toggling now drive the
divIcon via small DOM helpers.
- `public/live.js` role legend: emits SVG shape + colour swatch (was a
bare coloured dot).
- `public/live.css`: `.live-shape-swatch` wrapper for the SVG legend
swatches.

## TDD

Red commit: `7e5e2d95` — `test-issue-1293-marker-shapes.js` asserts the
shape map, helper, hexagon branches, divIcon switch in `addNodeMarker`,
SVG-based legend, and outline-ring highlight (no same-colour fill
overlay). Wired into `deploy.yml` JS unit tests.

Green commit: `fb33ca96`.

## Design check

Coblis simulator (deuteranopia / protanopia / tritanopia) — reviewer to
run on the staging build; shapes carry the signal independent of hue, so
all role categories should remain distinguishable. Existing colours are
retained per the issue's "keep colours, vary shape" guidance.

## Preflight

`bash ~/.openclaw/skills/pr-preflight/scripts/run-all.sh origin/master`
— all gates pass.

---------

Co-authored-by: corescope-bot <bot@corescope>
2026-05-23 20:54:12 -07:00
..