diff --git a/frontend/src/app/pages/Dashboard/cards/AgentCard.tsx b/frontend/src/app/pages/Dashboard/cards/AgentCard.tsx index b977f696..6efb16af 100644 --- a/frontend/src/app/pages/Dashboard/cards/AgentCard.tsx +++ b/frontend/src/app/pages/Dashboard/cards/AgentCard.tsx @@ -1020,8 +1020,8 @@ const AgentCard: React.FC = ({ tiled={false} /> - {/* Map-pin rule: the capsule counter-zooms against the camera so its label stays legible zoomed out (12px at half zoom read as 6px). CSS zoom, not transform: it grows the LAYOUT box, so paint containment on the pill cannot clip it; at zoom 1 this is 1. */} - + {/* Map-pin rule, capped at 2x: the capsule counter-zooms so its label stays legible to about half zoom, then shrinks with the board like everything else (at 4x it dwarfed the cards at 18%, Haik). CSS zoom, not transform: it grows the LAYOUT box, so paint containment on the pill cannot clip it; at zoom 1 this is 1. */} + { + const fs = await import('node:fs'); + const url = await import('node:url'); + const here = url.fileURLToPath(new URL('.', import.meta.url)); + // The test runs from .test-build, so resolve the source next to it by name (both separators, Windows CI). + const candidates = [ + here + 'AgentCard.tsx', + here.replace(/([\\/])\.test-build([\\/])/, '$1src$2') + 'AgentCard.tsx', + ]; + const path = candidates.find((p) => fs.existsSync(p)); + assert.ok(path, `could not locate AgentCard.tsx from ${here}`); + const src = fs.readFileSync(path as string, 'utf8'); + const rule = src.match(/zoom: 'max\(1, min\((\d+), calc\(0\.9 \/ var\(--canvas-zoom, 1\)\)\)\)'/); + assert.ok(rule, 'the pill zoom rule must still be the one map-pin expression'); + assert.equal(Number(rule![1]), 2); +});