-
Notifications
You must be signed in to change notification settings - Fork 110
H-5884: Add Panel SubView, with Horizontal and Vertical SubViews containers #8209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
dea993b to
303e1ef
Compare
4ddbfe3 to
86618ff
Compare
libs/@hashintel/petrinaut/src/components/sub-view/vertical-sub-views-container.tsx
Show resolved
Hide resolved
5c96f80 to
1043468
Compare
86618ff to
5e05299
Compare
1043468 to
828cd5a
Compare
5e05299 to
5afc635
Compare
| border: "[1px solid rgba(0, 0, 0, 0.1)]", | ||
| backgroundColor: "[rgba(0, 0, 0, 0.05)]", | ||
| cursor: "not-allowed", | ||
| }); |
There was a problem hiding this comment.
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.
| defaultHeight: 150, | ||
| minHeight: 80, | ||
| maxHeight: 400, | ||
| }, |
There was a problem hiding this comment.
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)
🤖 Augment PR SummarySummary: This PR introduces a reusable Changes:
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 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| </button> | ||
| ))} | ||
| <HorizontalTabsHeader | ||
| subViews={BOTTOM_PANEL_SUBVIEWS} |
There was a problem hiding this comment.
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.
🤖 Was this useful? React with 👍 or 👎
| <div | ||
| className={contentStyle} | ||
| role="tabpanel" | ||
| aria-labelledby={activeTabId} |
There was a problem hiding this comment.
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.
🤖 Was this useful? React with 👍 or 👎
8f94631 to
23bd975
Compare
8de0606 to
2a570a8
Compare
0556bb1 to
d56af2b
Compare
| > | ||
| {subView.title} | ||
| {subView.tooltip && <InfoIconTooltip tooltip={subView.tooltip} />} | ||
| </button> |
There was a problem hiding this comment.
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.

🌟 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), orSubView/HorizontalTabsContainer(BottomPanel).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:
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:
❓ How to test this?
Use latest Petrinaut deployment