Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview Each saved net opens at The editor shell is URL-driven: Published examples add Make a local copy, which saves an editable copy (preserving the current view in search params) or shows an inline error if storage fails.
Reviewed by Cursor Bugbot for commit 6c1621a. 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(); |
1014585 to
c482f1f
Compare
c482f1f to
25f7a56
Compare
59624f5 to
859581a
Compare
Saved nets open at /local/<net id>. Net ids are already UUIDs, so the URL needs no separate key or migration. The URL owns the open document: the demo app takes it as a prop and asks the route to open another, so Back and Forward move between nets without remounting the editor. / redirects to the most recently edited net and /new to a new one; both throw to an error page when the browser refuses the write. Published examples offer Make a local copy.
859581a to
369dac4
Compare
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 369dac4. Configure here.
| readonly controller: DocumentController; | ||
| } => { | ||
| const { repository } = useLocalDocumentRepository({ | ||
| documentId: input.documentId, |
There was a problem hiding this comment.
Create navigates after failed persist
Medium Severity
In-app createAndOpen still writes through setStoredSDCPNs, which swallows storage errors, then open navigates to /local/<new-id>. /new and Make a local copy refuse that path when the write fails, but Menu > New and import do not, so a full or blocked store still assigns a bookmarkable URL that reloads as Local document not found and drops the new net.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 369dac4. Configure here.
Local document URLs and example copies are demo-website features, so they belong in the website README rather than a @hashintel/petrinaut patch note or its user guide. The guide's storage sentence now says it describes the live site.
Route tests mirror the route file they cover, as -new.test.ts does for new.tsx; the leading dash keeps them out of the route tree.


Summary
Before this PR, the website editor opened at
/with no document in the URL. Reloads, bookmarks and Back returned to whichever net was edited last. Published examples could not be edited.Each saved net now opens at
/local/<net id>, so bookmarks, reloads and browser history reopen the same net./and/newredirect there. Published examples offer Make a local copy, which saves an editable copy and opens it at its own URL.9661.mp4
Links
Changes
Routes
/local/$netIdopens a saved net/redirects to the most recently edited net/newsaves a separate empty net on each visit and redirects to itWebsite editor
useSharedSearchNavigationtakes aresetKeyExamples
Review fixes
@hashintel/petrinautchangeset or user-guide section for website featuresTest coverage
-local.$netId.test.tsx:-new.test.ts:use-local-storage-sdcpns.test.ts:use-local-document-repository.test.ts:use-shared-search-navigation.test.tsx:local-storage-demo-app.test.tsx:How to test
/local/550e8400-e29b-41d4-a716-446655440000/examples/sir-epidemic-model