Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): keep preview automation from stealing chat focus #19548

ClosedPixPMusic(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/19548/headopened View on GitHub

Showing 19 changed files with 73 additions and 25 deletions (loading 16).

x
0 of 19 viewed, 19 left
38 additions and 0 deletionsapps/desktop/src/electron/ElectronWindow.test.tsModified
View file
@@ -2,6 +2,7 @@
import * as HostProcess from "@t3tools/shared/HostProcess";
import * as Cause from "effect/Cause";
import * as Effect from "effect/Effect";
+import * as Option from "effect/Option";
import * as Fiber from "effect/Fiber";
import * as Layer from "effect/Layer";
import type * as Electron from "electron";
@@ -66,6 +67,7 @@
return {
id: input.id,
isDestroyed: vi.fn(() => input.destroyed),
+ webContents: { getType: () => "window" },
} as unknown as Electron.BrowserWindow;
​
@@ -88,6 +90,41 @@
​
describe("ElectronWindow", () => {
+ it.effect(
+ "keeps offscreen previews out of app activation and broadcasts, and closes them on shutdown",
+ () =>
+ Effect.gen(function* () {
+ const preview = {
+ id: 2,
+ isDestroyed: () => false,
+ webContents: { getType: () => "offscreen", send: vi.fn() },