Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(preview): typed URLs navigate browser tabs when WSL is the primary environment #31172

ClosedTHEtheChad(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/31172/headopened View on GitHub

Showing 3 changed files with 20 additions and 1 deletion.

x
0 of 3 viewed, 3 left
2 additions and 0 deletionsapps/server/src/preview/Manager.test.tsModified
View file
@@ -85,6 +85,8 @@
const manager = yield* PreviewManager.PreviewManager;
const collector = yield* collectEvents;
const opened = yield* manager.open({ threadId, runtime: "server", reveal: false });
+ // The test server has no desktop browser channel.
+ expect(opened.headless).toBe(true);
yield* manager.requestReveal({ threadId, tabId: opened.tabId, force: true });
const first = (yield* manager.list({ threadId })).sessions[0];
expect(first?.reveal).toBe(true);
7 additions and 0 deletionsapps/server/src/preview/Manager.tsModified
View file
@@ -29,6 +29,8 @@
import * as SynchronizedRef from "effect/SynchronizedRef";
import { PreviewControlRequiredError } from "@t3tools/contracts";
​
+import * as ServerConfig from "../config.ts";
+​
export class PreviewManager extends Context.Service<
PreviewManager,
@@ -124,6 +126,10 @@
/** @public */
export const make = Effect.gen(function* PreviewManagerMake() {
const random = yield* SecureRandom.SecureRandom;
+ const config = yield* ServerConfig.ServerConfig;
+ // Without a desktop browser channel no desktop can draw server tabs, so publish them headless.
+ const serverTabsHeadless =