Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): preserve composer focus during preview presses #9530

Closed0bkevin(GitHub profile, opens in a new tab)wants to merge 4 commits intomain fromrefs/pull/9530/headopened View on GitHub

Showing 10 changed files with 59 additions and 2 deletions (loading 8).

x
0 of 10 viewed, 10 left
39 additions and 0 deletionsapps/desktop/src/ipc/methods/preview.test.tsModified
View file
@@ -170,3 +170,42 @@
).toThrow();
});
});
+​
+describe("automationPressResult", () => {
+ effectIt.effect("returns an interrupted outcome for human control takeover", () =>
+ Effect.gen(function* () {
+ const error = new PreviewManager.PreviewAutomationControlInterruptedError({
+ operation: "press",
+ tabId: "tab-1",
+ webContentsId: 42,
+ });
+​
+ expect(yield* PreviewIpc.automationPressResult(Effect.fail(error))).toEqual({
+ status: "interrupted",
+ });
+ }),
+ );
+​
+ effectIt.effect("returns a completed outcome after a successful press", () =>
+ Effect.gen(function* () {
+ expect(yield* PreviewIpc.automationPressResult(Effect.succeed("restored"))).toEqual({
+ status: "completed",
+ focusDisposition: "restored",
+ });
+ }),
+ );
+​
+ effectIt.effect("keeps unexpected failures as rejected effects", () =>