Skip to content

FE-1500: add the example embed route - #9427

Open
kube wants to merge 1 commit into
codex/fe-1500-examplesfrom
claude/fe-1500-embed
Open

FE-1500: add the example embed route#9427
kube wants to merge 1 commit into
codex/fe-1500-examplesfrom
claude/fe-1500-embed

Conversation

@kube

@kube kube commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Adds the embed route /embed/examples/<slug>, rendering the regular Petrinaut component read-only with embed options. This makes the embed URL contract available for oEmbed immediately; a compact preview surface replaces the component in a later PR without changing the contract. Stacked on #9362.

🔗 Related links

🔍 What does this change?

  • New embed route; direct browser visits render it too, so the view can be tested without an iframe harness. Framing policy is enforced by HTTP headers (vercel.json, in the oEmbed PR), not by client-side checks. Query params outside the contract are inert rather than redirected away: validateSearch drops them, and rewriting the address bar would need a document reload, which an embed must avoid.
  • EmbeddedExamplePage lazy-loads a read-only Petrinaut with all net-management controls hidden and a plain title in the top bar; navigation always uses replace-history inside the iframe. (The review presentation profile that hides authoring controls arrives later in the stack, in FE-1500: add editor presentation profiles #9425.)
  • Embed URLs carry the same shared scenario/subnet/selection contract as the canonical page (FE-1500: add versioned examples and read-only pages #9362), so there is no embed-specific codec.
  • The page reuses useSharedSearchNavigation from FE-1500: add versioned examples and read-only pages #9362 with a replace-only history policy, so the embed never grows the host page's history; controls that drive URL-unrepresentable state (the mode switcher, the viewport-settings overlay) work inside the embed instead of silently snapping back.
  • Adds the /embed/examples/* SPA rewrite to vercel.json.

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

🐾 Next steps

  • A compact PetrinautPreview surface replaces the full component inside the embed later in this stack, keeping the URL contract property-tested identical.

🛡 What tests cover this?

❓ How to test this?

  1. Checkout the branch and run yarn workspace @hashintel/petrinaut build:lib, then yarn workspace @apps/petrinaut-website dev.
  2. Visit http://localhost:5173/embed/examples/gases-1-pn directly and confirm the read-only embed renders.
  3. Confirm scenario, subnet, and selection changes rewrite the URL without adding history entries, and that a query param outside the contract (for example ?mode=simulate) is ignored.

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

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview Aug 31, 2026 2:50pm
petrinaut Ready Ready Preview Aug 31, 2026 2:50pm
petrinaut-docs Ready Ready Preview Aug 31, 2026 2:50pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 31, 2026 2:50pm

Request Review

@kube
kube force-pushed the claude/fe-1500-embed branch from a48dcd5 to 3315bbb Compare August 29, 2026 14:28
@kube
kube force-pushed the claude/fe-1500-embed branch from 3315bbb to 5afc088 Compare August 29, 2026 20:03
@kube
kube changed the base branch from codex/fe-1500-viewer-simulation to codex/fe-1500-examples August 30, 2026 01:09
@github-actions github-actions Bot added area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team labels Aug 30, 2026
@kube
kube force-pushed the claude/fe-1500-embed branch from 5afc088 to 690195c Compare August 30, 2026 01:09
@github-actions github-actions Bot removed area/infra Relates to version control, CI, CD or IaC (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team labels Aug 30, 2026
@kube
kube force-pushed the claude/fe-1500-embed branch from 690195c to 2d06143 Compare August 30, 2026 03:34
Comment thread apps/petrinaut-website/src/routes/embed.examples.$slug.tsx Outdated
Comment thread apps/petrinaut-website/src/examples/embedded-example-page.tsx Outdated
@semgrep-code-hashintel

Copy link
Copy Markdown

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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b42f4d0. Configure here.

Comment thread apps/petrinaut-website/src/routes/embed.examples.$slug.tsx
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