Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): inactive preview guests stop painting #34681

Openjoei4cm(GitHub profile, opens in a new tab)wants to merge 11 commits intomain fromrefs/pull/34681/headopened View on GitHub

Showing 7 changed files with 70 additions and 7 deletions (loading 4).

x
0 of 7 viewed, 7 left
52 additions and 3 deletionsapps/desktop/src/preview/DesktopBrowserHost.test.tsModified
View file
@@ -1,6 +1,6 @@
// @effect-diagnostics nodeBuiltinImport:off - Stands in for an Electron debugger.
import { describe, expect, it, vi } from "@effect/vitest";
-import { DesktopBrowserEvent } from "@t3tools/contracts";
+import { DesktopBrowserEvent, PREVIEW_TITLE_WATCH_OBJECT_GROUP } from "@t3tools/contracts";
import * as Effect from "effect/Effect";
import * as Fiber from "effect/Fiber";
import * as Queue from "effect/Queue";
@@ -41,12 +41,13 @@
host: DesktopBrowserHost.DesktopBrowserHost["Service"],
id: number,
method: string,
+ params: Record<string, unknown> = {},
) =>
host.handleCommandLine(
encodeJson({
type: "cdp",
...key,
- message: encodeJson({ id, method, params: { id }, sessionId: "t3-preview-page" }),
+ message: encodeJson({ id, method, params: { ...params, id }, sessionId: "t3-preview-page" }),
}),
);
​
@@ -441,9 +442,9 @@
​
// A command that outlasts its first prod is painted like a capture, which also unthrottles it.
// A wait the agent's turn gave up on is no longer prodded.
+ painting.length = 0;
yield* command(host, 5, "Runtime.evaluate");