-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(desktop): plain-click terminal links open in-app, shift-click external #6885
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -307,13 +307,22 @@ const DEFAULT_LINK_TIER_MAP: LinkTierMap = { | |
| metaShift: "external", | ||
| }; | ||
|
|
||
| const DEFAULT_URL_LINKS: LinkTierMap = { | ||
| // Retired urlLinks default (plain unbound, shift → new tab). Kept so heal can | ||
| // migrate never-customized stored rows to the current default. | ||
| const LEGACY_URL_LINKS: LinkTierMap = { | ||
| plain: null, | ||
| shift: "newTab", | ||
| meta: "pane", | ||
| metaShift: "external", | ||
| }; | ||
|
|
||
| const DEFAULT_URL_LINKS: LinkTierMap = { | ||
| plain: "pane", | ||
| shift: "external", | ||
| meta: "newTab", | ||
| metaShift: "external", | ||
| }; | ||
|
|
||
| const LEGACY_SIDEBAR_FILE_LINKS: LinkTierMap = { | ||
| plain: "pane", | ||
| shift: "newTab", | ||
|
|
@@ -489,12 +498,15 @@ export function healV2UserPreferences(raw: unknown): V2UserPreferencesRow { | |
| r.sidebarFileLinks && | ||
| isCompleteLinkTierMap(r.sidebarFileLinks) && | ||
| isSameLinkTierMap(r.sidebarFileLinks, LEGACY_SIDEBAR_FILE_LINKS); | ||
| // A stored map identical to the retired default was never customized — | ||
| // swap it for the current default (shift gained "newTab"). | ||
| // A stored map identical to a retired default was never customized — swap | ||
| // it for the current default (plain-click now opens the in-app browser, | ||
| // shift-click the system browser). Two retired generations: the original | ||
| // shared map, then LEGACY_URL_LINKS. | ||
| const shouldMigrateLegacyUrlLinks = | ||
| r.urlLinks && | ||
| isCompleteLinkTierMap(r.urlLinks) && | ||
| isSameLinkTierMap(r.urlLinks, DEFAULT_LINK_TIER_MAP); | ||
| (isSameLinkTierMap(r.urlLinks, DEFAULT_LINK_TIER_MAP) || | ||
| isSameLinkTierMap(r.urlLinks, LEGACY_URL_LINKS)); | ||
|
Comment on lines
+501
to
+509
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- applicable convention files ---'
find /tmp/coderabbit-repo-knowledge/superset-sh-superset-c3450498 -type f -name '*.md' -print
printf '%s\n' '--- schema outline ---'
ast-grep outline apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.ts
printf '%s\n' '--- schema relevant sections ---'
sed -n '420,535p' apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.ts
printf '%s\n' '--- direct references ---'
rg -n -C 4 'isCompleteLinkTierMap|shouldMigrateLegacyUrlLinks|urlLinks' apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocalRepository: superset-sh/superset Length of output: 31256 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- helper and schema definitions ---'
sed -n '286,405p' apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.ts
printf '%s\n' '--- relevant tests ---'
sed -n '1,155p' apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal/schema.test.ts
printf '%s\n' '--- heal/read references in nearby provider code ---'
rg -n -C 5 'healV2UserPreferences|v2UserPreferencesSchema|dashboardSidebarLocal|preferences' apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider
printf '%s\n' '--- renderer conventions ---'
cat /tmp/coderabbit-repo-knowledge/superset-sh-superset-c3450498/conventions/apps-desktop-src-renderer.mdRepository: superset-sh/superset Length of output: 50376 🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- collection construction ---'
sed -n '1,45p;200,235p' apps/desktop/src/renderer/routes/_authenticated/providers/CollectionsProvider/collections.ts
printf '%s\n' '--- withReadHeal locations ---'
fd -t f 'withReadHeal' apps/desktop packages
printf '%s\n' '--- withReadHeal implementation ---'
for f in $(fd -t f 'withReadHeal' apps/desktop packages); do
echo "--- $f"
sed -n '1,220p' "$f"
done
printf '%s\n' '--- renderer convention ---'
sed -n '1,220p' /tmp/coderabbit-repo-knowledge/superset-sh-superset-c3450498/conventions/apps-desktop-src-renderer.mdRepository: superset-sh/superset Length of output: 13418 Guard For 🤖 Prompt for AI Agents |
||
| return { | ||
| ...DEFAULT_V2_USER_PREFERENCES, | ||
| ...r, | ||
|
|
||
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Allow Alt-click activation while selection is active.
Line 114 does not check
event.altKey. With an active selection, an Alt-click returns before the file or URL callback. Add!event.altKeyso all modifier clicks remain active.Proposed fix
!event.metaKey && !event.ctrlKey && !event.shiftKey && + !event.altKey && this._terminal.hasSelection()📝 Committable suggestion
🤖 Prompt for AI Agents