diff --git a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/TipTapMarkdownRenderer.tsx b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/TipTapMarkdownRenderer.tsx index c8455f8d29f..fcd4fad7aa9 100644 --- a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/TipTapMarkdownRenderer.tsx +++ b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/TipTapMarkdownRenderer.tsx @@ -5,6 +5,12 @@ import { EditorState } from "@tiptap/pm/state"; import { type Editor, EditorContent, useEditor } from "@tiptap/react"; import { BubbleMenu } from "@tiptap/react/menus"; import { type MutableRefObject, useEffect, useRef } from "react"; +import { + type LinkAction, + useInlineUrlPolicy, + useTerminalUrlPolicy, +} from "renderer/lib/clickPolicy"; +import { electronTrpcClient } from "renderer/lib/trpc-client"; import { useMarkdownStyle } from "renderer/stores"; import { defaultConfig } from "../../styles/default/config"; import { tufteConfig } from "../../styles/tufte/config"; @@ -12,6 +18,7 @@ import { SelectionContextMenu } from "../SelectionContextMenu"; import { BubbleMenuToolbar } from "./components/BubbleMenuToolbar"; import { createMarkdownExtensions } from "./createMarkdownExtensions"; import { createMarkdownMerger } from "./mergeMarkdownEdits"; +import { resolveLinkClick } from "./resolveLinkClick"; const styleConfigs = { default: defaultConfig, @@ -41,6 +48,13 @@ interface TipTapMarkdownRendererProps { * change and resets the editor content and merge baseline. */ preserveSourceFormatting?: boolean; + /** + * Routes a link click to the host's panes. With it, links follow the 4-tier + * URL click policy; without it there is no pane to open into, so any bound + * tier opens the system browser, as in MarkdownEditor. + */ + onOpenUrl?: (url: string, action: LinkAction) => void; + onUnboundLinkClick?: (clientX: number, clientY: number) => void; } interface SourceTracking { @@ -119,6 +133,8 @@ export function TipTapMarkdownRenderer({ onChange, onSave, preserveSourceFormatting = false, + onOpenUrl, + onUnboundLinkClick, }: TipTapMarkdownRendererProps) { const globalStyle = useMarkdownStyle(); const style = styleProp ?? globalStyle; @@ -128,8 +144,21 @@ export function TipTapMarkdownRenderer({ const onSaveRef = useRef(onSave); const sourceTrackingRef = useRef(null); + const paneUrlPolicy = useTerminalUrlPolicy(); + const inlineUrlPolicy = useInlineUrlPolicy(); + const linkClickRef = useRef({ + getAction: inlineUrlPolicy.getAction, + onOpenUrl, + onUnboundLinkClick, + }); + onChangeRef.current = onChange; onSaveRef.current = onSave; + linkClickRef.current = { + getAction: (onOpenUrl ? paneUrlPolicy : inlineUrlPolicy).getAction, + onOpenUrl, + onUnboundLinkClick, + }; const editor = useEditor({ immediatelyRender: false, @@ -143,6 +172,37 @@ export function TipTapMarkdownRenderer({ attributes: { class: cn("focus:outline-none", editable && "min-h-[100px]"), }, + handleDOMEvents: { + // ProseMirror never calls handleClick for a shift-click (it lets the + // browser extend the selection), so the shift tiers are only + // reachable from the DOM click. + click: (_view, event) => { + const target = event.target as HTMLElement | null; + if (!target?.closest?.("a")) return false; + event.preventDefault(); + const link = linkClickRef.current; + const click = resolveLinkClick(event, link.getAction); + if (click.kind === "none") return false; + if (click.kind === "unbound") { + link.onUnboundLinkClick?.(event.clientX, event.clientY); + return false; + } + if (link.onOpenUrl) { + link.onOpenUrl(click.url, click.action); + return true; + } + electronTrpcClient.external.openUrl + .mutate(click.url) + .catch((error) => { + console.error( + "[TipTapMarkdownRenderer] Failed to open URL:", + click.url, + error, + ); + }); + return true; + }, + }, }, onCreate: ({ editor: createdEditor }) => { sourceTrackingRef.current = createSourceTracking(createdEditor, value); diff --git a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.test.ts b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.test.ts index 063ad76cf60..db9df5ef4a6 100644 --- a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.test.ts +++ b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.test.ts @@ -6,7 +6,7 @@ import { GlobalRegistrator } from "@happy-dom/global-registrator"; const alreadyRegistered = GlobalRegistrator.isRegistered; if (!alreadyRegistered) GlobalRegistrator.register(); -const { afterAll, describe, expect, it } = await import("bun:test"); +const { afterAll, describe, expect, it, spyOn } = await import("bun:test"); const { Editor } = await import("@tiptap/core"); const { createMarkdownExtensions } = await import("./createMarkdownExtensions"); @@ -42,6 +42,39 @@ function roundTrip(markdown: string): string { } } +describe("preview links", () => { + it.each([ + true, + false, + ])("never opens a link itself when editable is %p", (editable) => { + const editor = new Editor({ + editable, + extensions: createMarkdownExtensions({ + editable, + onSaveRef: { current: undefined }, + }), + content: "[**Example**](https://example.com/)", + }); + const open = spyOn(window, "open").mockReturnValue(null); + try { + const event = new MouseEvent("click", { button: 0 }); + Object.defineProperty(event, "target", { + value: editor.view.dom.querySelector("strong"), + }); + + const handled = editor.view.someProp("handleClick", (handler) => + handler(editor.view, 1, event), + ); + + expect(handled).toBeFalsy(); + expect(open).not.toHaveBeenCalled(); + } finally { + open.mockRestore(); + editor.destroy(); + } + }); +}); + describe("image attribute parsing", () => { // @tiptap/core's default attribute parser (fromString) coerces // numeric/boolean-looking strings, so ![123](x.png) used to load as diff --git a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.ts b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.ts index d5e5563e493..4107c5f0510 100644 --- a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.ts +++ b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/createMarkdownExtensions.ts @@ -242,7 +242,7 @@ export function createMarkdownExtensions({ HardBreak, History, Link.configure({ - openOnClick: !editable, + openOnClick: false, HTMLAttributes: { class: "text-primary underline underline-offset-2 hover:text-primary/80", diff --git a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/resolveLinkClick.test.ts b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/resolveLinkClick.test.ts new file mode 100644 index 00000000000..3a9e15b2603 --- /dev/null +++ b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/resolveLinkClick.test.ts @@ -0,0 +1,153 @@ +import { GlobalRegistrator } from "@happy-dom/global-registrator"; + +const alreadyRegistered = GlobalRegistrator.isRegistered; +if (!alreadyRegistered) GlobalRegistrator.register(); + +const { afterAll, describe, expect, it } = await import("bun:test"); +const { Editor } = await import("@tiptap/core"); +const { tierFor } = await import("renderer/lib/clickPolicy/tiers"); +const { createMarkdownExtensions } = await import("./createMarkdownExtensions"); +const { resolveLinkClick } = await import("./resolveLinkClick"); + +type LinkTierMap = import("renderer/lib/clickPolicy").LinkTierMap; +type ModifierEvent = import("renderer/lib/clickPolicy").ModifierEvent; + +afterAll(async () => { + if (!alreadyRegistered) await GlobalRegistrator.unregister(); +}); + +const DEFAULT_URL_LINKS: LinkTierMap = { + plain: null, + shift: "newTab", + meta: "pane", + metaShift: "external", +}; + +const FIXTURE = [ + "[**web**](https://example.com/a)", + "[mail](mailto:a@b.c)", + "[file](file:///etc/passwd)", + "[js](javascript:alert(1))", + "[vscode](vscode://file/x)", + "[relative](./other.md)", + "[anchor](#heading)", + "plain text", +].join("\n\n"); + +function fourTier(map: LinkTierMap) { + return (event: ModifierEvent) => map[tierFor(event, "4-tier")]; +} + +function click( + selector: string, + modifiers: Partial & { button?: number }, + map: LinkTierMap = DEFAULT_URL_LINKS, +) { + const editor = new Editor({ + editable: true, + extensions: createMarkdownExtensions({ + editable: true, + onSaveRef: { current: undefined }, + }), + content: FIXTURE, + }); + try { + const target = editor.view.dom.querySelector(selector); + expect(target).not.toBeNull(); + return resolveLinkClick( + { + button: 0, + metaKey: false, + ctrlKey: false, + shiftKey: false, + ...modifiers, + target, + }, + fourTier(map), + ); + } finally { + editor.destroy(); + } +} + +describe("resolveLinkClick", () => { + it("leaves a plain click unbound so the caret can land in the link", () => { + expect(click("a[href^='https'] strong", {})).toEqual({ kind: "unbound" }); + }); + + it.each([ + [{ shiftKey: true }, "newTab"], + [{ metaKey: true }, "pane"], + [{ ctrlKey: true }, "pane"], + [{ metaKey: true, shiftKey: true }, "external"], + ] as const)("maps %p to %s", (modifiers, action) => { + expect(click("a[href^='https'] strong", modifiers)).toEqual({ + kind: "open", + url: "https://example.com/a", + action, + }); + }); + + it("follows a custom tier map", () => { + const map: LinkTierMap = { + plain: "external", + shift: null, + meta: "newTab", + metaShift: "pane", + }; + expect(click("a[href^='https']", {}, map)).toMatchObject({ + action: "external", + }); + expect(click("a[href^='https']", { shiftKey: true }, map)).toEqual({ + kind: "unbound", + }); + expect(click("a[href^='https']", { metaKey: true }, map)).toMatchObject({ + action: "newTab", + }); + }); + + it.each([ + "a[href^='mailto']", + "a[href^='./']", + "a[href^='#']", + ])("ignores the non-web link %s on every tier", (selector) => { + for (const modifiers of [ + {}, + { shiftKey: true }, + { metaKey: true }, + { metaKey: true, shiftKey: true }, + ]) { + expect(click(selector, modifiers)).toEqual({ kind: "none" }); + } + }); + + it("never renders file, javascript or custom-scheme links as anchors", () => { + const editor = new Editor({ + extensions: createMarkdownExtensions({ + editable: true, + onSaveRef: { current: undefined }, + }), + content: FIXTURE, + }); + try { + const hrefs = [...editor.view.dom.querySelectorAll("a")].map((a) => + a.getAttribute("href"), + ); + expect(hrefs).toEqual([ + "https://example.com/a", + "mailto:a@b.c", + "./other.md", + "#heading", + ]); + } finally { + editor.destroy(); + } + }); + + it("ignores right-clicks and clicks outside a link", () => { + expect(click("a[href^='https']", { button: 2, metaKey: true })).toEqual({ + kind: "none", + }); + expect(click("p:last-child", { metaKey: true })).toEqual({ kind: "none" }); + }); +}); diff --git a/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/resolveLinkClick.ts b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/resolveLinkClick.ts new file mode 100644 index 00000000000..f53e8d73b35 --- /dev/null +++ b/apps/desktop/src/renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer/resolveLinkClick.ts @@ -0,0 +1,30 @@ +import type { + ClickPolicy, + LinkAction, + ModifierEvent, +} from "renderer/lib/clickPolicy"; + +export interface LinkClickEvent extends ModifierEvent { + button: number; + target: EventTarget | null; +} + +export type ResolvedLinkClick = + | { kind: "none" } + | { kind: "unbound" } + | { kind: "open"; url: string; action: LinkAction }; + +const WEB_URL = /^https?:\/\//i; + +export function resolveLinkClick( + event: LinkClickEvent, + getAction: ClickPolicy["getAction"], +): ResolvedLinkClick { + if (event.button !== 0) return { kind: "none" }; + const target = event.target as HTMLElement | null; + const href = target?.closest?.("a")?.getAttribute("href"); + if (!href || !WEB_URL.test(href)) return { kind: "none" }; + const action = getAction(event); + if (action === null) return { kind: "unbound" }; + return { kind: "open", url: href, action }; +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/FilePane.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/FilePane.tsx index 7e031fd3143..e026bbffe6c 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/FilePane.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/FilePane.tsx @@ -1,9 +1,12 @@ import { useLingui } from "@lingui/react/macro"; import type { RendererContext } from "@superset/panes"; +import { FEATURE_FLAGS } from "@superset/shared/constants"; import { alert } from "@superset/ui/atoms/Alert"; import { useWorkspaceClient, workspaceTrpc } from "@superset/workspace-client"; +import { useFeatureFlagEnabled } from "posthog-js/react"; import { useCallback, useEffect } from "react"; import { MarkdownResourceProvider } from "renderer/components/MarkdownRenderer/providers/MarkdownResourceProvider"; +import type { LinkAction } from "renderer/lib/clickPolicy"; import { getBaseName } from "renderer/lib/pathBasename"; import { getPathDirectory } from "shared/absolute-paths"; import { @@ -11,6 +14,7 @@ import { useSharedFileDocument, } from "../../../../state/fileDocumentStore"; import type { FilePaneData, PaneViewerData } from "../../../../types"; +import { runUrlLinkAction } from "../../utils/runTerminalLinkAction"; import { ErrorState } from "./components/ErrorState"; import { LoadingState } from "./components/LoadingState"; import { OrphanedBanner } from "./components/OrphanedBanner"; @@ -24,6 +28,7 @@ interface FilePaneProps { export function FilePane({ context, workspaceId }: FilePaneProps) { const { t } = useLingui(); + const isPagesEnabled = useFeatureFlagEnabled(FEATURE_FLAGS.PAGES) ?? false; const data = context.pane.data as FilePaneData; const { filePath } = data; @@ -124,6 +129,13 @@ export function FilePane({ context, workspaceId }: FilePaneProps) { [context.actions, data], ); + const handleOpenUrl = useCallback( + (url: string, action: LinkAction) => { + runUrlLinkAction({ store: context.store, isPagesEnabled }, url, action); + }, + [context.store, isPagesEnabled], + ); + // Content gating — LoadingState/ErrorState rendered before view resolution when // there's nothing for the view to consume. if (document.content.kind === "loading") { @@ -196,6 +208,7 @@ export function FilePane({ context, workspaceId }: FilePaneProps) { isActive={context.isActive} onChangeView={handleChangeView} onForceView={handleForceView} + onOpenUrl={handleOpenUrl} /> diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/types.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/types.ts index 26cd78f36bd..b7370a2ff1b 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/types.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/types.ts @@ -1,6 +1,7 @@ import type { MessageDescriptor } from "@lingui/core"; import { i18n } from "@superset/i18n"; import type { ComponentType } from "react"; +import type { LinkAction } from "renderer/lib/clickPolicy"; import type { SharedFileDocument } from "../../../../../state/fileDocumentStore"; export type FileMeta = { @@ -56,6 +57,11 @@ export interface ViewProps { * gestures that would fight the host's scrolling. Defaults to false. */ embedded?: boolean; + /** + * Opens a clicked link in the host's panes. Hosts without a pane store + * omit it and links fall back to the system browser. + */ + onOpenUrl?: (url: string, action: LinkAction) => void; } export function resolveViewLabel(view: FileView, filePath: string): string { diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/MarkdownPreviewView.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/MarkdownPreviewView.tsx index 42ab1dc9740..65eeb99dab3 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/MarkdownPreviewView.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/FilePane/registry/views/MarkdownPreviewView/MarkdownPreviewView.tsx @@ -1,8 +1,10 @@ import { Trans } from "@lingui/react/macro"; import { useRef } from "react"; import { TipTapMarkdownRenderer } from "renderer/components/MarkdownRenderer/components/TipTapMarkdownRenderer"; +import { LinkHoverHint } from "renderer/lib/clickPolicy"; import { MarkdownSearch } from "renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/FileViewerPane/components/MarkdownSearch"; import { useMarkdownSearch } from "renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/TabView/FileViewerPane/hooks/useMarkdownSearch"; +import { useLinkClickHint } from "../../../../../hooks/useLinkClickHint"; import type { ViewProps } from "../../types"; import { splitFrontMatter } from "./splitFrontMatter"; @@ -15,8 +17,10 @@ export function MarkdownPreviewView({ filePath, isActive, showFrontMatterNote = true, + onOpenUrl, }: ViewProps) { const containerRef = useRef(null); + const { hint, showHint } = useLinkClickHint(); const search = useMarkdownSearch({ containerRef, isFocused: isActive, @@ -61,8 +65,11 @@ export function MarkdownPreviewView({ preserveSourceFormatting onChange={(next) => document.setContent(frontMatter + next)} onSave={() => void document.save()} + onOpenUrl={onOpenUrl} + onUnboundLinkClick={showHint} /> + ); } diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx index f022616882c..e90601a7548 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/TerminalPane.tsx @@ -46,12 +46,18 @@ import { TerminalSearch } from "renderer/screens/main/components/WorkspaceView/C import { useTheme } from "renderer/stores/theme"; import { resolveTerminalThemeType } from "renderer/stores/theme/utils"; import { isWithinWorkspacePath } from "shared/absolute-paths"; +import { useLinkClickHint } from "../../hooks/useLinkClickHint"; +import { + runFileLinkAction, + runFolderLinkAction, + runUrlLinkAction, + type TerminalLinkActionDeps, +} from "../../utils/runTerminalLinkAction"; import { TerminalAgentAutoResume } from "./components/TerminalAgentAutoResume"; import { TerminalCopiedIndicator } from "./components/TerminalCopiedIndicator"; import { TerminalRichInput } from "./components/TerminalRichInput"; import { terminalContextMenuLinkStore } from "./contextMenuLinkStore"; import { useCopyOnSelect } from "./hooks/useCopyOnSelect"; -import { useLinkClickHint } from "./hooks/useLinkClickHint"; import { type HoveredLink, useLinkHoverState } from "./hooks/useLinkHoverState"; import { useTerminalAppearance } from "./hooks/useTerminalAppearance"; import { useTerminalInterruptClear } from "./hooks/useTerminalInterruptClear"; @@ -61,12 +67,6 @@ import { } from "./richInputOpenStore"; import { PasteUploadLimitError, uploadPastedFiles } from "./uploadPastedFiles"; import { shellEscapePaths } from "./utils"; -import { - runFileLinkAction, - runFolderLinkAction, - runUrlLinkAction, - type TerminalLinkActionDeps, -} from "./utils/runTerminalLinkAction"; interface TerminalPaneProps { ctx: RendererContext; diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/contextMenuLinkStore.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/contextMenuLinkStore.ts index e6b72b6c9fa..967805d73cf 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/contextMenuLinkStore.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/contextMenuLinkStore.ts @@ -1,5 +1,5 @@ import type { LinkHoverInfo } from "renderer/lib/terminal/terminal-runtime-registry"; -import type { TerminalLinkActionDeps } from "./utils/runTerminalLinkAction"; +import type { TerminalLinkActionDeps } from "../../utils/runTerminalLinkAction"; /** * What the last right-click in a terminal pane landed on, and the deps needed diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/hooks/useLinkClickHint/index.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/hooks/useLinkClickHint/index.ts similarity index 100% rename from apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/hooks/useLinkClickHint/index.ts rename to apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/hooks/useLinkClickHint/index.ts diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/hooks/useLinkClickHint/useLinkClickHint.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/hooks/useLinkClickHint/useLinkClickHint.ts similarity index 100% rename from apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/hooks/useLinkClickHint/useLinkClickHint.ts rename to apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/hooks/useLinkClickHint/useLinkClickHint.ts diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/openInActions/openInActions.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/openInActions/openInActions.ts index 77efbc95fbc..59673d79f28 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/openInActions/openInActions.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/openInActions/openInActions.ts @@ -8,7 +8,7 @@ import { runFileLinkAction, runFolderLinkAction, runUrlLinkAction, -} from "../../components/TerminalPane/utils/runTerminalLinkAction"; +} from "../runTerminalLinkAction"; // Destinations, not sentences: these read under an "Open in" submenu trigger. // They name the same three targets as Settings → Links, so the menu and the diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/utils/runTerminalLinkAction/index.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/runTerminalLinkAction/index.ts similarity index 100% rename from apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/utils/runTerminalLinkAction/index.ts rename to apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/runTerminalLinkAction/index.ts diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/utils/runTerminalLinkAction/runTerminalLinkAction.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/runTerminalLinkAction/runTerminalLinkAction.ts similarity index 97% rename from apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/utils/runTerminalLinkAction/runTerminalLinkAction.ts rename to apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/runTerminalLinkAction/runTerminalLinkAction.ts index 1bc1ca12975..65952330265 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/components/TerminalPane/utils/runTerminalLinkAction/runTerminalLinkAction.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/v2-workspace/$workspaceId/hooks/usePaneRegistry/utils/runTerminalLinkAction/runTerminalLinkAction.ts @@ -28,7 +28,7 @@ export interface TerminalLinkActionDeps { } export function runUrlLinkAction( - deps: TerminalLinkActionDeps, + deps: Pick, url: string, action: LinkAction, ): void {