Compare commits

..
Author SHA1 Message Date
Brent Vatne 6e7639779a Merge branch '@brent/preview-manifest' into @brent/static-preview
# Conflicts:
#	src/config/explore-config.ts
2026-10-18 09:38:17 -07:00
Brent Vatne 150a70c361 Merge remote-tracking branch 'origin/main' into @brent/preview-manifest 2026-10-18 09:37:58 -07:00
Brent Vatne b2ef8b3ff1 A target switch keeps the chosen appearance when the other report was captured in it
The choice is kept per tab for the review (session storage, keyed like the last target), so it survives the Viewer's
remount on a switch in place and the page load of a report page; a report without it shows its own primary appearance.
2026-10-18 09:30:51 -07:00
Brent Vatne 5d5f106b40 Keyboard shortcuts switch targets: D opens the target menu, ⌥1–⌥8 pick a target, ` returns to the last one
A switch keeps the reviewer's place (view, screen and Inspector tab) when the other target has the same screen,
and the shortcuts dialog lists the targets with their keys.
2026-10-18 09:20:27 -07:00
Brent Vatne 5a93bb66bd Keep crawlers off a hosted preview's static files, parse each manifest once, and fix the review's other findings
- robots.txt disallows /p/*/assets/ and /p/*/targets/ (EAS Hosting cannot add noindex to static files); the deploy check requires it
- The Worker caps a manifest at what the Viewer opens, parses it once, keeps the report's own bytes (so /raw is verbatim again),
  and counts a kept manifest at three times its size against the cache
- eas output that names an upload's path no longer prints the link's token
- Every copy of a screenshot that targets share must have the size that was written
- The agent API answers 503, not 404, for a screenshot it cannot fetch right now
- A capture artifact's legacy expiresAfterDays gets the same warning as expiresAfter
- The fixture refresh script reads report.zip from deployments that serve one, and rebuilds the ZIP otherwise
- Docs: a screenshot's URL is the link; CI-FLOW no longer describes an expiry
2026-10-18 09:12:38 -07:00
Brent Vatne 1767b67896 Hosted previews serve the report as static files under the token, with no encryption and no Explore expiry
ci:deploy writes each target's manifest at p/<token>/targets/<target>.json and every screenshot once at
p/<token>/assets/<sha256>.<ext>, as static files EAS Hosting serves itself. Nothing is encrypted: the 160-bit token in
every path keeps them private, as it keeps the link. The Viewer loads screenshots straight from the CDN, with no
Worker request, no CPU and no limit on report size. The Worker keeps the page, the manifest the Viewer asks for by
target (passed through unparsed), reports.json and the agent API, which read the static manifest. report.zip, the
key, decryption and the Worker's byte budget are gone.

Each manifest is stamped with its deployment, so ci:deploy's check (the manifest byte for byte, and one screenshot)
tells a new deployment of an unchanged report from the one an alias still serves. The local report server serves a
screenshot from whichever report holds it, as the static files are shared by target.

Explore sets no expiry: a link works as long as its EAS Hosting deployment, which EAS deletes after 30 days on Free and
90 on paid plans unless an alias points at it. report.preview.expiresAfter, --expires-in and the compare workflow's
expires-in input are still accepted and say they no longer apply. The docs say how to delete a deployment sooner.
scripts/refresh-viewer-preview-fixtures.sh rebuilds each report ZIP from the manifest and screenshots.
2026-10-17 23:05:05 -07:00
Brent Vatne b0a500eb72 The Worker keeps reports within a byte budget; switching back reuses screenshots; review fixes
The Worker keeps decrypted reports within 60 MB, least recently used first, decrypts one at a time with room for the
ciphertext and the plaintext within 90 MB, and shares one decrypt between the requests waiting for it. A report too
large to keep is decrypted per request; one too large to decrypt answers 413, remembered by the isolate, and the Viewer
says to download it instead. A fetch that fails this time answers 503 (retried); one that never decrypts is a 404.

Switching away from a hosted preview's target keeps the screenshots it showed (up to 16) instead of revoking them, so
switching back shows the same Blob URLs without decoding again. The favicon releases against the report that resolved
it, and a stale rejection no longer resets the tab icon. A dropped file no longer shows the previous drop's error while
it opens. A download that Back or Forward left behind is kept, and progress reaches every switch waiting on it. The
manifest download stops past the metadata limit before anything is parsed.
2026-10-17 22:37:30 -07:00
Brent Vatne 5cbb4f7da9 Local review opens from the manifest too; ci:deploy verifies what the Viewer opens; the Worker keeps two reports
The local report server serves /p/<token>/manifest.json and /p/<token>/assets/<sha256>.<ext>, so capture:review
and the CLI's local Viewer open again: they had only report.zip, and the Viewer now asks for the manifest. The
manifest and asset helpers move to src/report/preview-manifest.ts, shared by the Worker, the local server and the
deploy check, and the manifest no longer lists a ZIP's directory records, which the Viewer rejects.

ci:deploy checks that each target's manifest is exactly the one its deployed ZIP makes and that an asset serves its
bytes, so a deployment the Viewer cannot open is never linked.

The Worker keeps the decrypted ZIPs of only the two reports it last served, plus every target's manifest; a manifest
for a report it is not keeping (the prefetch) decrypts it once and lets it go. The manifest and asset routes answer
503 when the report cannot be read this time, and the Viewer retries the manifest once as it does an asset. Assets
are cached for a week at most, as long as the Viewer kept a whole report before, and the docs say that deleting a
deployment does not reach a browser that already fetched them. A decode a trim left behind no longer leaks its
URL when a later one for the same screenshot is retained.
2026-10-17 21:47:57 -07:00
Brent Vatne d229410312 Target switches keep a joined download open, go back mid-switch, and free the old report's screenshots
A prefetch that waited on the same download as a switch closed the archive the switch had just shown, so its
screenshots failed. Going back while a switch was still downloading (or after it failed) left the loading shell up
and let the slow report replace the one the URL names. A switch to an opened target left the old report's in-use
screenshots unreleased, since the old Viewer released them against the new report; trim() now drops them.
The whole-ZIP transport switch built for the comparison is gone.
2026-10-17 20:58:19 -07:00
Brent Vatne 10c8820988 Cap a hosted preview asset's cache age at the link's remaining lifetime 2026-10-17 20:58:19 -07:00
Brent Vatne 50fb56f387 Document the manifest and asset routes of hosted previews 2026-10-17 20:58:19 -07:00
Brent Vatne 871310eaf7 Load the ZIP reader only when a report ZIP is opened
A hosted preview opens its manifest and never needs @zip.js, which was
13% of the Viewer bundle.
2026-10-17 20:58:19 -07:00
Brent Vatne 9a53b1d032 Hosted previews open from a manifest and switch targets in place
The Worker serves /p/<token>/manifest.json (the metadata file plus every
asset's size) and /p/<token>/assets/<sha256>.<ext> (one asset, immutable
in this browser); the shell preloads the manifest. The Viewer opens the
manifest instead of the whole ZIP and fetches each screenshot when it is
first shown, keeps every target it opened, switches between them without
leaving the page, and prefetches the other targets' manifests.
2026-10-17 20:58:19 -07:00
19 changed files with 89 additions and 327 deletions

No files matched your search

+2 -7
View File
@@ -76,14 +76,9 @@ jobs:
| [$marker,
"**Viewer preview** of \($sha)\(if $source != "" then " · reports from \($source)" else "" end)",
"",
"| Report | Changes | Open |",
"| Platform | Changes | Open |",
"| --- | --- | --- |",
# One row per target, named by its label; a target named after its platform keeps ?platform= links.
($reports[]
| (.target // .platform) as $id
| "\(if $id == "ios" or $id == "android" then "platform" else "target" end)=\($id)" as $query
| ((.label // (if .platform == "ios" then "iOS" else "Android" end)) | gsub("\\|"; "\\\\|")) as $name
| "| \($name)\(if .device then " · \(.device)" else "" end) | \(.changes // "–") | [Map](\($url)?\($query)) · [Screens](\($url)?\($query)#/screens) · [Compare](\($url)?\($query)&view=compare) |"),
($reports[] | "| \(if .platform == "ios" then "iOS" else "Android" end)\(if .device then " · \(.device)" else "" end) | \(.changes // "–") | [Map](\($url)?platform=\(.platform)) · [Screens](\($url)?platform=\(.platform)#/screens) · [Compare](\($url)?platform=\(.platform)&view=compare) |"),
"",
"The link stays the same on every push. [Deploy run](\($run))"]
| join("\n")' "$RUNNER_TEMP/preview.json" > "$RUNNER_TEMP/comment.md"
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@expo/explore",
"version": "0.19.8",
"version": "0.19.7",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@expo/explore",
"version": "0.19.8",
"version": "0.19.7",
"license": "MIT",
"dependencies": {
"@expo/repack-app": "0.10.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@expo/explore",
"version": "0.19.8",
"version": "0.19.7",
"description": "Source-driven mobile app maps, deterministic CI capture, and visual reviews",
"license": "MIT",
"type": "module",
+5 -6
View File
@@ -3,14 +3,13 @@
//
// node scripts/deploy-viewer-preview.mjs --fixtures DIR --alias pr-123 --project explore-viewer-pr [--owner expo-public]
//
// DIR holds reports.json ([{ target?, platform, label?, changes?, device? }], as a hosted preview's /reports.json lists
// them) and one <target>.zip per entry, or <platform>.zip for an entry without a target
// (scripts/refresh-viewer-preview-fixtures.sh writes both). EXPLORE_PREVIEW_TOKEN keeps an earlier link's /p/<token>;
// without it the link gets a new one. EXPO_TOKEN must be able to deploy to the project.
// DIR holds reports.json ([{ platform, changes?, device? }], as a hosted preview's /reports.json lists them) and one
// <platform>.zip per entry (scripts/refresh-viewer-preview-fixtures.sh writes both). EXPLORE_PREVIEW_TOKEN keeps an
// earlier link's /p/<token>; without it the link gets a new one. EXPO_TOKEN must be able to deploy to the project.
import { readFile } from "node:fs/promises";
import { join } from "node:path";
import { parseArgs } from "node:util";
import { deployFixturePreview, fixtureReports } from "../dist/report/preview-deploy.js";
import { deployFixturePreview } from "../dist/report/preview-deploy.js";
const { values } = parseArgs({ options: { fixtures: { type: "string" }, alias: { type: "string" }, project: { type: "string" }, owner: { type: "string" } } });
if (!values.fixtures || !values.alias || !values.project) {
@@ -20,7 +19,7 @@ if (!values.fixtures || !values.alias || !values.project) {
const listing = JSON.parse(await readFile(join(values.fixtures, "reports.json"), "utf8"));
const token = process.env.EXPLORE_PREVIEW_TOKEN?.trim() || undefined;
const result = await deployFixturePreview({
reports: fixtureReports(listing, values.fixtures),
reports: listing.map(({ platform, changes, device }) => ({ platform, zipPath: join(values.fixtures, `${platform}.zip`), changes, device })),
project: values.project, alias: values.alias, ...(values.owner ? { owner: values.owner } : {}), ...(token ? { token } : {}),
});
console.log(JSON.stringify({ ...result, reports: listing }));
+16 -21
View File
@@ -18,35 +18,30 @@ trap 'rm -rf "$work"' EXIT
if ! curl -fsS "$base/reports.json" -o "$work/listing.json"; then
echo '[{"platform":"ios"}]' > "$work/listing.json"
fi
# One ZIP per target, named for it: <target>.zip, or <platform>.zip for a report from before targets. A target named
# after its platform is selected with ?platform=, any other with ?target= (as viewer-links.ts targetParameter does).
# A preview deployed before Explore wrote static files serves each target's ZIP; a newer one serves its manifest and
# screenshots, so the ZIP is put back together here. Screenshot requests keep the target's query, which deployments
# that answered them from the ZIP need and static files ignore.
for key in $(jq -r '.[] | .target // .platform' "$work/listing.json"); do
# The listing comes from the hosted preview: a key names files here, so it must be a target id.
[[ "$key" =~ ^[a-z][a-z0-9-]{0,31}$ ]] || { echo "Not a target id in reports.json: $key" >&2; exit 2; }
case "$key" in ios|android) query="platform=$key" ;; *) query="target=$key" ;; esac
if curl -fsS "$base/report.zip?$query" -o "$work/$key.zip" 2> /dev/null; then
unzip -tq "$work/$key.zip" > /dev/null
# screenshots, so the ZIP is put back together here. Screenshot requests keep ?platform=, which deployments that
# answered them from the ZIP need and static files ignore.
for platform in $(jq -r '.[].platform' "$work/listing.json"); do
if curl -fsS "$base/report.zip?platform=$platform" -o "$work/$platform.zip" 2> /dev/null; then
unzip -tq "$work/$platform.zip" > /dev/null
continue
fi
report="$work/$key"
report="$work/$platform"
mkdir -p "$report/assets"
curl -fsS "$base/manifest.json?$query" -o "$work/$key.manifest.json"
file="$(jq -r .file "$work/$key.manifest.json")"
[[ "$file" == review.json || "$file" == exploration.json ]] || { echo "Not a report manifest: $key" >&2; exit 1; }
jq -c .report "$work/$key.manifest.json" > "$report/$file"
for asset in $(jq -r '.entries | keys[]' "$work/$key.manifest.json"); do
curl -fsS "$base/manifest.json?platform=$platform" -o "$work/$platform.manifest.json"
file="$(jq -r .file "$work/$platform.manifest.json")"
[[ "$file" == review.json || "$file" == exploration.json ]] || { echo "Not a report manifest: $platform" >&2; exit 1; }
jq -c .report "$work/$platform.manifest.json" > "$report/$file"
for asset in $(jq -r '.entries | keys[]' "$work/$platform.manifest.json"); do
[[ "$asset" =~ ^assets/[a-f0-9]{64}\.(png|jpg|mp4)$ ]] || { echo "Unexpected asset name: $asset" >&2; exit 1; }
curl -fsS "$base/$asset?$query" -o "$report/$asset"
curl -fsS "$base/$asset?platform=$platform" -o "$report/$asset"
[[ "$(shasum -a 256 "$report/$asset" | cut -c1-64)" == "${asset:7:64}" ]] || { echo "Checksum mismatch: $asset" >&2; exit 1; }
done
rm -f "$work/$key.zip"
(cd "$report" && zip -qrX "$work/$key.zip" "$file" assets)
unzip -tq "$work/$key.zip" > /dev/null
rm -f "$work/$platform.zip"
(cd "$report" && zip -qrX "$work/$platform.zip" "$file" assets)
unzip -tq "$work/$platform.zip" > /dev/null
done
jq --arg source "$source_name" '[.[] | {target, platform, label, changes, device, source: $source} | with_entries(select(.value != null))]' "$work/listing.json" > "$work/reports.json"
jq --arg source "$source_name" '[.[] | {platform, changes, device, source: $source} | with_entries(select(.value != null))]' "$work/listing.json" > "$work/reports.json"
gh release view "$tag" > /dev/null 2>&1 || gh release create "$tag" --prerelease --latest=false --title "Viewer preview fixtures" \
--notes "Reports the Viewer preview workflow serves on every pull request. Refresh with scripts/refresh-viewer-preview-fixtures.sh."
+2 -3
View File
@@ -294,9 +294,8 @@ export async function reservePort(port: number, environment: NodeJS.ProcessEnv):
const abandoned = async (path: string) => {
const info = await stat(path).catch(() => undefined);
if (!info) return false;
// writeFile creates the owner file before it writes the pid, so an empty one is a holder mid-write too.
const owner = await readFile(join(path, "owner"), "utf8").catch(() => "");
return owner === "" ? Date.now() - info.mtimeMs > 10_000 : !processAlive(Number(owner));
const owner = await readFile(join(path, "owner"), "utf8").catch(() => undefined);
return owner === undefined ? Date.now() - info.mtimeMs > 10_000 : !processAlive(Number(owner));
};
for (;;) {
try { await mkdir(mutex); await writeFile(join(mutex, "owner"), String(process.pid)); break; }
+1 -2
View File
@@ -268,8 +268,7 @@ export async function runCiReview(options: {
const { projects, output, config, environment, state, assertCurrentHead, postComment } = options;
const progress = options.progress ?? silentProgress;
// The controllers are fetched before any EAS work, so a blocked download fails before a session is paid for. agent-device
// also compares the screenshots. An injected runner (tests) stands in for the controllers' calls, but not for that
// comparison: it still runs the real agent-device, which fetches itself on first use.
// also compares the screenshots. An injected runner (tests) runs no real controller.
if (!options.runner) await prefetchControllers(config, environment, progress);
const pr = options.presentation;
const now = options.now ?? Date.now;
-22
View File
@@ -700,28 +700,6 @@ export async function deployFixturePreview(options: FixturePreviewOptions): Prom
...(options.token ? { token: options.token } : {}) });
}
/**
* The reports a fixture directory holds (scripts/refresh-viewer-preview-fixtures.sh writes it): its reports.json, as a
* hosted preview's /reports.json lists them, with `<target>.zip` beside it for each entry. An entry without a target,
* from fixtures refreshed before targets, is its platform's target with `<platform>.zip`.
*/
export function fixtureReports(listing: unknown, directory: string): FixturePreviewOptions["reports"] {
const invalid = () => previewError("PREVIEW_REPORTS_INVALID", "The fixtures' reports.json does not list valid reports",
"Refresh the fixtures with scripts/refresh-viewer-preview-fixtures.sh.");
if (!Array.isArray(listing)) throw invalid();
return listing.map((entry: unknown) => {
if (typeof entry !== "object" || entry === null) throw invalid();
const { platform, target: id, label, changes, device } = entry as Record<string, unknown>;
if (platform !== "ios" && platform !== "android") throw invalid();
const target = id === undefined ? undefined : readTarget({ id, platform, label });
if (id !== undefined && !target) throw invalid();
return {
platform, ...(target ? { target } : {}), zipPath: join(directory, `${target?.id ?? platform}.zip`),
...(typeof changes === "number" ? { changes } : {}), ...(typeof device === "string" ? { device } : {}),
};
});
}
/**
* Report ZIPs on this machine behind one token (`capture:review --upload`, `report:upload`), one per target: the same
* sealed deployment as a PR preview, from ZIPs instead of GitHub artifacts, with the local EAS login or EXPO_TOKEN.
-4
View File
@@ -272,8 +272,6 @@ test("choosing the report file opens it with the link's selection and keeps Modi
await expect(page.locator("html")).toHaveAttribute("data-theme", "light");
await page.getByRole("button", { name: "Screens", exact: true }).click();
const screenshot = page.locator(".screens-page img[data-screenshot-src]").first();
// The placeholder is the screenshot's size too, so wait for the screenshot itself.
await expect(screenshot).toHaveAttribute("data-screenshot-state", "ready");
await expect.poll(() => screenshot.evaluate(image => image.naturalWidth)).toBe(32);
const screenshotUrl = await screenshot.getAttribute("src");
assert.match(page.url(), /#\/screens/);
@@ -330,8 +328,6 @@ test("a reload and a later per-screen link reopen the dropped report from the br
await expect(page.getByText("Greeting changed from Hello to Welcome", { exact: true })).toBeVisible();
await page.getByRole("button", { name: "Screens", exact: true }).click();
const screenshot = page.locator(".screens-page img[data-screenshot-src]").first();
// The placeholder is the screenshot's size too, so wait for the screenshot itself.
await expect(screenshot).toHaveAttribute("data-screenshot-state", "ready");
await expect.poll(() => screenshot.evaluate(image => image.naturalWidth)).toBe(32);
// Comment links to one screen carry the same run identity, so they open without a new drop.
await page.goto(`${origin}/r?${new URLSearchParams(identity)}&screen=home&inspect=diff`);
+1 -1
View File
@@ -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-node-title[aria-label="Copy deep link /games"]')).toBeVisible();
await expect(page.locator('.map-canvas .screen-screenshot-target[title="/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.
+8 -160
View File
@@ -127,13 +127,6 @@ 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)) {
@@ -156,9 +149,7 @@ 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 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.
// The hovered screen and every screen it shares an edge with stay bright; the rest recede.
const neighbourIds = await allEdges.evaluateAll((edges, nodeId) => {
const ids = new Set<string>([nodeId]);
for (const edge of edges) {
@@ -175,15 +166,14 @@ async function expectMapScreenSelectionDimming(
await expect.poll(() => brightNodes.evaluateAll((nodes) => (
nodes.map((node) => node.getAttribute("data-id") ?? "").sort()
))).toEqual(neighbourIds);
const unrelated = page.locator(
".map-canvas .react-flow__node-screen:not(.graph-node-hover-related):not(.canvas-node-exit)",
const receded = page.locator(
".map-canvas .react-flow__node-screen:not(.graph-node-hover-related)",
);
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);
if (await receded.count() > 0) {
await expect.poll(() => receded.first().evaluate(
(node) => Number.parseFloat(getComputedStyle(node).opacity),
)).toBeGreaterThan(0.5);
}
const activeEdges = page.locator(
".map-canvas .react-flow__edge.graph-edge-hover-related",
);
@@ -2008,148 +1998,6 @@ 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, {
+1 -4
View File
@@ -27,10 +27,7 @@ export async function createBrowserVite(test, options) {
});
const requested = options.server;
const port = requested?.port === 0 ? await freePort(requested.host ?? "127.0.0.1") : requested?.port;
// A cold cacheDir optimizes dependencies as the page asks for them; one found late (the JSX dev runtime, which
// esbuild's JSX imports) makes Vite reload the page, dropping whatever the test has done in it.
const optimizeDeps = { ...options.optimizeDeps, include: [...(options.optimizeDeps?.include ?? []), "react/jsx-dev-runtime"] };
server = await createServer({ ...options, cacheDir, optimizeDeps,
server = await createServer({ ...options, cacheDir,
...(requested ? { server: { ...requested, port, ...(requested.port === 0 ? { strictPort: true } : {}) } } : {}) });
return server;
}
+3 -16
View File
@@ -8,13 +8,11 @@ import { createHash } from 'node:crypto';
import { PNG } from 'pngjs';
import { AGENT_DEVICE_VERSION } from '../../dist/capture/run.js';
import { CAPTURE_OBSERVER_IDENTIFIER } from '../../dist/capture/observer.js';
import { controllerCacheRoot, ensureController } from '../../dist/shared/controller-cache.js';
import { writeCaptureObserverPackages } from './capture-observer-fixture.mjs';
/**
* In-process public CI fixture: a git project with base/head commits plus mocked `eas`, `repack-app`,
* `agent-device` and GitHub transports, so a review runs end to end without a simulator, and without network once the
* real agent-device that compares screenshots is cached.
* `agent-device` and GitHub transports, so a review runs end to end without network or a simulator.
*/
export const PROJECT_ID = '00000000-0000-4000-8000-000000000001';
@@ -29,17 +27,6 @@ export const usageReceipt = (overrides = {}) => ({ provider: 'anthropic', model:
totals: { inputTokens: 100, outputTokens: 20, cacheReadInputTokens: 40, estimatedCostUsd: 0.012 },
models: [{ model: 'fixture-model', inputTokens: 100, outputTokens: 20, cacheReadInputTokens: 40, estimatedCostUsd: 0.012, costBasis: 'list' }],
...overrides });
/**
* The review's screenshot comparison runs the real agent-device, which fetches itself on first use. The fixture fetches
* it once, with retries, into the machine's controller cache, so a review never downloads it mid-run.
*/
const CONTROLLER_CACHE = controllerCacheRoot(process.env);
for (let attempt = 1; ; attempt++) {
try { await ensureController('agent-device', { environment: { ...process.env, EXPLORE_CONTROLLER_CACHE: CONTROLLER_CACHE } }); break; }
catch (error) { if (attempt === 3) throw error; await new Promise(resolve => setTimeout(resolve, attempt * 2_000)); }
}
export async function readUsage(output) {
const path = join(output, 'agent-usage.jsonl');
assert.equal((await stat(path)).mode & 0o777, 0o600, 'usage receipts are private artifacts');
@@ -116,7 +103,7 @@ const Navigation=createStaticNavigation(Root); export default function App(){ret
const pr = { repositoryId: '123', repository: 'acme/example', number: 7, title: 'Source capture integration', url: 'https://github.com/acme/example/pull/7',
base: { ref: 'main', sha: baseSha }, head: { ref: 'feature', sha: headSha } };
const pullRequestPath = join(root, 'pull-request.json'); await writeFile(pullRequestPath, JSON.stringify(pr));
const environment = { PATH: process.env.PATH, HOME: root, RUNNER_TEMP: root, EXPLORE_CONTROLLER_CACHE: CONTROLLER_CACHE, EXPO_TOKEN: 'test-expo-secret', GITHUB_TOKEN: 'test-github-secret',
const environment = { PATH: process.env.PATH, HOME: root, RUNNER_TEMP: root, EXPO_TOKEN: 'test-expo-secret', GITHUB_TOKEN: 'test-github-secret',
GITHUB_RUN_ID: '1234', GITHUB_RUN_ATTEMPT: '1', GITHUB_REPOSITORY: pr.repository, TOOLS_COMMIT: 'c'.repeat(40), EXPLORE_VIEWER_ORIGIN: 'https://viewer.example' };
const requests = []; const comments = []; const sessions = new Map(); let currentSession; const idleDevice = { path: '/', scheme: 'light' }; let sessionCounter = 0; let repackedSha; let openFailed = false;
const identity = (session) => ({ session: 'expo-explore-runtime', appBundleId: config.app.bundleId,
@@ -219,7 +206,7 @@ const Navigation=createStaticNavigation(Root); export default function App(){ret
] });
}
if (command === 'settings') { if (request.args[1] === 'appearance') device.scheme = request.args[2]; return ok({ setting: request.args[1], value: request.args[2] }); }
if (command === 'screenshot') { const color = createHash('sha256').update(`${device.path}:${device.scheme}:${device.path === '/home' ? device.build : 'unchanged-source'}`).digest(); /* Hashed colours can land within the diff threshold, so /home's red channel keeps the base build apart from any other. */ if (device.path === '/home') color[0] = device.build?.endsWith(baseSha) ? 0 : 255; const data = Buffer.alloc(16 * 24 * 4); for (let i = 0; i < data.length; i += 4) { data[i] = color[0]; data[i + 1] = color[1]; data[i + 2] = color[2]; data[i + 3] = 255; } writeFileSync(request.args[1], PNG.sync.write({ width: 16, height: 24, data })); return ok({ path: request.args[1] }); }
if (command === 'screenshot') { const color = createHash('sha256').update(`${device.path}:${device.scheme}:${device.path === '/home' ? device.build : 'unchanged-source'}`).digest(); const data = Buffer.alloc(16 * 24 * 4); for (let i = 0; i < data.length; i += 4) { data[i] = color[0]; data[i + 1] = color[1]; data[i + 2] = color[2]; data[i + 3] = 255; } writeFileSync(request.args[1], PNG.sync.write({ width: 16, height: 24, data })); return ok({ path: request.args[1] }); }
}
throw new Error(`Unexpected mocked command: ${request.command} ${request.args.join(' ')}`);
};
+1 -2
View File
@@ -145,8 +145,7 @@ async function fixture(t, settings = {}) {
if (request.args[1]?.includes('server start')) {
const port = 4100 + serverStarts++;
writeFileSync(request.environment.EXPLORE_ARGENT_SERVER_LOG, ` (or: argent link --host 127.0.0.1 --port ${port} --token abc123)\n[t] Tools server listening on http://127.0.0.1:${port}\n`);
// A pid no process can have: stopping the server signals it for real.
return { stdout: `${999_999_000 + serverStarts}\n`, stderr: '' };
return { stdout: `${4242 + serverStarts}\n`, stderr: '' };
}
return { stdout: '', stderr: '' };
}
+1 -22
View File
@@ -7,7 +7,7 @@ import test from "node:test";
import { prepareCaptureReview } from "../../dist/review/capture-review.js";
import { createSourceCapturePlan } from "../../dist/source/capture-plan.js";
import { writeCiReportInput, exportCiReport } from "../../dist/report/artifact.js";
import { collectPlatformReports, deployExplorationReport, deployFixturePreview, deployLocalReports, fixtureReports, deployPreview, previewProjectSlug, readReportZip, whoamiAccounts, zipReportDirectory } from "../../dist/report/preview-deploy.js";
import { collectPlatformReports, deployExplorationReport, deployFixturePreview, deployLocalReports, deployPreview, previewProjectSlug, readReportZip, whoamiAccounts, zipReportDirectory } from "../../dist/report/preview-deploy.js";
import { spawnSync } from "node:child_process";
import { ZipReader, Uint8ArrayReader, TextWriter, configure } from "@zip.js/zip.js";
import { viewerLinks } from "../../dist/report/viewer-links.js";
@@ -525,27 +525,6 @@ test("a fixture preview seals each platform's ZIP as is behind one alias and lis
error => error.code === "PREVIEW_ALIAS_INVALID");
});
test("fixture reports name each target's ZIP, and a listing from before targets its platform's", () => {
const listing = [
{ target: "iphone", platform: "ios", label: "iPhone 17", changes: 11, device: "iPhone 17 26.5 · light + dark", source: "brentvatne/euxy#163" },
{ target: "duo-open", platform: "ios", label: "iPhone Duo (open)", changes: 34 },
{ target: "android", platform: "android", label: "Android", changes: 5 },
];
assert.deepEqual(fixtureReports(listing, "/fixtures"), [
{ platform: "ios", target: { id: "iphone", platform: "ios", label: "iPhone 17" }, zipPath: "/fixtures/iphone.zip", changes: 11, device: "iPhone 17 26.5 · light + dark" },
{ platform: "ios", target: { id: "duo-open", platform: "ios", label: "iPhone Duo (open)" }, zipPath: "/fixtures/duo-open.zip", changes: 34 },
{ platform: "android", target: { id: "android", platform: "android", label: "Android" }, zipPath: "/fixtures/android.zip", changes: 5 },
]);
assert.deepEqual(fixtureReports([{ platform: "ios", changes: 3 }, { platform: "android" }], "/fixtures"), [
{ platform: "ios", zipPath: "/fixtures/ios.zip", changes: 3 },
{ platform: "android", zipPath: "/fixtures/android.zip" },
]);
// reports.json comes from a hosted preview: a target that is not an id never names a file.
for (const bad of [[{ target: "../escape", platform: "ios" }], [{ platform: "web" }], [null], { platform: "ios" }]) {
assert.throws(() => fixtureReports(bad, "/fixtures"), error => error.code === "PREVIEW_REPORTS_INVALID", JSON.stringify(bad));
}
});
test("a deployment that does not report the requested alias is a retryable deploy failure", async t => {
const { reportPath, exportPath } = await exportFixture(t);
await asExploration(reportPath);
@@ -2,7 +2,6 @@ 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";
@@ -31,8 +30,6 @@ 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>;
@@ -92,13 +89,10 @@ 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}>
@@ -116,15 +110,16 @@ export function ScreenScreenshotCard(props: ScreenScreenshotCardProps) {
fallback={missing}
/>
) : missing}
{/* On a phone's map, says what the second tap on the selected screen does. */}
{/* 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. */}
<span className="screen-open-hint" aria-hidden="true">
<PanelRight />
<span>Open</span>
<span className="screen-open-hint-long">Open in Inspector</span>
<span className="screen-open-hint-short">Open</span>
</span>
</span>
</DiffFrame>
</button>
</Tooltip>
{props.trailing}
</span>
{props.note ? <span className="screen-node-note">{props.note}</span> : null}
-11
View File
@@ -162,18 +162,7 @@ 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,8 +115,6 @@ 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)}
+40 -31
View File
@@ -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-neighbour-frame: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
--hover-recede: 0.6;
--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,14 +517,13 @@ code {
opacity: 1;
--map-card-opacity: 1;
}
/* 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 {
/* 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 {
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. */
@@ -556,10 +555,6 @@ 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%;
@@ -738,23 +733,27 @@ code {
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. */
/* 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; }
.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 {
@@ -926,9 +925,10 @@ code {
transition-duration: 0ms;
}
/* 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. */
/* 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. */
.screen-screenshot-target { cursor: pointer; }
.screen-open-hint {
position: absolute;
@@ -952,12 +952,21 @@ code {
backdrop-filter: blur(6px);
}
.screen-open-hint > svg { width: 14px; height: 14px; flex: none; }
/* 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;
.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; }
}
@keyframes screen-open-hint-in { from { opacity: 0; transform: translate(-50%, -40%); } }
@media (prefers-reduced-motion: reduce) { .screen-open-hint { animation: none !important; } }