FE-1500: add the embedded Petrinaut preview - #9360
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryMedium Risk Overview
Hosts can drive deep links via optional navigation limited to scenario, subnet, and selection; a navigation adapter maps that smaller contract onto the shared navigation provider. User guide Reviewed by Cursor Bugbot for commit f90fdcd. Bugbot is set up for automated code reviews on this repo. Configure here. |
bdd7d29 to
19b712e
Compare
659b9f7 to
067d1db
Compare
aa20c9f to
f5225e5
Compare
b0831e7 to
59924ec
Compare
59924ec to
ec16eaa
Compare
9057b60 to
51ca609
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ec16eaa. Configure here.
| </Popover.Body> | ||
| </Popover.Container> | ||
| </Popover> | ||
| )} |
There was a problem hiding this comment.
Net selector stays open after pick
Low Severity
Choosing a root net or subnet in PreviewNetNavigation never closes the popover. NetNavigationList only updates the active net, and this shell never ties that selection back to setOpen. The menu stays up until the user clicks outside, which is unexpected for a compact net picker on a small embed.
Reviewed by Cursor Bugbot for commit ec16eaa. Configure here.
ec16eaa to
733d6ac
Compare
51ca609 to
7d1fc42
Compare
|
Semgrep found 4
Detected a call to |
733d6ac to
f90fdcd
Compare
ff0b3d3 to
85f0b57
Compare


🌟 What is the purpose of this PR?
Adds
PetrinautPreview, a compact read-only surface for showing a Petri net inside another application, exported from a new@hashintel/petrinaut/previewentry. It reuses the editor's canvas, navigation, and property inspection; editing, Monaco/LSP, experiments, optimizations, and the AI assistant are not mounted. Stacked on #9363.🔗 Related links
🔍 What does this change?
PetrinautProviderinto reusable layers:PetrinautDocumentProvider(instance, net management, undo/redo bridge, SDCPN) andPetrinautCanvasProvider(playback, user settings, active net, editor, execution frame). The provider's behaviour is unchanged; the preview composes the layers without workers.src/ui/preview/: thePetrinautPreviewcomponent (in-memory read-only document, header with net selector and View only badge), a navigation adapter projecting the preview's smaller URL contract (PetrinautPreviewNavigationState: scenario, subnet, selection) onto the full controller, and a compact properties panel that is a side overlay on wide embeds and a bottom sheet on narrow ones.previewpresentation profile (no mutation actions, no source code, no custom visualizers, compact controls) and narrows the editor'spresentationProfileprop to exclude it.docs/preview.mdin the docs index and the AI assistant's doc list.Pre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
🛡 What tests cover this?
ui/preview/navigation-adapter.test.ts.ai.test.ts,petrinaut-docs-content.test.ts) verify the new page's registration;build:libverifies the new entry.❓ How to test this?
yarn workspace @hashintel/petrinaut build:lib.<PetrinautPreview definition={...} title="..." />from@hashintel/petrinaut/previewin a host page.