-
Notifications
You must be signed in to change notification settings - Fork 802
feat(desktop): modifier-keyed v2 terminal file links + folder sidebar reveal #3512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4e0a27a
feat(desktop): v2 terminal honors terminalLinkBehavior setting
saddlepaddle 45fdab5
feat(desktop): modifier-keyed v2 terminal file links + folder sidebar…
saddlepaddle 6369a15
refactor(desktop): drop callback refs in v2 TerminalPane, use effect …
saddlepaddle 12e8e2f
refactor(desktop): move v2 pane actions into a PaneActionsProvider co…
saddlepaddle e934fbf
refactor(desktop): drop PaneActionsProvider, pass actions through use…
saddlepaddle 05fe825
fix(desktop): v2 terminal folder reveal switches sidebar to Files tab
saddlepaddle 053564d
fix(desktop): auto-expand revealed directory + extract useOpenInExter…
saddlepaddle 9e87499
feat(desktop): v2 terminal URL links open in internal browser by default
saddlepaddle 6d88f92
feat(desktop): v2 terminal shows hover tooltip describing cmd-click a…
saddlepaddle f19b455
refactor(desktop): match tooltip styling, surface configured editor name
saddlepaddle 51f1787
refactor(desktop): split LinkHoverTooltip hook/component, tighten mod…
saddlepaddle ce8bfa3
fix(desktop): block external open while host data loads, surface edit…
saddlepaddle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...authenticated/_dashboard/v2-workspace/$workspaceId/hooks/useOpenInExternalEditor/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export { | ||
| type OpenInExternalEditorOptions, | ||
| useOpenInExternalEditor, | ||
| } from "./useOpenInExternalEditor"; |
49 changes: 49 additions & 0 deletions
49
...hboard/v2-workspace/$workspaceId/hooks/useOpenInExternalEditor/useOpenInExternalEditor.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { toast } from "@superset/ui/sonner"; | ||
| import { eq } from "@tanstack/db"; | ||
| import { useLiveQuery } from "@tanstack/react-db"; | ||
| import { useCallback } from "react"; | ||
| import { electronTrpcClient } from "renderer/lib/trpc-client"; | ||
| import { useCollections } from "renderer/routes/_authenticated/providers/CollectionsProvider"; | ||
| import { useLocalHostService } from "renderer/routes/_authenticated/providers/LocalHostServiceProvider"; | ||
|
|
||
| export interface OpenInExternalEditorOptions { | ||
| line?: number; | ||
| column?: number; | ||
| } | ||
|
|
||
| export function useOpenInExternalEditor(workspaceId: string) { | ||
| const collections = useCollections(); | ||
| const { machineId } = useLocalHostService(); | ||
| const { data: workspacesWithHost = [] } = useLiveQuery( | ||
| (q) => | ||
| q | ||
| .from({ workspaces: collections.v2Workspaces }) | ||
| .leftJoin({ hosts: collections.v2Hosts }, ({ workspaces, hosts }) => | ||
| eq(workspaces.hostId, hosts.id), | ||
| ) | ||
| .where(({ workspaces }) => eq(workspaces.id, workspaceId)) | ||
| .select(({ hosts }) => ({ | ||
| hostMachineId: hosts?.machineId ?? null, | ||
| })), | ||
| [collections, workspaceId], | ||
| ); | ||
| const workspaceHost = workspacesWithHost[0]; | ||
|
|
||
| return useCallback( | ||
| (path: string, opts?: OpenInExternalEditorOptions) => { | ||
| // Treat unloaded host data as non-local to avoid firing the mutation | ||
| // against a potentially remote workspace before locality is confirmed. | ||
| if (workspaceHost?.hostMachineId !== machineId) { | ||
| toast.error("Can't open remote workspace paths in an external editor"); | ||
| return; | ||
| } | ||
| electronTrpcClient.external.openFileInEditor | ||
| .mutate({ path, line: opts?.line, column: opts?.column }) | ||
| .catch((error) => { | ||
| console.error("Failed to open in external editor:", error); | ||
| toast.error("Failed to open in external editor"); | ||
| }); | ||
| }, | ||
| [workspaceHost, machineId], | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 553
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 213
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 7397
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 46
Setting
terminalLinkBehavioris never consulted — feature appears unimplemented.The PR objective states that v2 terminal link clicks should honor the Settings → Terminal → Terminal file links preference by reading it via
electronTrpcClient.settings.getTerminalLinkBehavior.query()on each click, with"file-viewer"as the default/error fallback. TheonFileLinkClickhandler (lines 162–177) never reads this setting: it uses a shift-modifier heuristic instead (shift ⇒ external, else ⇒ in-app). As a result, a user who has set Terminal file links to"external-editor"will still see files open in the FilePane on a plain Cmd/Ctrl-click — the opposite of what the setting requests.Please clarify whether the setting-lookup approach was intentionally replaced with a shift modifier, or if the
getTerminalLinkBehaviorquery is missing. If the latter, it should be called insideonFileLinkClick(async context), routing toonOpenFilevsonOpenExternalbased on the resolved setting value.🤖 Prompt for AI Agents