Repository navigation
feat(yasgui): read-only web workspaces from a workspace.json - #257
Merged
Merged
Conversation
Add a third workspace type, Web ("http"), that reads .rq files listed in a
workspace.json on any web server, with folder labels, endpoint aliases and
grlc-style #+ headers. Web workspaces are always read-only. A
?workspace=<url> link asks to add one and shows it in the query browser.
Replace the git-or-else-SPARQL checks for query and version references with
shared helpers in queryRefs.ts.
Refs #256
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
Part 1 of #256: a read-only workspace that reads plain
.rqfiles from any web server. ZIP support is left for a follow-up.What's new
New workspace type "Web" (
type: "http",manifestUrl). It is always read-only. MatGUI reads aworkspace.jsonwith:querieslist, where each entry is a URL string or{url, name, description, endpoint, folder}folderslabels and default endpointsendpointsaliasesThe format is a superset of matgui-matdata's
demo-queries/workspace.json. Query URLs are relative to the manifest. A query's folder comes from its path unlessfolderis set.grlc-style
#+ name/description/endpointheaders in the query files are read and stripped from the query text. A value in the manifest wins over the header, and the header wins over the file name. Opening a query switches the tab to its endpoint, as with SPARQL workspaces. There is no version history; the History menu item is hidden.Settings → Workspaces has a new "Web (read-only)" type with one URL field. An empty label and description are filled in from the manifest, and the number of queries found is shown. A Copy link button copies a link that adds the workspace.
?workspace=<url>link, read from the query string or the hash. It loads the manifest and asks "Add the read-only workspace X (N queries) published at …?". On confirm, it adds the workspace and opens it in the query browser. If the workspace is already configured, the link just shows it. The parameter is removed from the address bar, and the quick start tour is not opened on top of the dialog. Embedders can callyasgui.addWebWorkspace(url).Refactor: the scattered checks of the form "git, else SPARQL" for query and version refs are now shared helpers in
queryManagement/queryRefs.ts.Security: files are fetched with
credentials: "omit". An http manifest on an https page gets a clear mixed-content message. Only absolute http(s) URLs are accepted from the link.Docs and release
docs/user-guide.md: new "Web workspaces" section covering the format, headers, links, and CORS and https requirements.@matdata/yasgui.releases.ts) is not updated here. It gets its entry when the next release notes are written.Tests
query-management-web-workspace-test.ts): manifest parsing, header parsing, the backend with mocked fetch, read-only behaviour, validation, query refs and workspace links. The full unit suite passes (1785 tests).web-workspace-browser.ts): a link adds the workspace after confirmation, opening a query strips its header and switches the endpoint, a second visit doesn't ask again, and declining or a missing manifest adds nothing. Both pass locally.Generated by Claude Code