Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/ui-react/tests/browser/recordings-tray.offline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { installFaultNetwork } from "./offline/fault-network.ts";
import { installWavMicrophone, watchMicrophone } from "./offline/fake-microphone.ts";
import { generateWav, AUDIO_FIXTURES } from "./offline/audio-fixtures.ts";
import { describeHit, touchFloor } from "./hit-reach.js";
import { deepgramDiscovery } from "../fixtures/dictation-discovery.js";

const TEXT = "Ask Penelope whether the loom order arrived.";
const wait = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
Expand Down Expand Up @@ -146,6 +147,10 @@ for (const theme of ["dark", "light"]) for (const width of [320, 390, 900, 1280]
expect(c.host.querySelector('[aria-label="Scroll to latest"]'), "reading mode disabled tailing").not.toBeNull();
const anchor = [...c.host.querySelectorAll<HTMLElement>("[data-transcript-anchor]")].find(el => el.getBoundingClientRect().bottom > scroller.getBoundingClientRect().top)!;
const top = anchor.getBoundingClientRect().top;
// The tray's Transcribe control waits on dictation discovery (#3709). Known
// up front, it renders with the tray, so this measures the tray appearing
// rather than a later discovery answer growing it.
c.root.stores.voice.setState({ discovery: { snapshot: deepgramDiscovery(false), at: Date.now() + 24 * 60 * 60_000 } });
const requestsBefore = c.net.requests.length; const framesBefore = c.net.frames.length;
const row = await c.seed("interrupted");
const card = await c.seed("transcript-ready", TEXT, "2026-07-12T09:00:00");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ Object.assign(window, {
root.stores.connection.getState().setVpnStatus("connected", probe.accountKey ?? null);
await root.localWork!.restoring();
const sink = root.recordings!.sink();
// The mounted tray's recovery holds the recording lock for a moment.
// The mounted tray's recovery, or the previous seed's capture still
// releasing, holds the recording lock for a moment. This page is the
// only tab, so either refusal names a hold of its own.
for (let attempt = 0; ; attempt++) {
try { await sink.begin!({ mimeType: "audio/webm;codecs=opus" }); break; }
catch (error) { if (attempt > 50 || !String(error).includes("still being checked")) throw error; await new Promise((resolve) => setTimeout(resolve, 100)); }
catch (error) { if (attempt > 50 || !/still being checked|Recording in another Brain tab/.test(String(error))) throw error; await new Promise((resolve) => setTimeout(resolve, 100)); }
}
await sink.chunk({ index: 0, startMs: 0, endMs: 1000, data: new Blob([new Uint8Array([0x1a, 0x45, 0xdf, 0xa3, 1, 2, 3])]) });
await sink.end!("user");
Expand Down
2 changes: 2 additions & 0 deletions packages/ui-react/tests/fixtures/parallel-sessions-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ Object.assign(window, {
.map((v) => ({ sessionId: v.sessionId, state: v.state, pendingKind: v.pendingKind, cleared: v.cleared, turnId: v.turnId, settled: v.settled })),
records: () => root.stores.trackers.getState().records,
spoken: () => [...spoken],
/** The title the session list holds for a session, which labels its announcements. */
listedTitle: (sessionId: string) => root.stores.sessions.getState().sessions.find((s) => s.id === sessionId)?.title ?? null,
draft: () => {
const drafts = root.stores.drafts.getState();
const d = drafts.drafts[drafts.idFor(root.stores.chat.getState().activeSessionId)];
Expand Down
5 changes: 4 additions & 1 deletion packages/ui-react/tests/parallel-sessions-runtime.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,10 @@ describe.skipIf(!executablePath)("mounted parallel sessions", () => {
expect((await drawn(run, a.page)).sort(), "both drawn").toEqual([A, B].sort());
await neverDone(run, a.page, [A, B]);

// B fails unwatched: failed, and announced once.
// B fails unwatched: failed, and announced once. The announcement is
// labelled from the session list, so wait until the list has read B's
// host title; before that the label falls back to B's first prompt.
await until(a.page, `p.listedTitle(${JSON.stringify(B)}) === ${JSON.stringify(titles.get(B))}`);
await release(pb, "fail");
await until(a.page, `${state(B)}?.state === "failed"`);
await until(a.page, "p.spoken().length >= 1");
Expand Down
Loading