Skip to content

feat: Add "Copy URI" to saved query context menu and query browser - #154

Merged
MathiasVDA merged 5 commits into
mainfrom
copilot/add-copy-uri-to-context-menu
May 11, 2026
Merged

feat: Add "Copy URI" to saved query context menu and query browser#154
MathiasVDA merged 5 commits into
mainfrom
copilot/add-copy-uri-to-context-menu

Conversation

Copilot AI commented May 11, 2026

Copy link
Copy Markdown

Adds a "Copy URI" action for managed (saved) queries — in the Query Browser sidebar (via right-click context menu) and in the tab right-click context menu.

  • SPARQL workspaces: copies the managed-query IRI stored in the triplestore
  • Git workspaces: copies the browser-accessible file URL (GitHub, GitLab, Bitbucket, Gitea)

Changes

WorkspaceBackend interface

  • New optional method: getQueryUri?(queryId: string): string | undefined

GitWorkspaceBackend

  • Implements getQueryUri — constructs the file's web URL from remoteUrl, branch, rootPath, and queryId
  • Provider resolved via explicit provider config or host-based auto-detection:
    • GitHub → .../blob/{branch}/{path}
    • GitLab → .../-/blob/{branch}/{path}
    • Bitbucket → .../src/{branch}/{path}
    • Gitea/others → .../src/branch/{branch}/{path}

SparqlWorkspaceBackend

  • Implements getQueryUri — returns the query ID directly (it already is the managed-query IRI)

QueryBrowser

  • All four query actions (Copy URI, Rename, Move, Delete) are now grouped in a right-click context menu on each query row, preserving full space for the query name
  • Context menu is positioned at the cursor, clamped to the viewport, and dismisses on outside click or Escape
  • Folder row inline actions (Rename, Delete) are unchanged

TabContextMenu

  • "Copy URI" item in the right-click tab context menu; enabled only when the tab is linked to a managed query, disabled otherwise
  • Uses typed GitQueryRef / SparqlQueryRef instead of as any casts

Tests

  • 11 new unit tests covering getQueryUri across all supported providers and both backend types

Copilot AI changed the title [WIP] Add 'Copy URI' option to right click context menu for saved queries feat: Add "Copy URI" to saved query context menu and query browser May 11, 2026
Copilot AI requested a review from MathiasVDA May 11, 2026 07:30
@MathiasVDA

Copy link
Copy Markdown
Collaborator

@copilot the functionality seems to be working. But the UI needs some improvement now. We have 4 different action links related to a saved query: Copy URI, Rename, Delete and Move. Instead of putting them to the right of the query name, where it will decrease the space available for the name, but them all four in a context window that opens when the user right clicks on it.

Copilot AI commented May 11, 2026

Copy link
Copy Markdown
Author

@copilot the functionality seems to be working. But the UI needs some improvement now. We have 4 different action links related to a saved query: Copy URI, Rename, Delete and Move. Instead of putting ...

Done in commit 6545607. All four query actions (Copy URI, Rename, Move, Delete) are now hidden from the row and only appear in a right-click context menu, so the full query name is always visible. Folder inline actions (Rename, Delete) are unchanged.

Here's how it looks when right-clicking a saved query:

Context menu on right-click

Screenshot showing query rows without inline buttons and the right-click context menu appearing

The context menu (Copy URI → Rename → Move → Delete) appears at the cursor position, closes on click-outside or Escape, and is clamped to the viewport.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5778 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.GuLOBN --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9264166273490062484,8954262128413146025,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,10477463783123577771,5987762965719011643,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless=new --no-sandbox --screenshot=/tmp/yasgui_initial.png --window-size=1400,900 http://localhost:4000/dev/yasgui.html (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5998 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.jkIgAU --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17120073231157531481,358828668920101416,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7289062352723221554,8689237744193659605,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5778 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.GuLOBN --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9264166273490062484,8954262128413146025,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,10477463783123577771,5987762965719011643,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless=new --no-sandbox --screenshot=/tmp/yasgui_initial.png --window-size=1400,900 http://localhost:4000/dev/yasgui.html (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5998 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.jkIgAU --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17120073231157531481,358828668920101416,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7289062352723221554,8689237744193659605,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5778 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.GuLOBN --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9264166273490062484,8954262128413146025,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,10477463783123577771,5987762965719011643,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless=new --no-sandbox --screenshot=/tmp/yasgui_initial.png --window-size=1400,900 http://localhost:4000/dev/yasgui.html (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5998 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.jkIgAU --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17120073231157531481,358828668920101416,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7289062352723221554,8689237744193659605,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5778 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.GuLOBN --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9264166273490062484,8954262128413146025,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,10477463783123577771,5987762965719011643,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless=new --no-sandbox --screenshot=/tmp/yasgui_initial.png --window-size=1400,900 http://localhost:4000/dev/yasgui.html (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5998 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.jkIgAU --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17120073231157531481,358828668920101416,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7289062352723221554,8689237744193659605,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5778 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.GuLOBN --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9264166273490062484,8954262128413146025,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,10477463783123577771,5987762965719011643,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless=new --no-sandbox --screenshot=/tmp/yasgui_initial.png --window-size=1400,900 http://localhost:4000/dev/yasgui.html (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5998 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.jkIgAU --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17120073231157531481,358828668920101416,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7289062352723221554,8689237744193659605,4 --trace-process-track-uuid=3190708989122997041 (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5778 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.GuLOBN --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,9264166273490062484,8954262128413146025,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,10477463783123577771,5987762965719011643,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless=new --no-sandbox --screenshot=/tmp/yasgui_initial.png --window-size=1400,900 http://localhost:4000/dev/yasgui.html (dns block)
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=5998 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.jkIgAU --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,17120073231157531481,358828668920101416,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7289062352723221554,8689237744193659605,4 --trace-process-track-uuid=3190708989122997041 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@MathiasVDA
MathiasVDA marked this pull request as ready for review May 11, 2026 11:43
@MathiasVDA
MathiasVDA merged commit a5cd402 into main May 11, 2026
2 checks passed
@MathiasVDA
MathiasVDA deleted the copilot/add-copy-uri-to-context-menu branch May 11, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add 'Copy URI' to right click context menu for saved queries

2 participants