FE-1659: Give local Petrinaut documents UUID URLs and copy examples - #9661
FE-1659: Give local Petrinaut documents UUID URLs and copy examples#9661kube wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview Storage identity adds a persistent Published examples gain a top-bar Make a local copy action that saves a fork to Docs (website README and Reviewed by Cursor Bugbot for commit 1014585. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
The central editor-to-UUID navigation workflow lacks integration coverage.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds persistent UUID routes for browser-local Petrinaut documents and enables editable copies of published examples.
Changes:
- Adds UUID migration, creation, routing, and navigation.
- Adds example copying and missing-document recovery.
- Updates tests, documentation, and release metadata.
File summaries
| File | Description |
|---|---|
.changeset/local-document-urls.md |
Adds the Petrinaut patch changeset. |
apps/petrinaut-website/README.md |
Documents local UUID routes and copies. |
apps/petrinaut-website/src/examples/full-example-page.tsx |
Adds the copy action and error alert. |
apps/petrinaut-website/src/main/app/local-storage-demo/local-storage-demo-app.tsx |
Connects document selection to routing. |
apps/petrinaut-website/src/main/app/local-storage-demo/resolve-crew-reservation-bundle.test.ts |
Adds UUID data to the fixture. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-local-storage-sdcpns.test.ts |
Tests UUID migration and copies. |
apps/petrinaut-website/src/main/app/local-storage-demo/use-local-storage-sdcpns.ts |
Implements UUID persistence and migration. |
apps/petrinaut-website/src/routes/-local.test.tsx |
Tests local routes and history. |
apps/petrinaut-website/src/routes/-new.test.ts |
Tests distinct /new documents. |
apps/petrinaut-website/src/routes/-not-found-page.tsx |
Supports customized recovery messages. |
apps/petrinaut-website/src/routes/__root.tsx |
Adapts root not-found rendering. |
apps/petrinaut-website/src/routes/examples.$slug.tsx |
Saves and opens example copies. |
apps/petrinaut-website/src/routes/index.tsx |
Redirects home to the latest document. |
apps/petrinaut-website/src/routes/local.$uuid.tsx |
Adds the local-document route. |
apps/petrinaut-website/src/routes/new.tsx |
Redirects new documents to UUID URLs. |
libs/@hashintel/petrinaut/docs/drawing-a-net.md |
Documents local URLs and example copies. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (onNetChange) onNetChange(newNet); | ||
| else clearSharedLocation(); |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1014585. Configure here.
| setCurrentNetId(newNet.id); | ||
| clearSharedLocation(); | ||
| if (onNetChange) onNetChange(newNet); | ||
| else clearSharedLocation(); |
There was a problem hiding this comment.
New documents can 404 on navigate
Medium Severity
createNewNet adds the document through setStoredSDCPNs and then calls onNetChange, which navigates to /local/$uuid. That route's loader reads localStorage via readLocalStorageNets, not the hook. Mantine swallows setItem failures, so a quota or blocked-storage write still navigates and the loader throws not-found. /new and Make a local copy persist with saveLocalStorageNet before navigating, so those flows surface a save error instead of a missing-document page.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 1014585. Configure here.
| export const Route = createFileRoute("/")({ | ||
| beforeLoad: ({ search }) => { | ||
| readLocalStorageNets(window.localStorage); | ||
| if (isCrewReservationFixtureSelected(search)) return; |
There was a problem hiding this comment.
This is specific to Brunch fixture and should be flagged as something to remove soon.
We should not have (too much) spaghetti in the app.


Summary
Local demo documents open at
/local/<UUID>, so bookmarks, reloads, and browser history reopen the selected file. Documents stay in the browser's local storage.Published examples offer Make a local copy in the top bar. The copy opens at its own local URL with editing enabled.
Links
Changes
/to the most recently edited document and/newto a new document@hashintel/petrinautTest coverage
How to test
/examples/sir-epidemic-modelon the website preview/local/<UUID>/local/550e8400-e29b-41d4-a716-446655440000in a browser without that file and confirm the recovery message