Archilyzer · Source

archilyzer

Archilyzer
git clone https://archilyzer.pages.dev/source/archilyzer.git
Log | Files | Refs | README | LICENSE

commit 3158982eab5cf606a7e5673a8db6b9171364c03e
parent 16d4e9559c39f1fff73219402180dc094edd3feb
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date:   Thu, 19 Nov 2026 15:05:38 -0500

export: no platform player before the fresh state is in; Stop gives focus back; no empty link

Review fixes 4-5 of lane missing-source.

- useFreshSummaryState answers known / pending / absent from the react-query
  cache (the manifest and its pages). While pending, the cached transcript
  record is not trusted and no platform player is mounted (the black slot),
  so a stale record never asks the platform. Settled without the video, or a
  route that loads no summaries (Duplicates), falls back to the record: there
  is no per-channel summaries read to ask instead.
- The own-copy offer waits for the same answer.
- Stop returns focus to "Play your own copy"; the panel is labelled "Source
  availability"; a record with no address shows the link's label as text.
- e2e: the stale-record case holds the summaries back and asserts zero
  platform requests; a no-address record; focus after Stop on both paths.

Co-Authored-By: Claude <noreply@anthropic.com>

Diffstat:
Mcommon/components/LocalFileBar.tsx | 18+++++++++++-------
Mcommon/components/LocalFilePicker.tsx | 13++++++++++++-
Mcommon/components/PlayerProvider.tsx | 150++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------
Mexport/CHANGELOG.md | 16+++++++++++-----
Mexport/e2e/fixtures/missing-source.ts | 20++++++++++++++++----
Mexport/e2e/local-file.spec.ts | 4++++
Mexport/e2e/source-missing.spec.ts | 25++++++++++++++++++++-----
7 files changed, 189 insertions(+), 57 deletions(-)

