Skip to content

feat: resizable workbench & timeline panels (react-resizable-panels) - #31

Merged
hoce1n merged 1 commit into
mainfrom
260812-feat-resizable-panels
Aug 12, 2026
Merged

hoce1n merged 1 commit into
mainfrom
260812-feat-resizable-panels

Conversation

@monkeycode-global

Copy link
Copy Markdown
Contributor

Summary

Makes the two-column layouts resizable by drag using react-resizable-panels (v4 API: Group/Panel/Separator), instead of hand-rolled drag logic. The library provides keyboard accessibility, min/max constraints, and touch handling out of the box.

Changes

  • Workbench (src/components/devtools/Workbench.tsx): editor ↔ console/output split is now a horizontal Group at the lg breakpoint (1024px+) with 50/50 default and 25% min on each panel. Below lg, the existing stacked mobile layout is unchanged (no resize handles).
  • Timeline (src/components/devtools/Timeline.tsx): era-rail ↔ content split is a horizontal Group at md (768px+), defaulting the rail to 220px (140px min, 480px max) to match the previous md:grid-cols-[220px_1fr]. Stacked below md.
  • Persistence: each split ratio is saved to localStorage via useDefaultLayout with an SSR-safe storage adapter (src/lib/panel-layout.ts), following the same guard pattern as src/lib/progress.ts. Separate keys for Workbench vs Timeline.
  • Scroll-bounding fix preserved: the Workbench Group wrapper keeps the fixed h-[520px] height, and each panel's inner content keeps flex-1 min-h-0 overflow-auto (plus overflow-hidden on the column wrapper), so long console output always scrolls internally within the allocated (resizable) space.
  • New src/hooks/use-media-query.ts: reusable SSR-safe matchMedia hook for breakpoint-conditional rendering.

Verification

  • bun run typecheck, bun run lint, bun test (58 pass), bun run build all pass.
  • Headless-browser checks confirmed:
    • Dragging the separator resizes both splits (mouse and keyboard Arrow keys).
    • The chosen ratio persists across a reload and clears back to the default split.
    • Breakpoints behave: resizable at md/lg+, stacked with no handles below.
    • Embed page resizes correctly at desktop width within the iframe.
    • A 40-line program producing heavy output stays contained in the bounded console panel (log container scrolls internally, panel height stays bounded).

…le-panels

- Replace the editor/console CSS grid and timeline rail/content grid with
  react-resizable-panels Group/Panel/Separator (v4 API) at the lg/md
  breakpoints; below those the stacked mobile layout is unchanged.
- Persist each split ratio to localStorage via useDefaultLayout with an
  SSR-safe storage adapter, mirroring the progress.ts guard pattern.
- Keep the workbench Group height-bounded (h-[520px]) and panels internally
  scrolling (min-h-0 flex-1 overflow-auto) so the long-code console
  scroll-out-of-view fix is preserved at any panel size.
- Add a reusable SSR-safe useMediaQuery hook.
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
runtimejs Ready Ready Preview Aug 12, 2026 10:49am

@hoce1n
hoce1n merged commit d10b0fd into main Aug 12, 2026
3 checks passed
@hoce1n
hoce1n deleted the 260812-feat-resizable-panels branch August 12, 2026 10:50

This branch was successfully deployed

1 active deployment
Preview — 767a8fe4 Deployed Aug 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants