Links to models and nodes¶
Audience: everyone who edits models · ~4 min read · Prerequisites: Bookmarks and navigation history
What it is¶
A link to a node is a web address that opens struktJS on one model, one root and one node inside it. Paste it into a chat, a ticket or a pull request description, and whoever opens it lands on the same node.
When you'd use it¶
- You want to point a colleague at one statement in a large model.
- You want a ticket or a review comment to link straight to the node it is about.
Copy a link¶
- Right-click the node and choose Copy Link to Node. Or put the cursor on it and run Copy Link to Focused Node from the command palette (F1).
- A toast says "Link copied to clipboard".
The link names the model and root by their qualified names, the node by its place in the tree, and the project by its name. It does not contain your folder path, your workspace or any of your other open tabs.
If the node is in one of the bundled samples (Load Sample…), the link is a sample link instead: it names the sample, so a colleague who does not have it open can still follow it. A sample link opens the pristine bundled sample, so it points at the same node only if you have not edited the sample's structure.
Links in the desktop app¶
The desktop app copies links that start with strukts:// instead of a web address, because its window is not served from an address anyone else could open. The operating system sends such a link to the installed app: clicking it in a chat, a ticket or a browser starts struktJS, or reaches it if it is already running, and then follows the link as described below.
- Windows and macOS register the link type when you install the app. Linux registers it through the
.desktopentry of the.deband AppImage packages. - A custom build (for example
Acme Workbench) uses its own link prefix, such asacme-workbench://, so it never takes overstrukts://links from a struktJS install on the same machine. - If several struktJS windows are open, the link goes to the window you used last.
Open a link¶
Open the link in a browser. struktJS starts as usual, restores what you had open, and then follows the link: it opens the model and root and selects the node.

If the link points into a different project from the one open in the tab, struktJS asks first: This link points into the project "…". Open it now? The current project will be closed. It only offers a project that is already in your own recent projects, matched by name. It never opens a folder named in the link.
Join a session from a link¶
A link of the form strukts://join?room=…&server=… (and the shared session link that Copy Join Link already produces) starts the usual join prompt: it shows the room and the relay server, warns loudly if that relay is not the one you normally use, and asks for your display name. You can cancel. The host still has to approve you. A relay that is not https (other than a loopback one) is refused. See Live Model Session.
Run links¶
A link of the form strukts://run?run=generator&model=… (or run=tests) can ask struktJS to run a model's generator or tests. Because running executes code, it never happens silently:
- A dialog names what the link wants to run and warns that it executes code from the project and its languages with the full privileges of the IDE. Cancel is listed first.
- Only an explicit Run goes ahead. struktJS then opens the model and runs it. Nothing is remembered, so the next link asks again.
- Running tests needs the IDE's Tests panel, so a tests link in the standalone web page is refused. A trust policy that denies running project code refuses every run link.
To make one, use Copy Link to Run This Model's Generator or Copy Link to Run This Model's Tests from the command palette (F1). Anyone who follows the link is asked first.
Only run links from people you trust
The dialog shows the model's name as written in the link. It cannot tell you whether the project's own language code is safe. If you do not know who sent the link, choose Cancel. See Trusting project code.
Sample links¶
A sample link opens the bundled sample (in a new tab in the IDE; in the standalone page it replaces the current project, so it asks first) and selects the node.
When a link does not work¶
struktJS shows a message instead of doing nothing:
| Message | What it means |
|---|---|
| "… is not in the open project" | The model is not in the project open in this tab, and the link names no recent project you have. Open the right project and try again. |
| "The model … has no root …" | The model exists but the root was renamed or removed. |
| "The link matches more than one model" | Two models share the same qualified name. Open the one you mean from the Explorer. |
| "The linked node has moved since the link was made" | The model changed. struktJS selected the closest node it could still match. |
| "Running code from a link is off" | The IDE's trust policy denies running project code. |
| "Running tests from a link needs the IDE's Tests panel" | Open the link in the IDE rather than the standalone page. |
| "This struktJS has no sample called …" | A sample link from a build with a different set of samples. |
| "You are already in a collaboration session" | Leave the current session first, then open the join link again. |
A link is a place in the tree, not a permanent id
Node numbers are handed out each time a model is opened, so a link cannot use them. It records the path of child positions from the root instead. If someone adds or removes a statement above the node, the path may point at a neighbour or no longer match, and you get the "has moved" message. Re-copy the link after big edits.