Skip to content

FE-1500: add editor presentation profiles - #9425

Draft
kube wants to merge 1 commit into
mainfrom
claude/fe-1500-presentation
Draft

FE-1500: add editor presentation profiles#9425
kube wants to merge 1 commit into
mainfrom
claude/fe-1500-presentation

Conversation

@kube

@kube kube commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

🌟 What is the purpose of this PR?

Adds a presentationProfile prop to Petrinaut (editor or review) that gates authoring-only controls, and extracts scenario and playback controls into shared components so later surfaces can compose them outside the full editor. Stacked on #9363.

🔗 Related links

🔍 What does this change?

  • New PetrinautPresentationProvider context maps a profile to capability booleans (showMutationActions, showSourceCode, showCustomVisualizers, showViewportSettings, showMinimap, compactControls). The default editor profile keeps every capability on, so existing hosts are unchanged; review suppresses authoring actions for read-only pages.
  • Gates existing editor UI on those capabilities: subnet add/rename/delete affordances, type-dimension mutation controls, source-code fields in property inspectors, the custom place visualizer, viewport settings, and the minimap.
  • Extracts shared components out of editor internals: SelectedItemProperties from PropertiesPanel/panel.tsx, SimulationScenarioControls and simulation-parameter-bounds from simulation-settings.tsx, and a compact variant of the bottom-bar SimulationControls and PlaybackSettingsMenu (with an allowedSpeeds allow-list).
  • Adds a Fit view button to the viewport controls and moves the Monaco code field and place visualizer behind React.lazy boundaries (createDeferredSubView).
  • Adopts the review profile on the website's full example page and embed page, which until this PR rely on readonly alone (authoring controls disabled instead of hidden).

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • modifies an npm-publishable library and I have added a changeset file(s)

📜 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: simulation-parameter-bounds.test.ts.
  • Existing: the @hashintel/petrinaut unit suite runs the editor with the default profile.

❓ How to test this?

  1. Checkout the branch and run yarn workspace @hashintel/petrinaut build:lib, then yarn workspace @apps/petrinaut-website dev.
  2. Confirm the editor is unchanged with the default profile on /: property panels, scenario controls in Simulation Settings, playback bar, viewport controls.
  3. Open an example page (/examples/gases-1-pn) and confirm add/delete/rename affordances and source-code fields are hidden rather than disabled.

@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
hash Ready Ready Preview Sep 1, 2026 12:03pm UTC
petrinaut Ready Ready Preview Sep 1, 2026 12:03pm UTC
petrinaut-docs Ready Ready Preview Sep 1, 2026 12:03pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 1, 2026 12:03pm UTC

Request Review

@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 29, 2026
@kube
kube force-pushed the claude/fe-1500-presentation branch from 4266f7b to bc5f034 Compare August 29, 2026 20:03
@kube
kube force-pushed the claude/fe-1500-presentation branch from bc5f034 to e15aa00 Compare August 30, 2026 17:24
@kube
kube force-pushed the claude/fe-1500-presentation branch from e15aa00 to dcdc3ff Compare August 31, 2026 01:03
@github-actions github-actions Bot added area/deps Relates to third-party dependencies (area) area/apps area/apps > hash.design Affects the `hash.design` design site (app) labels Aug 31, 2026
@kube
kube changed the base branch from codex/fe-1500-router to codex/fe-1500-oembed August 31, 2026 01:03
@github-actions github-actions Bot removed area/deps Relates to third-party dependencies (area) area/apps > hash.design Affects the `hash.design` design site (app) labels Aug 31, 2026
@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.

@kube
kube force-pushed the claude/fe-1500-presentation branch from a025c39 to e54994a Compare August 31, 2026 04:24
@kube
kube force-pushed the claude/fe-1500-presentation branch from e54994a to be652ab Compare August 31, 2026 11:13
@kube
kube force-pushed the claude/fe-1500-presentation branch from be652ab to 7035369 Compare August 31, 2026 11:13
@kube
kube force-pushed the claude/fe-1500-presentation branch from 7035369 to 81fb77b Compare August 31, 2026 12:01
@kube
kube force-pushed the claude/fe-1500-presentation branch from 81fb77b to b7fdbbf Compare August 31, 2026 13:11
@kube
kube force-pushed the claude/fe-1500-presentation branch from b7fdbbf to 9f34a2b Compare August 31, 2026 14:27
@kube
kube force-pushed the claude/fe-1500-presentation branch from 9f34a2b to 8dc576e Compare August 31, 2026 14:28
@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps 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

Development

Successfully merging this pull request may close these issues.

1 participant