feat: redesign pane layout system (@superset/panes)

Merged
SA
7mo ago
+4222-3220

Summary

  • Redesigned the pane layout data model from a 3-tier hierarchy (Root → Group → Pane) to a simpler Tab → Split → Pane model
  • Renamed package from @superset/pane-layout to @superset/panes
  • New store with all actions (tab CRUD, pane CRUD, split/resize/equalize, openPane, replacePane)
  • N-ary weighted splits (FlexLayout-inspired) with react-resizable-panels for resize UI
  • React component tree: Workspace → TabBar → Tab → Pane with PaneHeader
  • Configurable pane header actions via PaneActionConfig (split + close with hotkey tooltips)
  • Slots API: renderTitle, renderHeaderExtras, renderToolbar (full eject) on PaneDefinition
  • PaneContext and TabContext types with enriched layout info (parentDirection, position)
  • 57 store tests passing
  • Wired up in desktop app's v2 workspace with proper pane registry, empty state, and command palette

Test plan

  • Open v2 workspace → empty state with action buttons renders
  • Click + → dropdown shows Terminal/Chat/Browser options
  • Add terminal tab → tab appears with pane header (icon + title + split/close)
  • Click split → new terminal pane appears (direction auto-picks based on layout)
  • Click close → pane closes, last pane closes tab
  • Resize split handles → weights update
  • Tab rename (double-click) → inline input works
  • Tab context menu → Rename/Close/Close Others/Close All
  • Hover pane header actions → tooltips with hotkey labels
  • bun test in packages/panes → 57 tests pass
  • bun run typecheck in packages/panes → clean

Summary by cubic

Redesigned the pane layout to a simpler Tab → Split → Pane model using the new @superset/panes package. Integrated into the desktop v2 workspace with weighted splits, resize, a streamlined Add Tab menu (with Show Preset Bar toggle), and a cleaner empty state.

  • New Features

    • N‑ary weighted splits via react-resizable-panels with resize/equalize.
    • Store with actions for tab/pane CRUD and split/resize/equalize; open/replace supported.
    • Slots on PaneDefinition and configurable headers via PaneActionConfig with hotkey tooltips.
    • Add Tab dropdown (Terminal, Chat, Browser) wired to the command palette; includes “Show Preset Bar”.
    • 57 store tests added.
  • Refactors

    • Removed legacy PaneViewer; empty state renamed to WorkspaceEmptyState.
    • Chat components moved under the pane registry and renamed to ChatPane.
    • Renamed @superset/pane-layout to @superset/panes; host-service CORS now respects DESKTOP_VITE_PORT for localhost/127.0.0.1; downgraded @mastra/core (1.17.0 → 1.16.0) and @pierre/diffs (1.1.7 → 1.1.3) to satisfy CI policy.