Public: anyone can read this; the crew can change it.
`.map-tool` leaves the map's stylesheet: no control renders it #5274
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/5251-map-tool-leaves-the-map-s-stylesheet-no → main 1 commit fork
3 files
changed +4
−7
docs/DESIGN.md −1
| @@ -591,7 +591,6 @@ the same line (#4888). | ||
| 591 | 591 | - `.map-rule` |
| 592 | 592 | - `.map-svg` |
| 593 | 593 | - `.map-title` |
| 594 | - `.map-tool` | |
| 595 | 594 | - `.map-who` |
| 596 | 595 | - `.map-who-i` |
| 597 | 596 | - `.map-who-n` |
src/web/pages/map.ts −5
| @@ -1121,10 +1121,6 @@ export const mapCss = /* css */ ` | ||
| 1121 | 1121 | .map-canvas.is-view .map-svg { height: 100%; } |
| 1122 | 1122 | .map-svg text { font-family: var(--font); pointer-events: none; } |
| 1123 | 1123 | .map-canvas > [role="group"] { position: absolute; top: 8px; right: 8px; gap: 4px; } |
| 1124 | .map-tool { min-width: 26px; height: 24px; padding: 0 7px; border: 0; background: transparent; color: var(--muted-fg); font-size: 12.5px; font-weight: 550; line-height: 1; cursor: pointer; } | |
| 1125 | .map-tool + .map-tool { border-left: 1px solid var(--border); } | |
| 1126 | .map-tool:hover { background: var(--muted); color: var(--fg); } | |
| 1127 | .map-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } | |
| 1128 | 1124 | |
| 1129 | 1125 | /* ---- cards ---- */ |
| 1130 | 1126 | .map-node { cursor: pointer; outline: none; } |
| @@ -1183,7 +1179,6 @@ export const mapCss = /* css */ ` | ||
| 1183 | 1179 | .map-card, .map-title { transition: none; } |
| 1184 | 1180 | } |
| 1185 | 1181 | @media (forced-colors: active) { |
| 1186 | .map-tool:focus-visible { outline: 2px solid Highlight; } | |
| 1187 | 1182 | .map-node:focus-visible .map-card { stroke: Highlight; stroke-width: 3; } |
| 1188 | 1183 | } |
| 1189 | 1184 | `; |
test/map.test.ts +4 −1
| @@ -418,7 +418,10 @@ describe("the map, per app and across the forge", () => { | ||
| 418 | 418 | const page = await ( |
| 419 | 419 | await fetch(`${base}/alice/engine/map`, { headers: { cookie } }) |
| 420 | 420 | ).text(); |
| 421 | // The stylesheet still holds the old rules (#4239 removes them); the markup must not. | |
| 421 | // Neither the markup nor the stylesheet holds the old names (#5251 retired the rules). | |
| 422 | const styles = (page.match(/<style[\s\S]*?<\/style>/g) ?? []).join(""); | |
| 423 | expect(styles).toContain(".map-canvas"); | |
| 424 | expect(styles).not.toMatch(/\.map-tools?\b/); | |
| 422 | 425 | const markup = page.replace(/<style[\s\S]*?<\/style>/g, "").replace(/<script[\s\S]*?<\/script>/g, ""); |
| 423 | 426 | expect(markup).not.toMatch(/class="[^"]*\bmap-tools?\b/); |
| 424 | 427 | const group = markup.match(/<div[^>]*role="group"[^>]*aria-label="Zoom"[^>]*>/)?.[0] ?? ""; |
new above
offline