Repository navigation
Jalenevans/expandable output - #13
Conversation
Users can now resize the TLC output panel vertically by dragging the handle at its top edge, with height clamped between sensible bounds and restored on re-expansion. The ResizableDivider now exposes onDrag callbacks and accessibility attributes. Closes tlaplus#12
Restore top border when collapsed (hidden resize handle caused visual gap), re-clamp dragged height on window resize to prevent editor squeeze, end drag on blur with cleanup, make aria-label optional, and add 4 regression tests. Refs tlaplus#12
There was a problem hiding this comment.
Pull request overview
This PR makes the TLC Output panel vertically drag-resizable so users can expand it to see more output without being constrained to a small fixed-height box, aligning with the UX request in #12.
Changes:
- Replace Tailwind fixed heights in
TlcOutputPanelwith a remembered pixel height that can be adjusted via a verticalResizableDivider, with clamping and resize re-clamping. - Enhance
ResizableDividerwith drag lifecycle callbacks and improved ARIA semantics (role="separator",aria-orientation,aria-label) and end-drag-on-window-blur behavior. - Add a new test suite covering resize math, clamps, collapse/restore behavior, and blur-ending-drag.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/components/TlcOutputPanel.tsx | Implements resizable open height state, clamping, and drag UX (no transition during drag). |
| src/components/ResizableDivider.tsx | Adds optional drag callbacks, ARIA attributes, and blur-to-end-drag to improve robustness. |
| tests/TlcOutputPanel.test.tsx | Adds unit tests covering the new resize behavior and edge cases. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
It seems like the build was failing because Node 20 is being deprecated. Upgraded ci and cd to Node 24 to resolve that issue. |
|
@FedericoPonzi The build failure seems to be an unrelated infrastructure issue. Could you please help? |
|
Thanks for the PR @JalenEvans ! @lemmy it looks like we need to provide write permissions to gh actions to allow the integration to upload the zip with the website preview: https://github.com/tlaplus/tla-by-example/settings/actions |
|
I’m also unable to change the workflow permissions. Perhaps it’s a policy enforced at the enterprise (Linux Foundation) level. |

The TLC output panel had a hard-coded height (
h-48open,h-8collapsed), so anything longer than a few lines meant scrolling inside a tiny box. This makes the panel's top edge drag-resizable.Closes #12
Key changes
TlcOutputPanelnow tracks its open height as state (px) instead of a Tailwind height class, driven by aResizableDivider direction="vertical"rendered at its top edge while open.[64px, max(64, window.innerHeight - 320)]. The 320 accounts for surrounding chrome (Navbar ~53 + Footer ~69 + Playground tab bar ~37) plus a ~160px editor floor, so the code editor always keeps usable room regardless of viewport size. The clamp re-applies if the window is resized shorter after a drag.ResizableDivider(also used bySplitLayoutand the TLA+ intuition page) gained optionalonDragStart/onDragEnd/ariaLabelprops androle="separator"/aria-orientation/aria-label, all additive and backward compatible — the other two call sites are unchanged.blur, fixing a pre-existing bug where releasing the mouse outside the viewport (or alt-tabbing mid-drag) left the drag "stuck" with its document listeners still attached.Testing
Added
__tests__/TlcOutputPanel.test.tsx(13 new tests) covering the drag math, both clamp boundaries, collapse/re-expand height memory, no handle while collapsed, the collapsed border,aria-orientation, viewport-resize re-clamping, and blur-ends-drag. Full suite passes (25/25), andnpm run buildsucceeds.Since this is a static export (
output: "export"),windowis only read inside event handlers/effects, never during render or in auseStateinitializer, to keep prerendering working.Out of scope (follow-ups)