mirror of
https://github.com/expo/explore.git
synced 2026-11-15 17:32:23 -10:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
951d14dfe3 | ||
|
|
e8ca6b8fb4 | ||
|
|
18ba3d4069 | ||
|
|
da5cb12b16 |
No files matched your search
@@ -102,7 +102,7 @@ test("a recorded review opens on the real map and before/after evidence and surv
|
||||
await expect(page.locator(".collapsed-pr")).toContainText("PR #1");
|
||||
// The map is one card per screen; changed screens carry their diff status on the card.
|
||||
await expect(page.locator(".map-canvas .react-flow__node-screen")).toHaveCount(33);
|
||||
await expect(page.locator('.map-canvas .screen-screenshot-target[title="/games"]')).toBeVisible();
|
||||
await expect(page.locator('.map-canvas .screen-node-title[aria-label="Copy deep link /games"]')).toBeVisible();
|
||||
await expect(page.getByText("No report open")).toHaveCount(0);
|
||||
const menu = await openChangesMenu(page);
|
||||
// Changes lists the screens with something to see: the three with pixel changes, the added and the removed one.
|
||||
|
||||
+160
-8
@@ -127,6 +127,13 @@ async function expectMapScreenSelectionDimming(
|
||||
}));
|
||||
const hoverTargetCount = options.hoverTargetCount ?? 1;
|
||||
expect(hoverableDimmedIndexes.length).toBeGreaterThanOrEqual(hoverTargetCount);
|
||||
// A card fades through its frame's --map-card-opacity (the node itself stays opaque over the
|
||||
// connectors). The property is not animated, so it reads what hover asks for at once.
|
||||
const cardOpacities = () => screens.evaluateAll((nodes) => Object.fromEntries(nodes.map((node) => [
|
||||
node.getAttribute("data-id") ?? "",
|
||||
getComputedStyle(node.querySelector(":scope > .canvas-active-frame")!).getPropertyValue("--map-card-opacity").trim(),
|
||||
])));
|
||||
const restingOpacities = await cardOpacities();
|
||||
let lastHoverTarget = dimmed.nth(hoverableDimmedIndexes[0]!);
|
||||
|
||||
for (const index of hoverableDimmedIndexes.slice(0, hoverTargetCount)) {
|
||||
@@ -149,7 +156,9 @@ async function expectMapScreenSelectionDimming(
|
||||
return label.startsWith(`Edge from ${nodeId} to `) || label.endsWith(` to ${nodeId}`);
|
||||
}).length, hoverTargetId!);
|
||||
expect(directEdgeCount).toBeGreaterThan(0);
|
||||
// The hovered screen and every screen it shares an edge with stay bright; the rest recede.
|
||||
// The hovered screen and every screen it shares an edge with are marked related; nothing on
|
||||
// the map recedes while hovering, so the only changes are the subject ring, the incident
|
||||
// edges and the neighbours' frames.
|
||||
const neighbourIds = await allEdges.evaluateAll((edges, nodeId) => {
|
||||
const ids = new Set<string>([nodeId]);
|
||||
for (const edge of edges) {
|
||||
@@ -166,14 +175,15 @@ async function expectMapScreenSelectionDimming(
|
||||
await expect.poll(() => brightNodes.evaluateAll((nodes) => (
|
||||
nodes.map((node) => node.getAttribute("data-id") ?? "").sort()
|
||||
))).toEqual(neighbourIds);
|
||||
const receded = page.locator(
|
||||
".map-canvas .react-flow__node-screen:not(.graph-node-hover-related)",
|
||||
const unrelated = page.locator(
|
||||
".map-canvas .react-flow__node-screen:not(.graph-node-hover-related):not(.canvas-node-exit)",
|
||||
);
|
||||
if (await receded.count() > 0) {
|
||||
await expect.poll(() => receded.first().evaluate(
|
||||
(node) => Number.parseFloat(getComputedStyle(node).opacity),
|
||||
)).toBeGreaterThan(0.5);
|
||||
}
|
||||
const unrelatedIds = await unrelated.evaluateAll((nodes) => nodes.map((node) => node.getAttribute("data-id") ?? ""));
|
||||
expect(unrelatedIds.length).toBeGreaterThan(0);
|
||||
const hoverOpacities = await cardOpacities();
|
||||
expect(unrelatedIds.map((id) => hoverOpacities[id])).toEqual(unrelatedIds.map((id) => restingOpacities[id]));
|
||||
expect(await unrelated.evaluateAll((nodes) => nodes.every((node) => getComputedStyle(node).filter === "none"))).toBe(true);
|
||||
await expect(page.locator(".map-canvas .screen-open-hint:visible")).toHaveCount(0);
|
||||
const activeEdges = page.locator(
|
||||
".map-canvas .react-flow__edge.graph-edge-hover-related",
|
||||
);
|
||||
@@ -1998,6 +2008,148 @@ test("fits the visible Map screenshot frame to the capture's intrinsic ratio", a
|
||||
expect(metrics.slotBackground).toBe("rgba(0, 0, 0, 0)");
|
||||
});
|
||||
|
||||
/** Each Map card's --map-card-opacity by id: what fades its frame. The property is not animated. */
|
||||
function mapCardOpacities(page: Page) {
|
||||
return page.locator(".map-canvas .react-flow__node-screen:not(.canvas-node-exit)").evaluateAll((nodes) => (
|
||||
Object.fromEntries(nodes.map((node) => [
|
||||
node.getAttribute("data-id") ?? "",
|
||||
getComputedStyle(node.querySelector(":scope > .canvas-active-frame")!).getPropertyValue("--map-card-opacity").trim(),
|
||||
]))
|
||||
));
|
||||
}
|
||||
|
||||
/** Waits until the Map camera stops moving. */
|
||||
async function expectMapCameraAtRest(page: Page) {
|
||||
await expect(page.locator(".map-canvas.canvas-focus-animating")).toHaveCount(0);
|
||||
const viewport = page.locator(".map-canvas .react-flow__viewport");
|
||||
let transform = "";
|
||||
await expect.poll(async () => {
|
||||
const next = await viewport.evaluate((element) => getComputedStyle(element).transform);
|
||||
const resting = next === transform;
|
||||
transform = next;
|
||||
return resting;
|
||||
}).toBe(true);
|
||||
}
|
||||
|
||||
/** The first `candidates` card whose screenshot is under the pointer near its top, with `room` above and below. */
|
||||
async function hoverableMapScreen(candidates: Locator, room = 80) {
|
||||
const index = await candidates.evaluateAll((nodes, room) => nodes.findIndex((node) => {
|
||||
const target = node.querySelector(".screen-screenshot-target")!.getBoundingClientRect();
|
||||
const hit = document.elementFromPoint(target.left + target.width / 2, target.top + target.height / 4);
|
||||
return hit !== null && node.contains(hit) && target.top > room && target.bottom < window.innerHeight - room;
|
||||
}), room);
|
||||
expect(index).toBeGreaterThanOrEqual(0);
|
||||
return candidates.nth(index);
|
||||
}
|
||||
|
||||
test("hovering a Map screen fades nothing and says Open in Inspector in a tooltip below the card that keeps to it", async ({ page }) => {
|
||||
await serveSyntheticWorkspace(page);
|
||||
await page.goto("/map");
|
||||
const screens = page.locator(".map-canvas .react-flow__node-screen:not(.canvas-node-exit)");
|
||||
await expect(screens.first()).toBeVisible();
|
||||
await expectMapCameraAtRest(page);
|
||||
const resting = await mapCardOpacities(page);
|
||||
// A screen at one end of a secondary transition, which rests a little faded.
|
||||
const secondaryEnds = await page.locator(".map-canvas .react-flow__edge.graph-edge-secondary").evaluateAll((edges) => (
|
||||
[...new Set(edges.flatMap((edge) => /^Edge from (.+) to (.+)$/.exec(edge.getAttribute("aria-label") ?? "")?.slice(1) ?? []))]
|
||||
));
|
||||
expect(secondaryEnds.length).toBeGreaterThan(0);
|
||||
const node = await hoverableMapScreen(page.locator(
|
||||
secondaryEnds.map((id) => `.map-canvas .react-flow__node-screen[data-id="${id}"]`).join(", "),
|
||||
));
|
||||
const target = node.locator(".screen-screenshot-target");
|
||||
const heading = node.locator(".screen-node-heading");
|
||||
// The tooltip says what a click does; no native title tooltip joins it.
|
||||
await expect(target).not.toHaveAttribute("title");
|
||||
// Near the card's top, so the pan below keeps the pointer on it.
|
||||
const box = (await target.boundingBox())!;
|
||||
await target.hover({ position: { x: box.width / 2, y: box.height / 4 } });
|
||||
await expect(page.locator(".connection-canvas-surface.canvas-hovering")).toHaveCount(1);
|
||||
const tooltip = page.locator(".tooltip", { hasText: "Open in Inspector" });
|
||||
await expect(tooltip).toBeVisible();
|
||||
const related = await page.locator(".map-canvas .react-flow__node-screen.graph-node-hover-related")
|
||||
.evaluateAll((nodes) => nodes.map((element) => element.getAttribute("data-id") ?? ""));
|
||||
const unrelated = Object.keys(resting).filter((id) => !related.includes(id));
|
||||
expect(unrelated.length).toBeGreaterThan(0);
|
||||
const hovering = await mapCardOpacities(page);
|
||||
expect(unrelated.map((id) => hovering[id])).toEqual(unrelated.map((id) => resting[id]));
|
||||
await expect(page.locator(".map-canvas .screen-open-hint:visible")).toHaveCount(0);
|
||||
// The transitions into and out of it come fully up, the secondary one too.
|
||||
const incident = page.locator(".map-canvas .react-flow__edge.graph-edge-hover-related");
|
||||
await expect(incident.and(page.locator(".graph-edge-secondary"))).not.toHaveCount(0);
|
||||
await expect.poll(() => incident.evaluateAll((edges) => edges.every((edge) => getComputedStyle(edge).opacity === "1"))).toBe(true);
|
||||
// The route heads a Map card, so the bubble sits below the screenshot, clear of both.
|
||||
const clearance = async () => {
|
||||
const [bubble, card, title] = await Promise.all([tooltip.boundingBox(), target.boundingBox(), heading.boundingBox()]);
|
||||
if (!bubble || !card || !title) return Number.NaN;
|
||||
const headingOverlap = bubble.y < title.y + title.height && title.y < bubble.y + bubble.height
|
||||
&& bubble.x < title.x + title.width && title.x < bubble.x + bubble.width;
|
||||
return headingOverlap ? -1 : bubble.y - (card.y + card.height);
|
||||
};
|
||||
expect(await clearance()).toBeGreaterThan(0);
|
||||
// Panning with the pointer still on the card moves the card by transform; the bubble follows it
|
||||
// rather than staying behind over the screenshot.
|
||||
const before = await target.boundingBox();
|
||||
await page.mouse.wheel(0, 40);
|
||||
await expect.poll(async () => (await target.boundingBox())!.y).toBeLessThan(before!.y - 10);
|
||||
await expect.poll(clearance).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
test("hovering a Map screen the Changes filter muted brings it and its neighbours back up, and nothing else", async ({ page }) => {
|
||||
await serveSyntheticWorkspace(page);
|
||||
await page.goto("/map?focus=modified");
|
||||
const muted = page.locator(".map-canvas .react-flow__node-screen.graph-node-muted:not(.canvas-node-exit)");
|
||||
await expect.poll(() => muted.count()).toBeGreaterThan(0);
|
||||
await expectMapCameraAtRest(page);
|
||||
const resting = await mapCardOpacities(page);
|
||||
const node = await hoverableMapScreen(muted, 0);
|
||||
const id = (await node.getAttribute("data-id"))!;
|
||||
expect(Number.parseFloat(resting[id]!)).toBeLessThan(1);
|
||||
await node.locator(".screen-screenshot-target").hover();
|
||||
await expect(node).toHaveClass(/graph-node-hover-subject/);
|
||||
const related = await page.locator(".map-canvas .react-flow__node-screen.graph-node-hover-related")
|
||||
.evaluateAll((nodes) => nodes.map((element) => element.getAttribute("data-id") ?? ""));
|
||||
expect(related).toContain(id);
|
||||
expect(related.length).toBeGreaterThan(1);
|
||||
const hovering = await mapCardOpacities(page);
|
||||
expect(related.map((relatedId) => hovering[relatedId])).toEqual(related.map(() => "1"));
|
||||
const unrelated = Object.keys(resting).filter((otherId) => !related.includes(otherId));
|
||||
expect(unrelated.length).toBeGreaterThan(0);
|
||||
expect(unrelated.map((otherId) => hovering[otherId])).toEqual(unrelated.map((otherId) => resting[otherId]));
|
||||
// The transitions between them come up with them.
|
||||
const edges = page.locator(".map-canvas .react-flow__edge.graph-edge-hover-related");
|
||||
await expect.poll(() => edges.count()).toBeGreaterThan(0);
|
||||
await expect.poll(() => edges.evaluateAll((elements) => elements.every((edge) => getComputedStyle(edge).opacity === "1"))).toBe(true);
|
||||
});
|
||||
|
||||
test("on Screens the Open in Inspector tooltip sits above the screenshot, clear of the route under it", async ({ page }) => {
|
||||
await serveSyntheticWorkspace(page);
|
||||
await page.goto("/screens");
|
||||
const card = page.locator(".screens-page .screen-screenshot-card:not(.selected)").nth(1);
|
||||
const target = card.locator(".screen-screenshot-target");
|
||||
await target.scrollIntoViewIfNeeded();
|
||||
await target.hover();
|
||||
const tooltip = page.locator(".tooltip", { hasText: "Open in Inspector" });
|
||||
await expect(tooltip).toBeVisible();
|
||||
const [bubble, screenshot, title] = await Promise.all([
|
||||
tooltip.boundingBox(), target.boundingBox(), card.locator(".screen-node-heading").boundingBox(),
|
||||
]);
|
||||
expect(bubble!.y + bubble!.height).toBeLessThanOrEqual(screenshot!.y);
|
||||
expect(title!.y).toBeGreaterThanOrEqual(screenshot!.y + screenshot!.height - 1);
|
||||
});
|
||||
|
||||
test("a narrow window with a mouse gets the phone map's Open pill on the selected screen, as it has no tooltips", async ({ page }) => {
|
||||
// The phone layout is a width, not a device: the first click there only selects, as a tap does.
|
||||
await page.setViewportSize({ width: 800, height: 820 });
|
||||
await serveSyntheticWorkspace(page);
|
||||
await page.goto("/map?screen=area-0-screen-1");
|
||||
expect(await page.evaluate(() => matchMedia("(hover: hover)").matches)).toBe(true);
|
||||
await expect(page.locator(".app-shell.phone-layout")).toHaveCount(1);
|
||||
const selected = page.locator(".map-canvas .react-flow__node-screen.selected");
|
||||
await expect(selected.locator(".screen-open-hint")).toBeVisible();
|
||||
await expect(page.locator(".map-canvas .screen-open-hint:visible")).toHaveCount(1);
|
||||
});
|
||||
|
||||
test("fits a landscape Map capture at render time without app-specific dimensions", async ({ page }) => {
|
||||
const source = viewerMapFixture() as ExploreMap;
|
||||
await serveMap(page, {
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { CSSProperties, MouseEventHandler, ReactNode } from "react";
|
||||
import { ImageOff, PanelRight } from "lucide-react";
|
||||
import { diffClass, type DiffStatus } from "../../utils/build-diff";
|
||||
import { ScreenPathText } from "../shared/screen-path-text";
|
||||
import { Tooltip } from "../shared/tooltip";
|
||||
import { DEFAULT_SCREENSHOT_SIZE, ScreenshotImage } from "../shared/screenshot-image";
|
||||
import { CanvasActiveFrame } from "./active-frame";
|
||||
import { DiffFrame } from "./diff-frame";
|
||||
@@ -30,6 +31,8 @@ export type ScreenScreenshotCardProps = {
|
||||
loading?: "eager" | "lazy";
|
||||
leading?: ReactNode;
|
||||
trailing?: ReactNode;
|
||||
/** Where the "Open in Inspector" tooltip sits: away from the route heading, which is above the screenshot on the Map. */
|
||||
tooltipPlacement?: "top" | "bottom";
|
||||
/** Short lines about the screen, inside the card after its screenshot (Screens: how it was reached, where else it changed). */
|
||||
note?: ReactNode;
|
||||
onClick: MouseEventHandler<HTMLButtonElement>;
|
||||
@@ -89,10 +92,13 @@ export function ScreenScreenshotCard(props: ScreenScreenshotCardProps) {
|
||||
free of block children. */}
|
||||
<span className="screen-screenshot-slot">
|
||||
{props.leading}
|
||||
{/* With a pointer, what a click does is said once, zoom-independent, in the shared tooltip
|
||||
after its usual delay; the selected screen is already in the Inspector. The button has
|
||||
no title of its own, so no native tooltip joins it; the heading names the screen. */}
|
||||
<Tooltip label="Open in Inspector" placement={props.tooltipPlacement ?? "top"} disabled={Boolean(props.selected)}>
|
||||
<button
|
||||
type="button"
|
||||
className="screen-screenshot-target"
|
||||
title={props.plainTitle ? props.title : props.path}
|
||||
aria-label={props.ariaLabel ?? `Open ${props.plainTitle ? props.title : props.path}`}
|
||||
{...(props.ariaPressed !== undefined ? { "aria-pressed": props.ariaPressed } : {})}
|
||||
onClick={props.onClick}>
|
||||
@@ -110,16 +116,15 @@ export function ScreenScreenshotCard(props: ScreenScreenshotCardProps) {
|
||||
fallback={missing}
|
||||
/>
|
||||
) : missing}
|
||||
{/* On hover, says what a click does; on a phone's map, what the second tap does.
|
||||
See styles.css for when each wording shows. */}
|
||||
{/* On a phone's map, says what the second tap on the selected screen does. */}
|
||||
<span className="screen-open-hint" aria-hidden="true">
|
||||
<PanelRight />
|
||||
<span className="screen-open-hint-long">Open in Inspector</span>
|
||||
<span className="screen-open-hint-short">Open</span>
|
||||
<span>Open</span>
|
||||
</span>
|
||||
</span>
|
||||
</DiffFrame>
|
||||
</button>
|
||||
</Tooltip>
|
||||
{props.trailing}
|
||||
</span>
|
||||
{props.note ? <span className="screen-node-note">{props.note}</span> : null}
|
||||
|
||||
@@ -162,7 +162,18 @@ export function Tooltip({
|
||||
if (bubbleRef.current) observer.observe(bubbleRef.current);
|
||||
window.addEventListener("resize", update);
|
||||
window.addEventListener("scroll", update, true);
|
||||
// A canvas pans and zooms its cards by transform, which neither observer reports: while open,
|
||||
// follow the anchor frame by frame so the bubble never stays behind over what it labels.
|
||||
let followed = "";
|
||||
let frame = requestAnimationFrame(function follow() {
|
||||
const anchor = anchorRef.current?.getBoundingClientRect();
|
||||
const key = anchor ? `${anchor.left} ${anchor.top} ${anchor.width} ${anchor.height}` : "";
|
||||
if (followed && key !== followed) update();
|
||||
followed = key;
|
||||
frame = requestAnimationFrame(follow);
|
||||
});
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
observer.disconnect();
|
||||
window.removeEventListener("resize", update);
|
||||
window.removeEventListener("scroll", update, true);
|
||||
|
||||
@@ -115,6 +115,8 @@ function ScreenNodeCard({ data, selected }: NodeProps<ScreenGraphNode>) {
|
||||
imageHeight={data.screenshotSize?.imageHeight ?? data.frame.screen.height}
|
||||
placeholderSize={data.frame.screen}
|
||||
loading="lazy"
|
||||
// The route heads the card, so the tooltip goes below it.
|
||||
tooltipPlacement="bottom"
|
||||
leading={<Handle type="target" position={horizontal ? Position.Left : Position.Top} className="graph-handle" />}
|
||||
trailing={<Handle type="source" position={horizontal ? Position.Right : Position.Bottom} className="graph-handle" />}
|
||||
onMouseEnter={() => data.onHover(data.screen.id)}
|
||||
|
||||
+31
-40
@@ -110,7 +110,7 @@
|
||||
/* How far an item the Changes filter does not cover falls back. Low enough to read as
|
||||
background at a glance, high enough that the canvas keeps its shape. */
|
||||
--dim-out: 0.35;
|
||||
--hover-recede: 0.6;
|
||||
--hover-neighbour-frame: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
|
||||
--shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.025), 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
--shadow-md: 0 10px 20px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.05);
|
||||
|
||||
@@ -517,13 +517,14 @@ code {
|
||||
opacity: 1;
|
||||
--map-card-opacity: 1;
|
||||
}
|
||||
/* Hover isolates the subject and its directly incident transitions. These selectors come after
|
||||
diff focus so the pointer's immediate context is always the strongest signal. */
|
||||
.graph-canvas .react-flow__node.graph-node-hover-related {
|
||||
/* Hover never recedes anything, but where focus or a selection has already dimmed the map, the
|
||||
hovered screen and the screens it connects to come back up, with the transitions between them,
|
||||
so the neighbourhood reads. These come after both dimming rules so the pointer's context wins. */
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__node-screen.graph-node-hover-related {
|
||||
opacity: 1;
|
||||
--map-card-opacity: 1;
|
||||
filter: none;
|
||||
}
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__edge.graph-edge-hover-related { opacity: 1; }
|
||||
/* Re-layout: the canvas blinks out whole — nodes, edges and labels together — so the graph can
|
||||
change shape and the camera can cut unseen, then comes straight back. Both transitions live
|
||||
inside their class, so once the sequence ends the stylesheet owns opacity again. */
|
||||
@@ -555,6 +556,10 @@ code {
|
||||
/* The screenshot's positioned diff frame paints after the leading handle in tree order; lift
|
||||
both handles over the image while the diff label (z-index 2) still covers them. */
|
||||
.screen-screenshot-slot > .react-flow__handle { z-index: 1; }
|
||||
/* The tooltip anchor around the screenshot button is layout-transparent: it takes the slot's
|
||||
remaining height and hands it on, and stays static so the diff label and the handles keep
|
||||
anchoring to the slot (or, on Screens, the card). */
|
||||
.screen-screenshot-slot > .tooltip-anchor { position: static; display: flex; width: 100%; min-height: 0; flex: 1; flex-direction: column; }
|
||||
.screen-screenshot-target {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@@ -733,27 +738,23 @@ code {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Hover is transient canvas state. One container class dims the field; only the symmetric
|
||||
difference of related nodes/edges receives a class, avoiding a React commit across the graph.
|
||||
The hovered screen and the screens it connects to stay as they are; the rest recede a little,
|
||||
enough to read the neighbourhood without losing the map. */
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__node-screen {
|
||||
opacity: var(--hover-recede);
|
||||
--map-card-opacity: var(--hover-recede);
|
||||
transition: opacity 90ms ease;
|
||||
}
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__node-screen.graph-node-hover-related,
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__node-screen.graph-node-hover-subject {
|
||||
opacity: 1;
|
||||
--map-card-opacity: 1;
|
||||
}
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__edge { opacity: 0.3; }
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__edge.graph-edge-hover-related { opacity: 1; }
|
||||
/* Hover is transient canvas state. Nothing recedes: the pointer's screen gets its ring, the
|
||||
transitions into and out of it turn accent, and the screens at their other ends take a tinted
|
||||
frame, so the neighbourhood reads without the rest of the map changing. Only the symmetric
|
||||
difference of related nodes/edges receives a class, avoiding a React commit across the graph. */
|
||||
.connection-canvas-surface.canvas-hovering .graph-edge-hover-related .transition-edge-path {
|
||||
stroke: var(--accent) !important;
|
||||
stroke-width: 2.2 !important;
|
||||
stroke-dasharray: none !important;
|
||||
}
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__node-screen.graph-node-hover-related:not(.graph-node-hover-subject)
|
||||
.screen-screenshot-card:not(.selected, .diff-added, .diff-modified, .diff-removed) {
|
||||
--screen-frame: var(--hover-neighbour-frame);
|
||||
}
|
||||
.connection-canvas-surface.canvas-hovering .react-flow__node-screen.graph-node-hover-related:not(.graph-node-hover-subject)
|
||||
.screen-screenshot-card:not(.selected, .diff-added, .diff-modified, .diff-removed) .screen-node-image :is(img, .image-placeholder) {
|
||||
border-color: var(--hover-neighbour-frame);
|
||||
}
|
||||
|
||||
/* Semantic Map: an area is a meaningful destination, never an anonymous "X states" step. */
|
||||
.semantic-summary-node {
|
||||
@@ -925,10 +926,9 @@ code {
|
||||
transition-duration: 0ms;
|
||||
}
|
||||
|
||||
/* Hovering a screenshot says what a click does: it opens the screen in the Inspector. The hint
|
||||
sits in the middle of the screenshot, so it is always on the image whatever the slot's shape.
|
||||
With a pointer, an already selected screen is in the Inspector. On a phone's map the first tap
|
||||
only selects, so the hint sits on the selected screen and says what the next tap does. */
|
||||
/* The phone map's open hint. The first tap there only selects, so the pill sits in the middle of
|
||||
the selected screenshot (always on the image whatever the slot's shape) and says what the next
|
||||
tap does. In a wider window the card's tooltip carries the message and nothing covers the image. */
|
||||
.screen-screenshot-target { cursor: pointer; }
|
||||
.screen-open-hint {
|
||||
position: absolute;
|
||||
@@ -952,21 +952,12 @@ code {
|
||||
backdrop-filter: blur(6px);
|
||||
}
|
||||
.screen-open-hint > svg { width: 14px; height: 14px; flex: none; }
|
||||
.screen-open-hint-short { display: none; }
|
||||
@media (hover: hover) and (pointer: fine) {
|
||||
.screen-screenshot-card:not(.selected) .screen-screenshot-target:hover .screen-open-hint {
|
||||
display: inline-flex;
|
||||
animation: screen-open-hint-in 140ms ease-out;
|
||||
}
|
||||
}
|
||||
@media (hover: none) {
|
||||
.phone-layout .map-canvas .screen-screenshot-card.selected .screen-open-hint {
|
||||
display: inline-flex;
|
||||
animation: screen-open-hint-in 140ms ease-out;
|
||||
}
|
||||
/* Phone map screens are narrow, so the hint is one word there and stays on the screenshot. */
|
||||
.phone-layout .map-canvas .screen-open-hint-long { display: none; }
|
||||
.phone-layout .map-canvas .screen-open-hint-short { display: inline; }
|
||||
/* Only the phone layout's map shows the pill, on the selected screen, where a second tap or click
|
||||
opens the Inspector. That layout is a width, not a device, and has no tooltips, so a narrow
|
||||
desktop window shows it too. Elsewhere the screenshot button's tooltip says it instead. */
|
||||
.phone-layout .map-canvas .screen-screenshot-card.selected .screen-open-hint {
|
||||
display: inline-flex;
|
||||
animation: screen-open-hint-in 140ms ease-out;
|
||||
}
|
||||
@keyframes screen-open-hint-in { from { opacity: 0; transform: translate(-50%, -40%); } }
|
||||
@media (prefers-reduced-motion: reduce) { .screen-open-hint { animation: none !important; } }
|
||||
|
||||
Reference in new issue
Block a user