Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): agent typing in a preview tab no longer lands in the app #18556

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/18556/headmerged by juliusmarminge View on GitHub

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

x
0 of 3 viewed, 3 left
2 additions and 1 deletionapps/desktop/src/preview/DesktopBrowserHost.tsModified
View file
@@ -24,6 +24,7 @@
import * as Stream from "effect/Stream";
​
import { createCdpRelayConnection, type CdpRelayConnection } from "./CdpRelay.ts";
+import { sendPageCommand } from "./GuestInput.ts";
​
const encodeEvent = Schema.encodeSync(Schema.fromJsonString(DesktopBrowserEvent));
const decodeCommand = Schema.decodeUnknownOption(Schema.fromJsonString(DesktopBrowserCommand));
@@ -115,7 +116,7 @@
send: (method, params, sessionId) =>
sessionId === undefined
- ? debuggee.sendCommand(method, params)
+ ? sendPageCommand(webContents, debuggee, method, params)
: debuggee.sendCommand(method, params, sessionId),
targetId: () =>
debuggee
114 additions and 0 deletionsapps/desktop/src/preview/GuestInput.test.tsAdded
View file
@@ -0,0 +1,114 @@
+import { describe, expect, it, vi } from "vite-plus/test";
+​
+import { sendPageCommand, toKeyboardInputEvents } from "./GuestInput.ts";
+​
+/** A guest whose page reports `focusedDocument` for the focus probe. */
+const makeGuest = ({
+ focused,
+ focusedDocument = true,