Skip to content

feat(yasgui): read-only web workspaces from a workspace.json - #257

Merged
MathiasVDA merged 2 commits into
mainfrom
claude/project-thread-cuidlq
Nov 3, 2026
Merged

MathiasVDA merged 2 commits into
mainfrom
claude/project-thread-cuidlq

Conversation

@MathiasVDA

Copy link
Copy Markdown
Collaborator

Requested by Mathias · project thread

Part 1 of #256: a read-only workspace that reads plain .rq files 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 a workspace.json with:

    • a queries list, where each entry is a URL string or {url, name, description, endpoint, folder}
    • optional folders labels and default endpoints
    • optional endpoints aliases

    The 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 unless folder is set.

  • grlc-style #+ name/description/endpoint headers 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 call yasgui.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.
  • Changeset: minor for @matdata/yasgui.
  • What's new (releases.ts) is not updated here. It gets its entry when the next release notes are written.

Tests

  • Unit 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).
  • Browser 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.
  • Not tested: a real GitHub Pages or other CORS host. The tests serve the files through request interception.

Generated by Claude Code

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
@MathiasVDA MathiasVDA self-assigned this Nov 3, 2026
@MathiasVDA
MathiasVDA merged commit 4e0b8cb into main Nov 3, 2026
1 check passed
@MathiasVDA
MathiasVDA deleted the claude/project-thread-cuidlq branch November 3, 2026 16:46
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.

1 participant