FE-778: Fix bounds editing, section stacking, and preview scrolling in the ad-hoc form - #9473
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
PR SummaryLow Risk Overview The optimize bounds slab is usable again: the portalled overlay sets
The experiment drawer’s Computed state preview is wrapped in a 320px max-height, scrollable, tinted panel so large initial markings do not push the rest of the drawer away. Storybook portal decorators restore Reviewed by Cursor Bugbot for commit b4cf794. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1990608. Configure here.
1990608 to
51b10fa
Compare
51b10fa to
9ecee30
Compare
9ecee30 to
57f9010
Compare
A null draft ran the canvas marking while the form showed empty places. The form now seeds its fallback from the marking, uncapped, so the first edit materializes a draft that already holds those tokens.
71f32c8 to
b4cf794
Compare
There was a problem hiding this comment.
Pull request overview
Fixes interaction and layout defects in Petrinaut’s ad-hoc scenario forms and experiment drawer.
Changes:
- Restores bounds-editor and portalled-layer interactions.
- Corrects nested section stacking beneath sticky headers.
- Bounds and documents computed-state preview scrolling.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.changeset/adhoc-form-editing-and-layout-fixes.md |
Records the patch release. |
libs/@hashintel/petrinaut/.storybook/preview.tsx |
Makes Storybook portal children interactive. |
libs/@hashintel/petrinaut/docs/experiments.md |
Documents bounded preview scrolling. |
libs/@hashintel/petrinaut/src/ui/components/ad-hoc-scenario-form/ad-hoc-scenario-form.test.tsx |
Tests bounds interaction and focus retention. |
libs/@hashintel/petrinaut/src/ui/components/ad-hoc-scenario-form/value-editor.tsx |
Fixes pointer handling, nested portals, and bound focus. |
libs/@hashintel/petrinaut/src/ui/components/section.test.tsx |
Verifies section stacking tiers. |
libs/@hashintel/petrinaut/src/ui/components/section.tsx |
Keeps focused sections below sticky headers. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-scenario-run.test.tsx |
Tests the bounded preview panel. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/experiments/experiment-scenario-run.tsx |
Adds the unified scrollable preview region. |
libs/@hashintel/petrinaut/src/ui/views/Editor/panels/SimulateView/simulate-view.stories.tsx |
Restores portal interactions in Simulate stories. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Referencing of variables inside net parameters and initial states is not supported here. Also other functions inside expressions should not be visible. These will be addressed in a future PR. |

🌟 What is the purpose of this PR?
Three fixes to the ad-hoc scenario form, found while reviewing the stack below it. The optimize bounds popover ignored every mouse press: Min, Max, Step and Scale could not be edited at all, and each press dismissed the popover. A focused section painted over the sticky header of the section hosting it. The experiment drawer's computed initial state grew to whatever height the marking needed, pushing Metrics and the drawer footer out of view. Stacked on #9368; #9371 (optimization constraints) now sits on top of this.
🔗 Related links
🔍 What does this change?
pointer-events: none), and the popover never took them back, so every press aimed at Min, Max, Step or Scale reached the row underneath instead. The dismiss handler read that as a press outside and closed the popover on it. The popover now declarespointer-events: auto.clickand the element was already unmounted. The popover now provides itself as the portal container for the layers opened from inside it.Sectionlifts itself toz-index: 3on:focus-withinand its sticky header sits at2, both resolved in the same stacking context once sections nest, so focusing any cell inside the ad-hoc form lifted the nested section's title and rows over the header pinned above them. The lift is capped at1: still above an unfocused sibling at0, always below a header.neutral.s20onneutral.bd.subtle) that scrolls as one and stops at 320px, instead of adding their full height to the drawer..petrinaut-root.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:
The popover keeps a second dismissal path, an
IntersectionObserverthat closes it when its cell scrolls out of the clipped container, rebuilt whenever a bound editor opens or closes. It is untouched here. It did not fire in any case I tested, though a collapse animating around the cell is a plausible trigger and is not covered.🐾 Next steps
ParametersScrollArea,ScrollableContent) and is worth extracting before a third consumer wants it.🛡 What tests cover this?
ad-hoc-scenario-form.test.tsx: a new case asserts the popover declares its own pointer events, that the Scale list renders inside the popover rather than beside it, and that editing one bound leaves focus in its editor and the neighbouring bound unchanged. Each assertion fails if its fix is reverted.section.test.tsx(new): a nestedSectioninside another asserts the focus lift stays below the header tier and above the resting tier.experiment-scenario-run.test.tsx(new): opening "Computed state" renders the places inside the bounded scroll region. It lowers the scenario with the real compiler, so the preview reaches its ready state.❓ How to test this?
yarn workspace @hashintel/petrinaut devand open Components / AdHocScenarioForm → Satellites.altitude, then click its0 … 1cell twice to open the bounds popover.localStorage.setItem("petrinaut:user-settings", JSON.stringify({ enableAdHocScenarios: true })), reload, then Create → scenario No scenario. Shrink the viewport, scroll until "Initial state" passes under the pinned "Initial state and parameters" header, and click a place's count: the header stays opaque and legible.📹 Demo
The "before" for the sticky header is the screenshot that opened this work: "Initial state", "Initial state and parameters" and the focused place row superimposed. Step 5 above reproduces it on
cf/fe-1518-optimization-constraintsand shows the header opaque on this branch. Screenshots to attach.