feat(cctv): green count markers that grow with the count and carry a camera icon

A count marker now says what it counts and how much:

- Its height grows with the count, from 40 px for two cameras to 58 px for
  several thousand, with clear fill around the digits.
- A small single-camera map icon sits under the top of the ring and the
  number just below the centre, so the two never touch. The icon is built
  from the same sprite as a single camera on the map.
- Thousands print as 1.7K or 12K in every UI language.
- The camera layer is green: count markers and idle single cameras share
  the colour, the active camera stays gold and live-video cameras violet.
This commit is contained in:
German Khokhlov committed 2026-11-18 20:48:33 +04:00
1 parent aabfa5e084
commit c536d22ff0
10 files changed
+806 -215

No files matched your search

+27 -1
View File
@@ -1,7 +1,7 @@
// src/layers/cctv/rendering.test.mjs
// Icon colors under focus de-emphasis (#1200): the focus pass fades each icon
// from the same base color the coverage refresh assigns, so a video-feed camera
// stays violet while it dims instead of falling back to the idle cyan.
// stays violet while it dims instead of falling back to the idle green.
// Teardown lets go of the icon set of the viewer that drew it.
import { test } from 'node:test';
import assert from 'node:assert/strict';
@@ -114,6 +114,32 @@ test('focus de-emphasis fades each icon from its own color', () => {
}
});
test('focus uses the painted half-width and half-height of each count', () => {
const markers = [
{ width: 40, height: 40 },
{ width: 72, height: 58 },
];
const sizes = [];
const rendering = createRendering({
state: { _counts: { markers } },
services: {
focus: {
focusPassIsNeeded: () => true,
advanceSpriteFocus(_owner, { spriteHalfWidthPx, spriteHalfHeightPx }) {
sizes.push([spriteHalfWidthPx, spriteHalfHeightPx]);
return { factor: 1 };
},
focusAlphaNeedsWrite: () => false,
},
},
});
rendering.applyCctvFocusDeemphasis({});
assert.deepEqual(sizes, [
[20, 20],
[36, 29],
]);
});
test('the icons go with the viewer that drew them, whichever tears down', () => {
const first = {};
const second = {};