Skip to content

feat(split): more than two panes in rows and columns, behind a setting - #3072

Merged
devswha merged 5 commits into
mainfrom
feat/split-grid
Nov 5, 2026
Merged

devswha merged 5 commits into
mainfrom
feat/split-grid

Conversation

@devswha

@devswha devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner

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:

  • A sidebar row, an Agents row, a tab or a slot's bar dropped on a slot's edge band (a quarter of its width or height) opens the pane in a new slot beside, above or below that slot. Dropped on the middle, it opens in that slot's place. A single pane keeps the halves' midpoint with its 12px band, plus a band along its top and bottom.
  • The layout is a binary tree of row and column splits with at most four slots. Every slot keeps a one-letter id and is drawn in one container at the rectangle the tree gives it, so a slot keeps its terminal and its connections when the layout around it changes.
  • Each boundary is a role="separator" that can be dragged, or focused and moved with the arrow keys (5% steps, between 15% and 85%).
  • The guide outlines every slot and moves one accent highlight to the place the pane would take ("Drop above", "Drop below", "Open here", ...).
  • Closing the active slot gives its place and the selection to the slot it shared a split with. Two slots side by side are the two halves again, and closing one of those is "Close this half" as before.
  • The layout is kept in ovis:split across 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 in storedSplit) 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 past a opens 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.
  • Skipped: full check full and the other browser lanes, which CI runs.

devswha and others added 2 commits November 6, 2026 06:27
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
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b4bdf57 and a8ed939.

Files selected for processing: 32

  • DESIGN.md
  • changelog.d/split-view-rows-and-columns.md
  • docs/guide.md
  • scripts/split-view-regression.ts
  • src/App.tsx
  • src/components/SettingsDialog.tsx
  • src/components/SplitDividers.tsx
  • src/components/SplitDropPreview.css
  • src/components/SplitDropPreview.tsx
  • src/lib/followFocus.test.ts
  • src/lib/followFocus.ts
  • src/lib/i18n.ja.ts
  • src/lib/i18n.ko.ts
  • src/lib/i18n.zh.ts
  • src/lib/i18n/settings-composer.ja.ts
  • src/lib/i18n/settings-composer.ko.ts
  • src/lib/i18n/settings-composer.zh.ts
  • src/lib/i18n/terminal.ja.ts
  • src/lib/i18n/terminal.ko.ts
  • src/lib/i18n/terminal.zh.ts
  • src/lib/paneMove.test.ts
  • src/lib/paneMove.ts
  • src/lib/settings.legacy-fixture.ts
  • src/lib/settings.test.ts
  • src/lib/settings.ts
  • src/lib/split.test.ts
  • src/lib/split.ts
  • src/lib/useAlertSignals.ts
  • src/lib/useMachineRoster.ts
  • src/lib/useSearchRequest.ts
  • src/lib/useSplitView.ts
  • src/styles.css
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

…'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
@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Review round (omo + Codex Terra xhigh at 29baebc): no HIGH. The MEDIUMs, all fixed in this push:

  • Turning the setting off left a grid without boundaries. With the setting off, the split is now two halves: the active slot and the first other slot in reading order, each keeping its terminals, at 50%. Covered by asHalves unit tests, plus a browser step in split-view-regression.ts (three slots, then the setting off and a reload, then two halves at half width and no boundary).
  • "Open in left/right half" and half drops picked the wrong slot (always the lower one when stacked, and the left one at an 85/15 boundary). With rows and columns on and room for another slot, the pane menu now opens beside the active slot on that side. Otherwise sideZone takes the slot covering most of that half, and the active one when stacked slots cover it alike. The new unit cases fail on the previous sideZone and pass now.
  • Two slots confirmed gone after a reload could undo each other's close. The answers are now awaited together and applied as one change.

LOW, not changed: every slot past a opens its own connections to each PC (up to three more sets at four slots). This is the cost the four-slot cap is sized for.

Validation at this head: bun run check fast green (12410 pass). checkSplitView + checkTabOverflow all PASS in herdr-ci-runner:local on the fix commit, including the extended rows-and-columns case. The origin/main merge after that touched only settings files (sidebarPeek).

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate (owner-approved): bun run check fast passed at this head (12410), omo + Codex re-review CLEAR at this head after one fix round (3 MEDIUMs fixed), threads resolved, merges cleanly; split-view and tab-overflow browser regressions pass in the CI runner image. Opt-in (Settings > Terminal > Split into rows and columns), off by default = today's two halves; old two-half saves still open; turning it off collapses to two halves. Builds on bricks-8's tree model (co-author). CodeRabbit was rate-limited. Part of #1158. Merged without waiting for GitHub CI.

@devswha
devswha merged commit 9f690eb into main Nov 5, 2026
12 checks passed
@devswha
devswha deleted the feat/split-grid branch November 5, 2026 21:48
devswha added a commit that referenced this pull request Nov 6, 2026
…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.
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.

1 participant