Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): agent and browser panel show the same page after a late desktop attach #22877

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 13 commits intomain fromrefs/pull/22877/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 6 changed files with 63 additions and 1 deletion (loading 3).

x
0 of 6 viewed, 6 left
33 additions and 0 deletionsapps/server/src/preview/Manager.tsModified
View file
@@ -47,6 +47,10 @@
readonly reportStatus: (
input: PreviewReportStatusInput & { readonly serverControlled?: boolean },
) => Effect.Effect<void, PreviewError>;
+ /** Records that a server tab runs headless. It stays headless until it closes. */
+ readonly markHeadless: (
+ input: PreviewCloseInput & { readonly tabId: string },
+ ) => Effect.Effect<void, PreviewError>;
readonly requestReveal: (
input: PreviewCloseInput & { readonly tabId: string; readonly force: boolean },
) => Effect.Effect<void, PreviewError>;
@@ -307,6 +311,34 @@
});
​
+ const markHeadless: PreviewManager["Service"]["markHeadless"] = Effect.fn(
+ "PreviewManager.markHeadless",
+ )(function* (input) {
+ return yield* mutateExistingSession(
+ input.threadId,
+ input.tabId,
+ Effect.fn("PreviewManager.markSessionHeadless")(function* (session) {
+ if (session.snapshot.headless) return { next: session, emit: null, result: undefined };
+ const snapshot: PreviewSessionSnapshot = {
+ ...session.snapshot,
+ headless: true,
+ updatedAt: yield* currentIsoTimestamp,
+ };
+ return {