diff --git a/common/components/LocalFileBar.tsx b/common/components/LocalFileBar.tsx @@ -10,7 +10,8 @@ import { formatOffset } from "../lib/localFileClock"; // its one-sentence promise. (A source no longer public has the same control // in the player slot's panel, so nothing shows here.) // - A copy playing: its name, the offset, the four nudges, "This line is -// playing now" (the next cue click sets the offset) and Stop. +// playing now" (the next cue click sets the offset) and Stop, which gives +// the focus back to the "Play your own copy" control in its place. // // Nothing in this file may reach the network or storage (the offset is written // by the provider through lib/localFileClock.ts); LocalFilePicker.test.ts @@ -31,21 +32,24 @@ export function LocalFileBar() { const { data, sourceGone, + sourceStatePending, localFile, localSyncArmed, openLocalFile, - clearLocalFile, + stopLocalFile, + takeLocalPickerFocus, nudgeLocalOffset, armLocalSync, } = usePlayer(); if (!localFile) { - // Not before the record is here (its state decides where the control - // goes), and not for a source no longer public: the panel holds it. - if (!data || sourceGone) return null; + // Not before the record and its fresh state are here (the state decides + // where the control goes), and not for a source no longer public: the + // panel holds it. + if (!data || sourceStatePending || sourceGone) return null; return ( <div className="px-3 sm:px-0" data-testid="local-file-offer"> - <LocalFilePicker onPick={openLocalFile} /> + <LocalFilePicker onPick={openLocalFile} takeFocus={takeLocalPickerFocus} /> </div> ); } @@ -84,7 +88,7 @@ export function LocalFileBar() { title="Stop using my copy" label="Stop" icon={<SquareIcon className="size-4" />} - onClick={clearLocalFile} + onClick={stopLocalFile} /> {localSyncArmed && ( <p role="status" className="basis-full text-amber-200"> diff --git a/common/components/LocalFilePicker.tsx b/common/components/LocalFilePicker.tsx @@ -1,6 +1,6 @@ "use client"; -import { useId, useRef } from "react"; +import { useEffect, useId, useRef } from "react"; // THE VISITOR'S OWN COPY, PICKED (lane missing-source, slice 2): one plain // button that opens the browser's file picker, and the one-sentence promise @@ -16,16 +16,27 @@ export const LOCAL_FILE_BUTTON = "Play your own copy"; export function LocalFilePicker({ onPick, + takeFocus, tone = "dark", }: { onPick: (file: File) => void; + // Asked once on mount: true when this control replaces a copy the visitor + // just stopped, and so takes the focus back. + takeFocus?: () => boolean; tone?: "dark"; }) { const inputRef = useRef<HTMLInputElement | null>(null); + const buttonRef = useRef<HTMLButtonElement | null>(null); const noteId = useId(); + useEffect(() => { + if (takeFocus?.()) buttonRef.current?.focus(); + // On mount only: a later render is not a return from "Stop". + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); return ( <span className="inline-flex flex-wrap items-center justify-center gap-x-2 gap-y-1" data-tone={tone}> <button + ref={buttonRef} type="button" onClick={() => inputRef.current?.click()} aria-describedby={noteId} diff --git a/common/components/PlayerProvider.tsx b/common/components/PlayerProvider.tsx @@ -14,7 +14,7 @@ import { type ReactNode, } from "react"; import type ReactPlayerType from "react-player"; -import { QueryClientContext } from "@tanstack/react-query"; +import { QueryClientContext, type QueryClient } from "@tanstack/react-query"; import { fetchTranscript } from "./transcriptCache"; import { fetchSubs } from "./subsCache"; import { fetchDigest, hasDigest } from "./digestCache"; @@ -232,6 +232,9 @@ type PlayerState = { // platform player is mounted for it. Fresh summaries first (a cached record // in IndexedDB is never refreshed), else the record's own. Null otherwise. sourceGone: SourceGone | null; + // The fresh summaries have not settled for the active video yet: no platform + // player is mounted and the own-copy offer waits (it goes where the state says). + sourceStatePending: boolean; // THE VISITOR'S OWN COPY (lane missing-source, slice 2): a local file playing // from an object URL in place of the platform player, on the cue clock // through `offset` (lib/localFileClock.ts). Never uploaded; only the offset @@ -241,6 +244,10 @@ type PlayerState = { localSyncArmed: boolean; openLocalFile: (file: File) => void; clearLocalFile: () => void; + // "Stop": clear the copy and give focus back to the "Play your own copy" + // control that takes its place (takeLocalPickerFocus, read once by it). + stopLocalFile: () => void; + takeLocalPickerFocus: () => boolean; nudgeLocalOffset: (delta: number) => void; armLocalSync: (on: boolean) => void; syncLocalTo: (cueStart: number) => void; @@ -451,36 +458,75 @@ function coreReducer(state: Core, action: CoreAction): Core { } // The active video's state as the FRESH summaries say it (lane missing-source), -// read out of the react-query cache the workspace's summaries load into (key -// ["summaries-page", origin, page]). The transcript record may be an IndexedDB -// copy from a visit before the state changed — that store is never refreshed — -// whereas the summaries are fetched per visit. `undefined` while the video is -// in no loaded page (the record's state stands in); null with no query client. -function useFreshSummaryState( - id: string | null, -): { state: VideoState; stateSince?: string } | undefined { +// read out of the react-query cache the workspace's summaries load into (keys +// ["manifest", origin] and ["summaries-page", origin, page]). The transcript +// record may be an IndexedDB copy from a visit before the state changed — that +// store is never refreshed — whereas the summaries are fetched per visit. +// - "known": a loaded page holds the video; its state wins. +// - "pending": the summaries this route loads are still coming. The cached +// record is NOT trusted meanwhile: no platform player is mounted (a stale +// record of a video since made members-only would embed it and ask the +// platform), the player slot stays the black box it is while any player +// loads. +// - "absent": the summaries settled without the video (loaded or failed), or +// this route loads none (the duplicates page): the record's state stands +// in. There is no per-channel summaries read to ask instead — summaries are +// cross-channel pages — so a route with none falls back to the record. +type FreshSummaryState = + | { kind: "known"; state: VideoState; stateSince?: string } + | { kind: "pending" } + | { kind: "absent" }; +const FRESH_PENDING: FreshSummaryState = { kind: "pending" }; +const FRESH_ABSENT: FreshSummaryState = { kind: "absent" }; + +function readFreshSummaryState(client: QueryClient, id: string): FreshSummaryState { + const { origin, slug } = splitId(id); + for (const [, page] of client.getQueriesData<DisplaySummary[]>({ queryKey: ["summaries-page", origin] })) { + if (!Array.isArray(page)) continue; + const hit = page.find((r) => r.slug === slug); + if (hit) { + const state = summaryState(hit); + return { kind: "known", state, ...(hit.stateSince ? { stateSince: hit.stateSince } : {}) }; + } + } + // Not in what has landed. Is more coming? + const cache = client.getQueryCache(); + const manifest = cache.find<{ pageCount?: number }>({ queryKey: ["manifest", origin], exact: true }); + // No summaries on this route, or an archive switched out of the search. + if (!manifest || manifest.isDisabled()) return FRESH_ABSENT; + if (manifest.state.status === "error") return FRESH_ABSENT; + if (manifest.state.status === "pending") return FRESH_PENDING; + const pageCount = manifest.state.data?.pageCount ?? 0; + for (let i = 0; i < pageCount; i++) { + const q = cache.find({ queryKey: ["summaries-page", origin, i], exact: true }); + // Not built yet: the manifest just landed and its pages are a render away. + if (!q) return FRESH_PENDING; + if (q.state.status === "pending" && !q.isDisabled()) return FRESH_PENDING; + } + return FRESH_ABSENT; +} + +function useFreshSummaryState(id: string | null): FreshSummaryState { const client = useContext(QueryClientContext); - const [found, setFound] = useState<{ key: string; state: VideoState; stateSince?: string } | undefined>(); + const [found, setFound] = useState<{ id: string; key: string; value: FreshSummaryState } | null>(null); useEffect(() => { if (!client || !id) return; - const { origin, slug } = splitId(id); const read = () => { - for (const [, page] of client.getQueriesData<DisplaySummary[]>({ queryKey: ["summaries-page", origin] })) { - if (!Array.isArray(page)) continue; - const hit = page.find((r) => r.slug === slug); - if (!hit) continue; - const next = { key: `${id}\u0000${summaryState(hit)}\u0000${hit.stateSince ?? ""}`, state: summaryState(hit), ...(hit.stateSince ? { stateSince: hit.stateSince } : {}) }; - setFound((prev) => (prev?.key === next.key ? prev : next)); - return; - } + const value = readFreshSummaryState(client, id); + const key = value.kind === "known" ? `known\u0000${value.state}\u0000${value.stateSince ?? ""}` : value.kind; + setFound((prev) => (prev?.id === id && prev.key === key ? prev : { id, key, value })); }; read(); return client.getQueryCache().subscribe((event) => { - if (event.type === "updated" && event.query.queryKey[0] === "summaries-page") read(); + if (event.type === "observerResultsUpdated") return; + const k = event.query.queryKey[0]; + if (k === "summaries-page" || k === "manifest") read(); }); }, [client, id]); - if (!found || !id || !found.key.startsWith(`${id}\u0000`)) return undefined; - return { state: found.state, ...(found.stateSince ? { stateSince: found.stateSince } : {}) }; + if (!id || !client) return FRESH_ABSENT; + // Before the first read for this video: not yet trusted. + if (!found || found.id !== id) return FRESH_PENDING; + return found.value; } // localStorage, or null where the browser refuses it. @@ -585,10 +631,13 @@ export function PlayerProvider({ }; }, [detail, detailMatches, urlVt]); const freshState = useFreshSummaryState(activeSlug); + // The summaries are still coming: neither the cached record's state nor a + // platform player is trusted yet (useFreshSummaryState). + const sourceStatePending = freshState.kind === "pending"; const sourceGone: SourceGone | null = useMemo(() => { - if (!data) return null; - const state = freshState ? freshState.state : data.state; - const since = freshState ? freshState.stateSince : data.stateSince; + if (!data || freshState.kind === "pending") return null; + const state = freshState.kind === "known" ? freshState.state : data.state; + const since = freshState.kind === "known" ? freshState.stateSince : data.stateSince; if (!state || !isNotPublicState(state)) return null; return { state, ...(since ? { stateSince: since } : {}) }; }, [data, freshState]); @@ -831,6 +880,19 @@ export function PlayerProvider({ setPlaying(false); }, [revokeLocalUrl]); + // When "Stop" was pressed; the picker that mounts in the copy's place takes + // focus if it mounts within a moment of it (and only once). + const pickerFocusAtRef = useRef(0); + const stopLocalFile = useCallback(() => { + pickerFocusAtRef.current = Date.now(); + clearLocalFile(); + }, [clearLocalFile]); + const takeLocalPickerFocus = useCallback(() => { + const due = pickerFocusAtRef.current > 0 && Date.now() - pickerFocusAtRef.current < 2000; + pickerFocusAtRef.current = 0; + return due; + }, []); + const applyLocalOffset = useCallback( (next: number) => { if (!activeSlug) return; @@ -1166,10 +1228,13 @@ export function PlayerProvider({ openInPreservetube, seekTo, sourceGone, + sourceStatePending, localFile: localActive && local ? { name: local.name, offset: localOffset, error: localError } : null, localSyncArmed: localActive && localSyncArmed, openLocalFile, clearLocalFile, + stopLocalFile, + takeLocalPickerFocus, nudgeLocalOffset, armLocalSync, syncLocalTo, @@ -1201,6 +1266,7 @@ export function PlayerProvider({ openInPreservetube, seekTo, sourceGone, + sourceStatePending, localActive, local, localOffset, @@ -1208,6 +1274,8 @@ export function PlayerProvider({ localSyncArmed, openLocalFile, clearLocalFile, + stopLocalFile, + takeLocalPickerFocus, nudgeLocalOffset, armLocalSync, syncLocalTo, @@ -1291,7 +1359,12 @@ export function PlayerProvider({ webpageUrl={data.webpageUrl} compact={displayMode === "mini"} onPick={openLocalFile} + takeFocus={takeLocalPickerFocus} /> + ) : sourceStatePending ? ( + // The fresh state is not in yet: the empty black slot every player + // shows while it loads, and nothing asked of any platform. + <div className="h-full w-full" aria-busy="true" data-testid="player-pending" /> ) : data.platform === "rumble" ? ( <RumblePlayer key={data.id} @@ -1470,6 +1543,7 @@ function SourceMissingPanel({ webpageUrl, compact, onPick, + takeFocus, }: { gone: SourceGone; platform: Platform; @@ -1477,6 +1551,7 @@ function SourceMissingPanel({ webpageUrl: string; compact: boolean; onPick: (file: File) => void; + takeFocus: () => boolean; }) { const sentence = sourceMissingSentence({ state: gone.state, @@ -1493,21 +1568,26 @@ function SourceMissingPanel({ } return ( <section - aria-label="Source" + aria-label="Source availability" data-testid="source-missing" data-state={gone.state} className="flex h-full w-full flex-col items-center justify-center gap-2 sm:gap-3 overflow-y-auto p-3 sm:p-4 text-center" > <p className="max-w-md text-sm text-zinc-100">{sentence}</p> - <a - href={webpageUrl} - target="_blank" - rel="noopener noreferrer" - className="text-sm text-zinc-200 underline hover:text-white" - > - {sourceLinkLabel(platform, gone.state)} - </a> - <LocalFilePicker onPick={onPick} /> + {webpageUrl ? ( + <a + href={webpageUrl} + target="_blank" + rel="noopener noreferrer" + className="text-sm text-zinc-200 underline hover:text-white" + > + {sourceLinkLabel(platform, gone.state)} + </a> + ) : ( + // No address on record: the label, never an empty link. + <span className="text-sm text-zinc-200">{sourceLinkLabel(platform, gone.state)}</span> + )} + <LocalFilePicker onPick={onPick} takeFocus={takeFocus} /> </section> ); } diff --git a/export/CHANGELOG.md b/export/CHANGELOG.md @@ -3,14 +3,19 @@ ## [Unreleased] - **A video whose source is no longer public says so, with the day, and mounts no dead player.** - A members-only, private or removed video gets one sentence in the player's place, e.g. "This stream is no - longer public on YouTube (members-only since 19 Nov 2026). The transcript is kept here." - - The platform link is kept but marked ("Open on YouTube (members-only)"). No embed is loaded and nothing is - asked of the platform. + longer public on YouTube (members-only; first seen 19 Nov 2026). The transcript is kept here." The day is + when the archive first saw the state, not when the platform changed it; a state the archive has no first + sighting of on record shows no day ("(removed)"). + - The platform link is kept but marked ("Open on YouTube (members-only)"), or shown as plain text when the + record has no address. No embed is loaded and nothing is asked of the platform. - The transcript, a cue click, the clip marks and Share work as for any video. Unlisted and "Missing?" videos keep their player. - - A search card's state badge shows the day in its tooltip. + - A search card's state badge shows the day in its tooltip ("…; first seen 19 Nov 2026"). - The state is read from the fresh summaries first, so a video's transcript cached in the browser from an earlier visit no longer hides a later change. The browser's transcript cache is cleared once for it. + - Until the summaries have answered, no platform player is mounted: the player slot stays black, so a cached + record of a video since made members-only never asks the platform. A page that loads no summaries (Duplicates) + goes by the record. - `corpus.json` documents the record keys `state` and `stateSince` (YYYYMMDD). They are per-record and additive, so it stays spec 6. - **Play your own copy.** @@ -20,7 +25,8 @@ control otherwise. Beside it: "Your file stays in this browser: nothing is uploaded." - Picking a file makes no network request, and only the sync offset is remembered (per video, in this browser). - The offset can be nudged by −1, −0.1, +0.1 or +1 s, or set with **This line is playing now** and a click on - the line you hear (Esc cancels). **Stop** puts the panel or the platform player back. + the line you hear (Esc cancels). **Stop** puts the panel or the platform player back, and the focus on + **Play your own copy**. ## [0.11.3] - 2026-11-18 - **A site's secondary tags sit under More filters, and a site with many channels can find one.** A curated tag the operator marked secondary is still published, still filters and still rides on `?tg=` links, but its chips sit in a **More filters** disclosure above Advanced options instead of the main Tags row, its group's name beside them. It is closed by default and opens on its own when a link or a saved profile selects one of its tags; once you open or close it, it stays as you left it, and its summary says how many of its tags are selected. On a site with more than 12 channels, a small magnifier beside **Channels** opens a field that narrows the groups as you type to the channels whose name or slug holds the text (case, accents and punctuation ignored), or to a whole group whose name does. Esc clears it and gives the panel back as it was; in the phone sheet the first Esc clears the field and the next closes the sheet. A site with no secondary tag and 12 channels or fewer looks as it did. Needs a rebuild and deploy of each site. diff --git a/export/e2e/fixtures/missing-source.ts b/export/e2e/fixtures/missing-source.ts @@ -16,6 +16,8 @@ export type Vid = { isLivestream?: boolean; // What the transcript record says, when it differs from the summary. record?: { state?: string; stateSince?: string }; + // A record with no platform address at all. + noUrl?: boolean; }; export const VIDS: Vid[] = [ @@ -28,6 +30,8 @@ export const VIDS: Vid[] = [ { id: "synthstl001", title: "Synth stale record", state: "members_only", stateSince: "20261001", record: {} }, // The summaries say public again; a stale record still says removed. { id: "synthbak001", title: "Synth back again", record: { state: "deleted", stateSince: "20250101" } }, + // Removed, and no address to link to. + { id: "synthnou001", title: "Synth no address", state: "deleted", noUrl: true }, ]; export const CUES = [ @@ -57,7 +61,7 @@ function summary(v: Vid) { ...(v.state ? { state: v.state } : {}), ...(v.state && v.stateSince ? { stateSince: v.stateSince } : {}), platform: "youtube" as const, - webpageUrl: watchUrl(v.id), + webpageUrl: v.noUrl ? "" : watchUrl(v.id), }; } @@ -82,8 +86,13 @@ async function fulfillJson(route: Route, body: unknown) { } // Every archive path the workspace asks for, mocked; every request to a video -// platform recorded and aborted (`platformHits`). -export async function installMissingSourceRoutes(page: Page): Promise<{ platformHits: string[] }> { +// platform recorded and aborted (`platformHits`). `summariesDelayMs` holds the +// summaries pages back, so the transcript record lands first (a returning +// visitor's cached record against a slow network). +export async function installMissingSourceRoutes( + page: Page, + opts: { summariesDelayMs?: number } = {}, +): Promise<{ platformHits: string[] }> { const platformHits: string[] = []; await page.route(/youtube\.com|youtube-nocookie\.com|ytimg\.com|googlevideo\.com/, async (route) => { platformHits.push(route.request().url()); @@ -102,7 +111,10 @@ export async function installMissingSourceRoutes(page: Page): Promise<{ platform defaultGroupId: "default", }), ); - await page.route("**/summaries/page-*.json", (route) => fulfillJson(route, list)); + await page.route("**/summaries/page-*.json", async (route) => { + if (opts.summariesDelayMs) await new Promise((r) => setTimeout(r, opts.summariesDelayMs)); + await fulfillJson(route, list); + }); await page.route(/\/transcripts\/[^/]+\/manifest\.json$/, (route) => fulfillJson(route, { version: 1, diff --git a/export/e2e/local-file.spec.ts b/export/e2e/local-file.spec.ts @@ -97,6 +97,8 @@ test.describe("export — play your own copy", () => { await page.getByRole("button", { name: "Stop using my copy" }).click(); await expect(video(page)).toHaveCount(0); await expect(page.getByTestId("source-missing")).toBeVisible(); + // Focus goes back to the control that picked the file. + await expect(panel.getByRole("button", { name: "Play your own copy" })).toBeFocused(); const revoked = await page.evaluate((u) => fetch(u as string).then(() => false, () => true), src); expect(revoked).toBe(true); }); @@ -133,5 +135,7 @@ test.describe("export — play your own copy", () => { await cue(page, "fourth synth line"); await expect.poll(() => fileTime(page)).toBeCloseTo(5, 1); expect(after).toEqual([]); + await page.getByRole("button", { name: "Stop using my copy" }).click(); + await expect(offer.getByRole("button", { name: "Play your own copy" })).toBeFocused(); }); }); diff --git a/export/e2e/source-missing.spec.ts b/export/e2e/source-missing.spec.ts @@ -10,6 +10,7 @@ import { installMissingSourceRoutes, slugOf, watchUrl } from "./fixtures/missing // first: a transcript record cached in IndexedDB is never refreshed. const panel = (page: import("@playwright/test").Page) => page.getByTestId("source-missing"); +const panelRegion = (page: import("@playwright/test").Page) => page.getByRole("region", { name: "Source availability" }); test.describe("export — a source no longer public", () => { test("members-only: the sentence, the marked link, no embed and no platform request", async ({ page }) => { @@ -17,8 +18,9 @@ test.describe("export — a source no longer public", () => { await page.goto(`/?v=${slugOf("synthmem001")}`); await expectModalOpen(page); await expect(panel(page)).toContainText( - "This stream is no longer public on YouTube (members-only since 19 Nov 2026). The transcript is kept here.", + "This stream is no longer public on YouTube (members-only; first seen 19 Nov 2026). The transcript is kept here.", ); + await expect(panelRegion(page)).toBeVisible(); const link = panel(page).getByRole("link", { name: "Open on YouTube (members-only)" }); await expect(link).toHaveAttribute("href", watchUrl("synthmem001")); await expect(link).toHaveAttribute("rel", /noopener/); @@ -43,9 +45,16 @@ test.describe("export — a source no longer public", () => { await page.goto(`/?v=${slugOf("synthdel001")}`); await expectModalOpen(page); await expect(panel(page)).toContainText( - "This video is no longer public on YouTube (removed since 31 Dec 2025). The transcript is kept here.", + "This video is no longer public on YouTube (removed; first seen 31 Dec 2025). The transcript is kept here.", ); await expect(panel(page).getByRole("link", { name: "Open on YouTube (removed)" })).toBeVisible(); + + // No address: the label, never an empty link. + await page.goto(`/?v=${slugOf("synthnou001")}`); + await expectModalOpen(page); + await expect(panel(page)).toContainText("Open on YouTube (removed)"); + await expect(panel(page).getByRole("link")).toHaveCount(0); + await expect(page.locator('a[href=""]')).toHaveCount(0); }); test("unlisted and public keep their player", async ({ page }) => { @@ -60,10 +69,16 @@ test.describe("export — a source no longer public", () => { }); test("the fresh summaries win over a stale record, both ways", async ({ page }) => { - await installMissingSourceRoutes(page); + // The summaries arrive well after the stale record: no embed is mounted + // meanwhile, so the platform is never asked. + const { platformHits } = await installMissingSourceRoutes(page, { summariesDelayMs: 1500 }); await page.goto(`/?v=${slugOf("synthstl001")}`); await expectModalOpen(page); - await expect(panel(page)).toContainText("(members-only since 1 Oct 2026)"); + await expect(page.getByRole("heading", { name: "Synth stale record" })).toBeVisible(); + await expect(panel(page)).toContainText("(members-only; first seen 1 Oct 2026)"); + await page.waitForTimeout(500); + expect(platformHits).toEqual([]); + await expect(page.locator("iframe")).toHaveCount(0); await page.goto(`/?v=${slugOf("synthbak001")}`); await expectModalOpen(page); @@ -84,7 +99,7 @@ test.describe("export — a source no longer public", () => { await input.fill("synth"); await input.press("Enter"); const badge = page.getByTestId("state-badge-members_only").first(); - await expect(badge).toHaveAttribute("title", /since 19 Nov 2026$/); + await expect(badge).toHaveAttribute("title", /; first seen 19 Nov 2026$/); await expect(page.getByTestId("state-badge-private")).toHaveAttribute("title", "Made private on the source platform"); }); });