Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): agent tabs in background threads open in the desktop browser #19919

MergedMahirAbbas(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/19919/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 94 additions and 5 deletions (loading 2).

x
0 of 5 viewed, 5 left
2 additions and 0 deletionsapps/web/src/browser/ElectronBrowserHost.tsxModified
View file
@@ -13,6 +13,7 @@
​
import { isElectron } from "~/env";
import { useClientSettingsHydrated } from "~/hooks/useSettings";
+import { useDesktopHostedPreviewSessions } from "~/components/preview/usePreviewSession";
import { useActivePreviewSessions } from "~/previewStateStore";
import { previewEnvironment } from "~/state/preview";
import { useEnvironmentScope } from "~/state/session";
@@ -29,6 +30,7 @@
export function ElectronBrowserHost() {
const previewByThreadKey = useActivePreviewSessions();
const primaryEnvironmentId = useAtomValue(primaryEnvironmentIdAtom);
+ useDesktopHostedPreviewSessions(primaryEnvironmentId);
const activeSessions = Object.entries(previewByThreadKey).flatMap(([threadKey, previewState]) => {
const threadRef = parseScopedThreadKey(threadKey);
return threadRef
51 additions and 3 deletionsapps/web/src/components/preview/previewSessionSync.browser.test.tsModified
View file
@@ -26,6 +26,8 @@
events: new Map<string, Atom.Writable<EventResult>>(),
}));
​
+vi.mock("~/env", () => ({ isElectron: true }));
+​
vi.mock("~/state/preview", async () => {
const { AsyncResult, Atom } = await import("effect/reactivity");
return {