Skip to content

feat: add Move button to change a managed query's folder#142

Merged
MathiasVDA merged 2 commits intomainfrom
copilot/add-change-folder-functionality
Feb 28, 2026
Merged

feat: add Move button to change a managed query's folder#142
MathiasVDA merged 2 commits intomainfrom
copilot/add-change-folder-functionality

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 28, 2026

Managed queries could be renamed but not moved to a different folder after initial creation. The only workaround was duplicate → save to new folder → delete original.

Changes

Backend

  • WorkspaceBackend: new optional moveQuery?(queryId, newFolderId): Promise<string> — returns the new query ID (differs for Git where the ID encodes the path)
  • GitWorkspaceBackend: reads content, writes to newFolder/filename, deletes old path
  • SparqlWorkspaceBackend: ensures new folder exists (INSERT DATA), then updates dcterms:isPartOf via DELETE/INSERT WHERE
  • InMemoryWorkspaceBackend: same contract for tests

UI

  • SaveManagedQueryModal: new showFolderPickerOnly(workspaceId, currentFolderPath) — reuses the existing folder picker in a stripped-down "Move to folder" modal (no workspace selector, name, filename, or message fields); modal instance is lazily cached on QueryBrowser
  • QueryBrowser: Move button added next to Rename for each query entry; after folder selection calls backend.moveQuery() and patches open tab metadata for Git backends so in-flight tabs track the new path

Tests

3 new unit tests on InMemoryWorkspaceBackend: move to a different folder (version history preserved), move to root, and same-folder no-op.

UI

Move button in query browser

Original prompt

This section details on the original issue you should resolve

<issue_title>Change folder of a managed query</issue_title>
<issue_description>Currently, a managed query can be renamed but not moved to a folder, created after it was saved for the first time.

Any solution is fine: drag-and-drop in the query browser or imprved dialog for renaming, which includes the folder field.</issue_description>

Comments on the Issue (you are @copilot in this section)

@MathiasVDA I've been bumping into this as well. Workaround is duplicating, saving as new managed query in the new folder and deleting the old one. So yes, I agree this will be useful

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add moveQuery?(queryId, newFolderId): Promise<string> to WorkspaceBackend interface
- Implement moveQuery in GitWorkspaceBackend (read+write to new path+delete old)
- Implement moveQuery in SparqlWorkspaceBackend (update dcterms:isPartOf triple, ensure folder exists)
- Implement moveQuery in InMemoryWorkspaceBackend (for tests)
- Add showFolderPickerOnly() to SaveManagedQueryModal for folder-only selection
- Add Move button in QueryBrowser that opens folder picker and calls moveQuery
- Update open git tabs when a query is moved to preserve path metadata
- Add 3 unit tests for moveQuery behaviour

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to change folder of managed query feat: add Move button to change a managed query's folder Feb 28, 2026
@MathiasVDA MathiasVDA marked this pull request as ready for review February 28, 2026 13:13
@MathiasVDA MathiasVDA merged commit a0dfead into main Feb 28, 2026
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.

Change folder of a managed query

2 participants