Repository navigation
feat: read-only workspaces (fixes #187) - #193
Merged
Merged
Conversation
A workspace can be marked readOnly. Its queries can be browsed and opened, but it is never offered as a save target, and its queries cannot be updated, renamed, moved or deleted. Saving a query opened from it falls through to Save as, so changes go to another workspace. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01StQ5dk15ErNgjFnErZ7ce4
MathiasVDA
added a commit
that referenced
this pull request
Oct 11, 2026
A workspace can be marked readOnly. Its queries can be browsed and opened, but it is never offered as a save target, and its queries cannot be updated, renamed, moved or deleted. Saving a query opened from it falls through to Save as, so changes go to another workspace.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by Mathias · project thread
Fixes #187
Before: every workspace is writable. A query opened from a shared workspace such as the demo queries can be saved back over the original with Ctrl+S, and the workspace is offered as a target for new queries, renames, moves and deletes.
After: a workspace can be marked Read-only (checkbox in the workspace settings, or
readOnly: truewhen registered from code). Its queries can still be browsed and opened, but it never appears as a save target and is labelled "(read-only)" in the Query Browser. Saving a query opened from it opens Save as, so edits can only go to another workspace as a copy. Rename, move and delete are hidden in the Query Browser, and renaming the tab only changes the tab label. If every workspace is read-only, the save button is hidden.How:
WorkspaceConfigBasegets an optionalreadOnlyflag.getWorkspaceBackendwraps the backend of a read-only workspace in a newReadOnlyWorkspaceBackend, which passes reads through, leaves the optional write methods undefined (so the existingif (backend.renameQuery)checks hide those actions) and rejectswriteQuerywithFORBIDDEN. On top of that,TabandSaveManagedQueryModalskip read-only workspaces when choosing where to save. Save as also no longer sends the source query's version tag when saving into a different workspace.Tests: new
query-management-read-only-workspace-test.ts. The full unit suite passes (1679) andnpm run buildsucceeds. I have not clicked through it in a browser.Follow-up: the demo workspace in matgui-matdata gets
readOnly: truein a separate PR there. Older MatGUI versions ignore the flag.🤖 Generated with Claude Code
https://claude.ai/code/session_01StQ5dk15ErNgjFnErZ7ce4
Generated by Claude Code