Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): route mouse thumb buttons to the in-app browser #4459

Mergedakosbalogh(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/4459/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 83 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
1 addition and 0 deletionsapps/desktop/src/preview/GuestProtocol.tsModified
View file
@@ -4,3 +4,4 @@
export const ANNOTATION_CAPTURED_CHANNEL = "preview:annotation-captured";
export const ANNOTATION_THEME_CHANNEL = "preview:annotation-theme";
export const HUMAN_INPUT_CHANNEL = "preview:human-input";
+export const MOUSE_NAVIGATE_CHANNEL = "preview:mouse-navigate";
63 additions and 0 deletionsapps/desktop/src/preview/Manager.test.tsModified
View file
@@ -2239,6 +2239,69 @@
+ effectIt.effect("navigates the guest history when the thumb-button ipc fires", () =>
+ withManager((manager) =>
+ Effect.gen(function* () {
+ let mouseNavigate: ((event: unknown, payload: unknown) => void) | undefined;
+ const goBack = vi.fn();
+ const goForward = vi.fn();
+ let canGoBack = true;
+ fromId.mockReturnValue({
+ id: 42,
+ isDestroyed: () => false,
+ getType: () => "webview",
+ getURL: () => "https://example.com",
+ getTitle: () => "Example",
+ isLoading: () => false,
+ getZoomFactor: () => 1,
+ setZoomFactor: vi.fn(),
+ on: vi.fn(),
+ off: vi.fn(),