Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): terminal link context menu actions #7280

Closedflamboh(GitHub profile, opens in a new tab)wants to merge 10 commits intomain fromrefs/pull/7280/headopened View on GitHub

Showing 12 changed files with 65 additions and 8 deletions (loading 9).

x
0 of 12 viewed, 12 left
17 additions and 0 deletionsapps/web/src/components/preview/openTerminalLinkInPreview.test.tsModified
View file
@@ -4,6 +4,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vite-plus/test";
​
import {
+ openTerminalLinkInIntegratedBrowser,
openTerminalLinkInPreview,
TerminalLinkPreviewOpenError,
} from "./openTerminalLinkInPreview";
@@ -113,6 +114,22 @@
expect(openPreview).not.toHaveBeenCalled();
});
​
+ it("honors an explicit integrated-browser action regardless of the default", async () => {
+ linkTargetMocks.preference.mockReturnValue("system");
+ const fallbackToBrowser = vi.fn();
+ const openPreview = vi.fn(async () => AsyncResult.success(snapshot));
+​
+ await openTerminalLinkInIntegratedBrowser({
+ url: "http://localhost:3000/",
+ threadRef,
+ openPreview,
+ fallbackToBrowser,
+ });
+​
+ expect(openPreview).toHaveBeenCalledOnce();
+ expect(fallbackToBrowser).not.toHaveBeenCalled();
+ });
+​
it("opens public URLs in-app too, not only local servers", async () => {