Skip to content

Conversation

@kube
Copy link
Collaborator

@kube kube commented Dec 22, 2025

🌟 What is the purpose of this PR?

Add Panel SubView component, to start refactoring views around a more modular approach.

For now this is really simple, each Panel uses either SubView/VerticalSubViewsContainer (LeftPanel, PropertiesPanel), or SubView/HorizontalTabsContainer (BottomPanel).

Each panel still decides which SubView it shows, but the idea in the end will be to invert that, and let "modules" decide how they would contribute to the UI. (This principle of inversion of control is something that should be more present in the future of Petrinaut, even outside of UI components).

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

⚠️ Known issues

This is still a raw first version, the behavior of resizing is still clunky.

🐾 Next steps

Horizontal (tabs) and Vertical SubView containers will be enhanced to:

  • Have a better resizing behavior
  • Follow the Figma design

❓ How to test this?

Use latest Petrinaut deployment

@kube kube force-pushed the cf/h-5884-create-panelview-component branch from dea993b to 303e1ef Compare December 22, 2025 23:13
@kube kube force-pushed the cf/h-5883-extract-styles-from-all-components branch from 4ddbfe3 to 86618ff Compare December 22, 2025 23:13
@kube kube changed the title Add Panel SubView, with Horizontal and Vertical SubViews containers H-5884: Add Panel SubView, with Horizontal and Vertical SubViews containers Dec 22, 2025
@kube kube force-pushed the cf/h-5884-create-panelview-component branch from 5c96f80 to 1043468 Compare December 23, 2025 14:51
@kube kube force-pushed the cf/h-5883-extract-styles-from-all-components branch from 86618ff to 5e05299 Compare December 23, 2025 14:51
@kube kube changed the base branch from cf/h-5883-extract-styles-from-all-components to graphite-base/8209 January 2, 2026 18:27
@kube kube force-pushed the cf/h-5884-create-panelview-component branch from 1043468 to 828cd5a Compare January 2, 2026 18:36
@kube kube force-pushed the graphite-base/8209 branch from 5e05299 to 5afc635 Compare January 2, 2026 18:36
@kube kube changed the base branch from graphite-base/8209 to cf/h-5883-extract-styles-from-all-components January 2, 2026 18:37
border: "[1px solid rgba(0, 0, 0, 0.1)]",
backgroundColor: "[rgba(0, 0, 0, 0.05)]",
cursor: "not-allowed",
});
Copy link

Choose a reason for hiding this comment

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

Input always appears disabled due to hardcoded styles

The inputStyle uses a plain css call that unconditionally applies backgroundColor: "[rgba(0, 0, 0, 0.05)]" and cursor: "not-allowed" regardless of input state. The input's disabled prop at line 84 only controls whether the user can type, but the visual styling always shows it as disabled. When hasSimulationFrames is false, the token count input should be editable but will appear gray with a not-allowed cursor, confusing users. This should use cva with variants like other input styles in the codebase to conditionally apply disabled styling.

Fix in Cursor Fix in Web

defaultHeight: 150,
minHeight: 80,
maxHeight: 400,
},
Copy link

Choose a reason for hiding this comment

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

Nested resizable containers create conflicting resize behavior

The placeInitialStateSubView wraps InitialStateEditor in a resizable container with defaultHeight: 150, but InitialStateEditor has its own internal resize logic with a 250px default height and its own resize handle at the bottom. This creates two competing resize mechanisms: the outer container's height (150px) clips the inner content (250px), making the inner resize handle inaccessible without scrolling. The two independent resize controls can create confusing states where inner and outer heights don't align.

Additional Locations (1)

Fix in Cursor Fix in Web

@augmentcode
Copy link

augmentcode bot commented Jan 3, 2026

🤖 Augment PR Summary

Summary: This PR introduces a reusable SubView abstraction for Petrinaut panels and refactors editor panels to compose their UI from subviews.

Changes:

  • Adds SubView types plus reusable containers for vertical collapsible sections and horizontal tab layouts (components/sub-view/*).
  • Refactors the Left Sidebar and Bottom Panel to render from constant subview arrays (LEFT_SIDEBAR_SUBVIEWS, BOTTOM_PANEL_SUBVIEWS), simplifying panel composition.
  • Moves former panel “content” components into explicit subview definitions under views/Editor/subviews/* (types, differential equations, parameters, nodes, diagnostics, simulation settings).
  • Refactors Place Properties to use a PlacePropertiesProvider context and renders “State” + “Visualizer Output” as vertically stacked, resizable subviews.
  • Reorganizes panel code under views/Editor/panels/* and updates imports accordingly.
  • Adds a changeset for the @hashintel/petrinaut package.

Technical Notes: The new subview containers support optional header actions and resizable sections via shared drag/resize logic.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

</button>
))}
<HorizontalTabsHeader
subViews={BOTTOM_PANEL_SUBVIEWS}
Copy link

Choose a reason for hiding this comment

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

BOTTOM_PANEL_SUBVIEWS currently contains only diagnostics + simulation-settings, but BottomPanelTab still includes "parameters" (and the panel docstring mentions it); if activeBottomPanelTab ever becomes "parameters", the header will show no active tab and content will silently fall back to the first subview. Consider aligning the tab union/docs with the actual subview list so the active tab can’t drift out of sync.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

<div
className={contentStyle}
role="tabpanel"
aria-labelledby={activeTabId}
Copy link

Choose a reason for hiding this comment

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

aria-labelledby={activeTabId} on the tabpanel doesn’t appear to reference an element with a matching id (the tab buttons don’t set id), so the tab/tabpanel relationship won’t be correctly exposed to assistive tech. Consider wiring up id/aria-controls on the tab elements and matching aria-labelledby on the tabpanel.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

@kube kube force-pushed the cf/h-5884-create-panelview-component branch from 8f94631 to 23bd975 Compare January 3, 2026 01:11
@kube kube changed the base branch from cf/h-5883-extract-styles-from-all-components to graphite-base/8209 January 6, 2026 18:34
>
{subView.title}
{subView.tooltip && <InfoIconTooltip tooltip={subView.tooltip} />}
</button>
Copy link

Choose a reason for hiding this comment

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

Tab buttons missing id attribute breaks ARIA relationship

Low Severity

The TabButton component sets role="tab" and aria-selected but doesn't include an id={subView.id} attribute. Meanwhile, both HorizontalTabsContainer and HorizontalTabsContent render tabpanels with aria-labelledby={activeTabId}, which expects to reference a tab element by that ID. Since no element has the matching id, the ARIA relationship is broken, causing screen readers to be unable to associate tabpanels with their corresponding tabs.

Additional Locations (1)

Fix in Cursor Fix in Web

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

Labels

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.

2 participants