Repository navigation
feat(split): more than two panes in rows and columns, behind a setting - #3072
Conversation
Part of #1158. With Settings > Terminal > Split into rows and columns (per device, off by default) the split view holds up to four panes, side by side and stacked. A pane dropped on a slot's edge band opens beside, above or below it, on its middle in its place; boundaries move by drag or arrow keys. Every slot keeps its element and connections while the layout changes around it; a split saved by the two-half version opens as before. Off, the two halves work as today. Co-authored-by: bricks-8 <[email protected]>
# Conflicts: # src/lib/settings.legacy-fixture.ts
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…'s slot by its area Review round on #3072. Turning the setting off leaves the active slot and the first other one as two halves at 50%, instead of a grid without boundaries. "Open in left/right half" opens beside the active slot while there is room, else in the slot covering most of that half (the active one when stacked slots cover both alike), instead of always the lower one. Slots confirmed gone after a reload close in one change, so two answers cannot undo each other.
# Conflicts: # src/lib/settings.legacy-fixture.ts # src/lib/settings.test.ts # src/lib/settings.ts
|
Review round (omo + Codex Terra xhigh at 29baebc): no HIGH. The MEDIUMs, all fixed in this push:
LOW, not changed: every slot past Validation at this head: |
|
Local merge gate (owner-approved): |
…path (#3171) ## What The split view always takes rows and columns. Follows #3160 (merged); origin/main is merged in. - **Setting removed:** Settings → Terminal → More settings → "Split into rows and columns" (`splitGrid`) is gone. A stored `splitGrid` (including `false`) is dropped by `sanitizeSettings`, so every device gets rows and columns (up to four slots, movable boundaries). Two panes still open as two halves side by side (`data-side`, Close this half). - **Halves-only path removed:** `asHalves` and the effect that folded a grid back into two halves; the `grid` argument of `useSplitLayout`. - **Dead drop guide removed:** `SplitDropPreview` draws only the grid guide (slot outlines + one moving `.split-drop-zone` highlight, `data-edge`). The two-halves track (`.split-drop-half` / `.split-drop-target`, `data-side` on the guide) and its `dropAt` / `dropAtRef` / `showDropTarget` plumbing in `useSplitState` / `App` are gone. `dropSide` stays: `dropZone` uses it for a single pane's steady midpoint. - **Behaviour change for a device that had the switch off:** with two halves open, a pane's "Open in the left/right half" (`dockSide`) now opens a new slot beside the active one while there is room (up to four), as rows and columns always did, instead of replacing that half. A full area still replaces the slot covering that half. - DESIGN.md and docs/guide.md updated. The unreleased fragment `changelog.d/split-view-rows-and-columns.md` (#3072, shipped only in betas) now describes the split without a switch and says the beta's switch is gone; no second fragment. ## Regression steps rewritten to the grid guide (same intent) `scripts/split-view-regression.ts` and `scripts/ui-regression.ts` read the guide's `data-edge` instead of `data-side`: - One pane: a drop on the right half reads `data-edge="right"` (same hysteresis around the midpoint, same cancel paths: outside drop, blur, Escape, text/file drags ignored, narrow window, reduced motion now checked on `.split-drop-zone`). - "Both drop guides stay mounted / one indicator moves" becomes "the slot outline stays mounted / one `.split-drop-zone` moves and is not replaced when the side changes". - Two slots open: a drop at 20% / 80% of the area is that slot's middle (`data-edge="middle"`, the pane takes its place), where the halves offered a half; the outcomes asserted (which slot shows which pane, active slot) are unchanged. - The rows-and-columns block no longer turns the setting off; closing the last other slot uses the two halves' Close this half. `files-prompt-regression.ts` and `tab-overflow-regression.ts` only wait for `.split-drop.is-visible` / use two halves' `data-side`, which still hold; no change needed. ## Validation At `f8c8ad55a` (origin/main d023c8a merged in): - `bun run check fast`: all steps ok (unit 12745 pass, 0 fail). - `scripts/ui-contexts-regression.ts` (runs split-view-regression and tab-overflow-regression) in `herdr-ci-runner:local` (`RUNNER_ENVIRONMENT=self-hosted`, `bun scripts/ci-browser-parallel.ts`): passed. At `5cd0b9e46` (the same split code on #3160's 7d7af1b), in the runner image: **9/9 passed, no reruns** — `ui-regression`, `ui-contexts-regression`, `files-prompt-regression`, `render-crash-demo-regression`, `terminal-autoswitch-demo-regression`, `sidebar-split-demo-regression`, `sidebar-split-access-demo-regression`, `phone-split-grid-demo-regression`, `codex-drag-demo-regression`. Screenshots (demo, light, 1280 and 390, a device that had stored `splitGrid: false`): three slots open, the "Drop below" guide on a slot, and Settings → Terminal → More settings without the switch. Not run: `check full`, the integration suite, Windows/macOS jobs (no server, shared or native change). This adds no new control anywhere.
Part of #1158.
What
The split view can hold up to four panes in rows and columns, behind a new per-device setting, Settings > Terminal > Split into rows and columns (
splitGrid, off by default). With the setting off, the split view keeps the two halves from #861/#1176, so nothing changes until a device turns it on.With it on:
role="separator"that can be dragged, or focused and moved with the arrow keys (5% steps, between 15% and 85%).ovis:splitacross a reload. A split saved by the two-half version opens as before.Shared with the halves: a pane may show in several slots. The active slot sizes its pty when it shows the tab, else the first slot in reading order does, and the others follow (PaneFollowContext). Alerts, following herdr's focus and a pane moved under a new ID (#1503) now look at every other slot, not just the one other half.
Scope
#1158 asks for three things. This PR ships the first and most-requested one: three or more views in one window, resizable, with the existing drag and drop (vibewriter-hand's comment asks for exactly this first). Moving a pane to a window of its own, Option+Tab between slots, and windows knowing each other over BroadcastChannel are left for follow-ups.
The tree model (
slotsOf,slotRects,splitDividers,insertBeside,pruneSlots,dropZone,zoneRect, the old-format read instoredSplit) follows bricks-8's fork (feat/window-presence, first commit), credited as co-author. Their branch predates #1176, which lets one tab show in both halves, so the drop rules here follow #1176 (a drop never moves or swaps another slot's pane) instead of the fork's swap-on-drop. The limit is four slots instead of six, as the issue's follow-up comment asks for "three or four" first, and each slot pastaopens another set of connections.Design reference: VS Code's editor groups (split right or down into a grid, draggable boundaries, the drop overlay by edge or centre). The DESIGN.md entry says so.
The chat composer gets no new control. The only new UI is the opt-in Settings toggle, plus the boundaries and guide that appear only with it on.
Screenshots (demo build, setting on)
Taken in the CI runner image from the demo fixture. Light and dark at 1280 (three panes, four panes with a focused boundary, the bottom-edge and left-edge guides), and the Settings row at 1280 and 390. The images are attached in the lane report. The phone width never draws a split (up to 768px shows the active slot alone, as before).
Validation
bun test src/lib/split.test.ts: 26 pass. New cases cover top/bottom bands, a third pane below a slot, the four-slot cap, closing into the sibling's place, picks in another slot, boundary limits, and reading a two-half save and a grid.bun test src/lib/settings.test.ts src/lib/followFocus.test.ts src/lib/paneMove.test.ts: pass.scripts/split-view-regression.ts(checkSplitView, plus checkTabOverflow, which also uses the split) in the CI runner image (herdr-ci-runner:local): all PASS, including the new case "rows and columns: a pane opens below a slot, slots keep their terminals, a boundary moves from the keyboard and a reload keeps the layout". The existing two-half cases run unchanged with the setting off.bun run typecheck: clean.bun run check fast: see the lane report for the result at the PR head.check fulland the other browser lanes, which CI runs.