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

Summary

Before this PR, every Petrinaut host got the full authoring editor. A read-only page could stop edits through the document handle, but subnet add, rename, and delete affordances, type-dimension mutation controls, and source-code fields still rendered. Scenario and playback controls lived inside the editor's bottom panel and bottom bar, so no other surface could compose them.

Petrinaut takes a presentationProfile prop, editor or review, that gates authoring-only controls. Scenario and playback controls become shared components that surfaces outside the full editor can compose. The default editor profile keeps every capability on, so existing hosts render as before.

Links

Changes

Presentation profiles

  • PetrinautPresentationProvider maps a profile to capability booleans

    showMutationActions, showSourceCode, showCustomVisualizers, showViewportSettings, showMinimap, compactControls.
    review turns off mutation actions and keeps the rest on.

  • Editor UI gates on those capabilities

    Subnet add, rename, and delete affordances, type-dimension mutation controls, source-code fields in property inspectors, the custom place visualizer, viewport settings, and the minimap.

  • Example pages render with the review profile

Shared components

  • SelectedItemProperties extracted from the properties panel
  • SimulationScenarioControls and simulation-parameter-bounds extracted as a scenario picker with typed parameter controls

    Modelled on the picker and parameter list in Simulation Settings.
    The full panel keeps its own layout, which main has since rebuilt around the ad-hoc scenario form, so the shared component serves compact hosts.

  • Compact variant of the bottom-bar SimulationControls and PlaybackSettingsMenu

    allowedSpeeds restricts the speed menu to an allow-list.

  • createDeferredSubView loads optional property sub-views behind a bundle boundary

    Transition firing time, transition results, and the place visualizer load on demand while the panel keeps a synchronous descriptor.

Test coverage

  • simulation-parameter-bounds.test.ts:

    Clamping a value into declared bounds.

  • Existing @hashintel/petrinaut unit suite

How to test

Editor unchanged

  • Open Petrinaut preview on Vercel

    Expect property panels, scenario controls in Simulation Settings, playback bar, viewport controls

Review presentation

  • Open /examples/gases-1-pn

    Expect no subnet add, rename or delete affordances, no type-dimension mutation controls

@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 4, 2026 9:29am UTC
petrinaut Ready Ready Preview Sep 4, 2026 9:29am UTC
petrinaut-docs Ready Ready Preview Sep 4, 2026 9:29am UTC
1 Skipped Deployment
Project Deployment Actions Updated
hashdotdesign-tokens Ignored Ignored Preview Sep 4, 2026 9:29am 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 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