Skip to content

FE-1500: switch the example embed to the Petrinaut preview - #9448

Draft
kube wants to merge 1 commit into
codex/fe-1500-viewer-simulationfrom
claude/fe-1500-embed-preview
Draft

FE-1500: switch the example embed to the Petrinaut preview#9448
kube wants to merge 1 commit into
codex/fe-1500-viewer-simulationfrom
claude/fe-1500-embed-preview

Conversation

@kube

@kube kube commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Switches the /embed/examples route from the full read-only Petrinaut component to PetrinautPreview with Quick Simulation. This is an optimization of the already-shipped embed: the compact surface loads no Monaco/LSP and adds bounded in-embed simulation. The embed URL contract does not change. Stacked on #9361.

🔗 Related links

🔍 What does this change?

  • EmbeddedExamplePage lazy-loads PetrinautPreview from @hashintel/petrinaut/preview and builds its quickSimulation from the build-time HIR artifacts (loadExampleRuntime) plus the catalog's parameter bounds; step size and horizon use the simulation defaults.
  • The embed route loads the runtime artifacts alongside the model and navigates through a preview-typed codec (previewSearchToNavigationState and friends) over the same shared search subset.
  • The normalizeEmbedSearch redirect is untouched; a fast-check property asserts the preview codec produces the same search as the shared codec on every generated input, so existing embed URLs keep working unchanged.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🛡 What tests cover this?

  • New: the preview-codec laws in navigation-search.property.test.ts, including the codec-equivalence property that pins the URL contract across the switch.
  • Existing: embed-route.test.ts and the shared codec laws pass unchanged.

❓ How to test this?

  1. Checkout the branch, run yarn workspace @hashintel/petrinaut build:lib, then yarn workspace @apps/petrinaut-website dev.
  2. Open http://localhost:5173/embed/examples/gases-1-pn (directly or inside an iframe).
  3. Confirm the compact preview renders instead of the full editor, Quick Simulation runs with the timeline, and scenario/subnet/selection URLs from the previous embed still resolve identically.

@kube kube self-assigned this Aug 30, 2026
@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hash Building Building Preview Sep 1, 2026 8:00am UTC
petrinaut Ready Ready Preview Sep 1, 2026 8:00am UTC
petrinaut-docs Ready Ready Preview Sep 1, 2026 8:00am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 1, 2026 8:00am UTC

Request Review

@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 879319c to ee83651 Compare August 30, 2026 03:34
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 30, 2026 03:34 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from ee83651 to 1c805b2 Compare August 30, 2026 17:09
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 30, 2026 17:09 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 1c805b2 to 7e9425b Compare August 30, 2026 17:24
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 30, 2026 17:24 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 7e9425b to f5e9e25 Compare August 31, 2026 01:03
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 01:03 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from f5e9e25 to a3e8a69 Compare August 31, 2026 02:14
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 02:14 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from caab6f3 to 7425768 Compare August 31, 2026 11:13
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 11:13 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 7425768 to 1be5d59 Compare August 31, 2026 11:13
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 11:13 Inactive
@semgrep-code-hashintel

Copy link
Copy Markdown

Semgrep found 4 detect-replaceall-sanitization findings:

Detected a call to replaceAll() in an attempt to HTML escape the string value .replaceAll("&", "&amp;") .replaceAll('"', "&quot;") .replaceAll("'", "&#39;") .replaceAll("<", "&lt;"). Manually sanitizing input through a manually built list can be circumvented in many situations, and it's better to use a well known sanitization library such as sanitize-html or DOMPurify.

Semgrep found 1 regex_dos finding:

  • apps/petrinaut-website/src/main/app/brunch-demo/brunch-endpoint.ts

Ensure that the regex used to compare with user supplied input is safe from regular expression denial of service.

@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 1be5d59 to 272d608 Compare August 31, 2026 12:01
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 12:01 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 272d608 to 4438ee5 Compare August 31, 2026 13:11
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 13:11 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 4438ee5 to 9d2da59 Compare August 31, 2026 14:27
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 14:28 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 9d2da59 to 5de56fa Compare August 31, 2026 14:28
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 31, 2026 14:28 Inactive
@kube
kube force-pushed the claude/fe-1500-embed-preview branch from 5de56fa to 8e15929 Compare August 31, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant