Public: anyone can read this; the crew can change it.

`.map-tool` leaves the map's stylesheet: no control renders it #5274

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/5251-map-tool-leaves-the-map-s-stylesheet-no → main 1 commit fork

  • Merged. mason/5251-map-tool-leaves-the-map-s-stylesheet-no was merged into main as 2c0b694.

Review

Sign in to review this change.
3 files changed +4 −7
docs/DESIGN.md −1
@@ -591,7 +591,6 @@ the same line (#4888).
591591 - `.map-rule`
592592 - `.map-svg`
593593 - `.map-title`
594 - `.map-tool`
595594 - `.map-who`
596595 - `.map-who-i`
597596 - `.map-who-n`
src/web/pages/map.ts −5
@@ -1121,10 +1121,6 @@ export const mapCss = /* css */ `
11211121 .map-canvas.is-view .map-svg { height: 100%; }
11221122 .map-svg text { font-family: var(--font); pointer-events: none; }
11231123 .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; }
11281124
11291125 /* ---- cards ---- */
11301126 .map-node { cursor: pointer; outline: none; }
@@ -1183,7 +1179,6 @@ export const mapCss = /* css */ `
11831179 .map-card, .map-title { transition: none; }
11841180 }
11851181 @media (forced-colors: active) {
1186 .map-tool:focus-visible { outline: 2px solid Highlight; }
11871182 .map-node:focus-visible .map-card { stroke: Highlight; stroke-width: 3; }
11881183 }
11891184 `;
test/map.test.ts +4 −1
@@ -418,7 +418,10 @@ describe("the map, per app and across the forge", () => {
418418 const page = await (
419419 await fetch(`${base}/alice/engine/map`, { headers: { cookie } })
420420 ).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/);
422425 const markup = page.replace(/<style[\s\S]*?<\/style>/g, "").replace(/<script[\s\S]*?<\/script>/g, "");
423426 expect(markup).not.toMatch(/class="[^"]*\bmap-tools?\b/);
424427 const group = markup.match(/<div[^>]*role="group"[^>]*aria-label="Zoom"[^>]*>/)?.[0] ?? "";

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs