Skip to content

Split View takes up to four tabs, side by side, stacked or in a grid - #1127

Open
naman0r wants to merge 2 commits into
yetanotherbrowser:mainfrom
naman0r:feat/split-view-panes
Open

naman0r wants to merge 2 commits into
yetanotherbrowser:mainfrom
naman0r:feat/split-view-panes

Conversation

@naman0r

@naman0r naman0r commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

I'd like your yes on the behavior (the gesture, the limits and the arrangements below) before this goes further. Pictures are below.

What changes

Split View takes up to four tabs, laid side by side, stacked one above another, or as a 2x2 grid. Letting a tab go on the right half of a split's row in the column (or the strip) adds it as a pane. Today that drop makes a folder (#1054). Every divider drags and double-clicks like the one between two halves does now. Taking a pane out, or closing it, leaves the rest as a smaller split.

Part of #71, #14, #522, #1054

Design decisions

The gesture. I kept the drop Yab already has. Holding a tab over another tab's row shows New Folder on the left half and Split View on the right (TabDropChoices). Today Split View is missing from that row when the target is already in a split, which is why #1054's drop makes a folder. Now:

  • Over a lone tab: left half makes a folder, right half makes a pair. Same as today.
  • Over a split with fewer than four panes: left half still makes a folder of everything, right half adds the tab as one more pane after the last.
  • Over a split of four: only New Folder, as now.
  • Folders' own drops (into, out of, between) are untouched.

No new gesture to learn, and nothing anyone does today lands somewhere else.

Limits. Four panes at most, as in Arc. A pane is never narrower than the 320 pt a half keeps today. A stacked pane is never shorter than 180 pt: a band and some page. The window's height floor doesn't grow with stacking (see Not in this PR).

  • Adding a third pane needs room for three across.
  • A fourth goes side by side when the room is wide enough (four times 320 pt plus the gaps). Otherwise it becomes a 2x2 grid.
  • Arrange refuses a layout the room can't hold.

Layouts.

  • Side by side (two to four), Stacked (two to four), Grid (four only).
  • Picked from the split's menu (right-click the row, new Arrange submenu) or from the command field ("Split View Side by Side", "Split View Stacked", "Split View Grid").
  • No new menu bar items or shortcuts. ⌃⌘\ still splits and separates, and Focus Other Half now cycles through every pane.
  • Changing the layout or the number of panes lays the panes out evenly again.
  • Dragging one divider pushes its neighbors along, in either direction, rather than squeezing a pane below its minimum.
  • With three or four panes on screen, the window goes no narrower and the column no wider than leaves every pane its 320 pt, as they do today for two halves.
  • The find bar, the notices and an agent's question stand over the pane in front, also when it is a lower pane of a stacked split or the grid.

Taking panes out.

  • A pane's ✕ in its band takes it out of the split. It stays a tab just after the split, and the pane before it comes to the front.
  • ⌘W on a pane closes it (or puts a pinned or kept tab down) and leaves the rest as a split.
  • Two left is an ordinary pair; one left is no split.

What stays two-only. Pinned pairs (the square holds two side by side), Swap Halves, Duplicate, and the layer-driven divider (SplitRule) work as before on a two-tab side-by-side split and are refused or disabled for anything else. Three or more panes use SwiftUI's divider path: pages are held during the drag and resized once on release, as the fallback already does. Mail's split code doesn't use this split type and is unchanged.

Two tabs behave exactly as today.

  • A split of two side by side (Pair.halves) runs the same code as before: same layout function, divider, SplitRule layers, SplitDeck targets, swap, pinned pairs.
  • Only splits of three or more, or two stacked, use the new layout path.
  • A unit test checks that the new layout math gives identical frames to the old one for two side by side, across widths and shares.

Saved and synced data.

  • Session files keep first, second and share as they are. The third and fourth pane, the layout and the extra divider positions are optional fields alongside (more, arrangement, cuts), so an older Yab reads a valid pair and the extra tabs come back as loose tabs after it. A test decodes the new file with an old reader's shape.
  • Every place that re-indexes a session's pairs (kept tabs in every window, shared pins, Arc import, window undo, moving tabs between spaces) carries the extra panes.
  • Sync is unchanged on the wire: it still sends the first two as a pair record, so the phone and older Macs see a pair. When an update from sync names a pair this Mac has as three or four, the Mac keeps its own extra panes. The iPhone and Android apps never read pairs (checked under Phone/ and Android/).

Arc. AGENTS.md says Arc is the spec. From the code's comments and the issues: Arc's Split View holds up to four tabs, side by side or stacked. I couldn't confirm the rest without Arc on this Mac:

  • whether Arc has a 2x2 grid or nests a stacked pair inside a side-by-side split (I chose a grid for four)
  • Arc's own gesture for adding a pane
  • Arc's minimum pane sizes

Pictures

All are window captures of Yab Dev from this branch in a test world: 1700x940 window, 236 pt column, dark look. The pages are local test pages, so every tab's mark is the "1" from 127.0.0.1; real sites show their own icons.

The drop menu over a split's row. Before (main): only New Folder. After: Split View on the right half.

drop menu before and after

Dragging a tab onto a split's row (Tab C onto A and B):

dragging a tab onto a split

Adding a fourth pane the same way:

adding a fourth pane

The column's row: a pair on main, then three and four panes on this branch. Under 72 pt a chip shows only its mark, since the title would be cut to "Ta…".

sidebar row before and after

Two side by side, main and this branch (same):

Before After
two before two after

Three and four side by side

three side by side
four side by side

Stacked: two, three and four

two stacked
three stacked
four stacked

2x2

grid

Dragging the grid's dividers: the one between the columns (it stops at the quarter a half keeps today), then the one between the rows:

dragging the column divider
dragging the row divider

⌘F in a lower pane (the grid, Tab D in front). Before (b463725, the first commit here): the search box opened over Tab B. After:

Before After
find bar before find bar after

The GIFs are stop-motion: the drag is driven by posted mouse events, a window capture after each step, about 5 frames a second. They show where things land, not how smooth the motion is.

Proof

  • Logic: new tests in Tests/FastTests/SplitPanesTests.swift:
    • the model: adding up to four, removing down to none, going round the panes, remapping
    • restoring two, three and four from a session, including bad files
    • what an older reader decodes from the new file
    • frames for every arrangement, two side by side matching the old layout exactly
    • divider limits and pushing, and where a dragged divider is held
    • a real Browser: dropping onto a split adds panes up to four, a pane's ✕ and ⌘W leave the rest, Arrange, the row keeping a split's tabs together, pinned pairs refusing three
  • Review fixes (second commit), Tests/FastTests/SplitPanesEdgeTests.swift, one test per Greptile finding: a later divider pushing earlier ones, the column's widest leaving three panes their width, middle-click on a third chip, a parked split's extra chips, and the find bar's place over a lower pane. The first three fail on b463725 as written; the last two use new helpers, and fail when the old behavior is put back inside them.
  • Visible change: pictures above, same window size and theme.

Tests

swift test --filter 'SplitPanesEdgeTests|SplitPanesTests|SplitPanesBrowserTests|SplitTests|SplitPinTests|SplitPinCloseTests|SplitPinCommandTests|SplitMenuTests|PinPairTests|SplitPreviewReleaseTests|FieldSplitTests|CollapsedPairProjectionTests|MailSplitTests|ColumnLayoutTests|ColumnHitTabTests|SessionFilePinTests|SyncShapesTests': 135 tests in 18 suites pass on 07cd17c.

After the review fixes, each run on its own, these pass too: ColumnFolderBehavior, ColumnDragScroll, ColumnLift, EmptyFolderDrag, Command, MenuCommandCatalog, KeptEverywhere, SharedPins, SpaceLanding, NestedFolders, WindowUndo, StripShut, LinkFolders, PinColumns.

The suites around what this touches also pass, each run on its own: ColumnFolderBehavior, ColumnHitTab, ColumnDragScroll, ColumnLift, EmptyFolderDrag, Command, MenuCommandCatalog, ShortcutCatalog, QuickAction, KeptEverywhere, KeptBoundary, KeptPageMenu, SharedPins, SpaceLanding, NestedFolders, NoEmptyTab, NativeControl, NativeControlRegression, SyncAdopt, SyncFlush, SyncSpaceDelivery, SyncToday, SyncStaleReturn, SyncWire, TabPlacement, TabMoveEveryWindow, WindowUndo, WindowSessions, SessionID, CrashSessions, PinColumns, LinkFolders, AgentTabCleanup, StripShut, FieldFavorites.

Two pre-existing failures: PinnedHomeTests.puttingAKeptTabDownLandsOnAnOrdinaryTabAsleep and AssistantTabSpaceTests.theGrantRoutesToItsSpaceEvenWithSharedCookies fail the same way on a clean checkout of main, and neither involves a split. Several Store-backed suites interfere with each other when run in one process, so I ran those one at a time.

SplitMenuTests changed by one line: the split's menu now lists Arrange.

Checked on

  • Yab Dev built from this branch on macOS 27.0, Apple silicon
  • Engine(s) tried: WebKit

Checklist

  • swift test passes (or the suites this touches: listed above)
  • ./design-check --head is clean
  • Anything that changes how Yab looks was approved in the issue first (not yet, asking here)
  • A new menu item is also a command in the field (Arrange's three layouts are commands in the field; no Settings row)
  • Words on screen and in docs are American English, with no em dashes

Not verified

  • The Chromium engine. Nothing here is engine-specific, but I only ran WebKit pages.
  • Real sites, a light look, Compact density, or the column on the right.
  • The top strip (tabs on top): the drop and the joined pills for three or four use the same code as the column, but I didn't shoot or click through them.
  • A session written here opened in an older Yab. Tested only by decoding with the old shape in a unit test.
  • Sync between two Macs.
  • Middle-click on a third chip and the space-switch preview of a split of three were checked by unit tests only, not by hand.

Not in this PR

  • The window doesn't get taller to fit three or four stacked panes. It keeps its 420 pt floor and the panes share whatever height there is, evenly, below 180 pt each.
  • No drop zones on the page itself for a third or fourth pane: carrying a tab over a split's pages puts it in a pane's place, as over a half today.
  • The agent control API (NativeControl) still reports one splitPartnerId; it should list every pane.
  • Mixed layouts such as one pane beside two stacked (Different Split View arrangements (triple, vertical, mixed horizontal and vertical) #522 asks for these too).
  • Pinned splits of three or four, and Duplicate or Swap for more than two.
  • A peek opened from a pane still stays inside that pane (Split View to Support 3 Panes #1054's second point).

A tab let go on the right half of a split's row in the column or the
strip joins it as one more pane, up to four, where it made a folder
before (yetanotherbrowser#1054). The left half still makes a folder, and a tab let go on
a lone tab still makes a pair.

Three or four panes stand side by side, one above another, or as a 2x2
grid, picked from the split's menu (Arrange) or the command field, and
every divider is dragged and double-clicked as the one between two
halves is. A pane's cross or ⌘W takes it out and leaves the rest a
split; one left is no split. The column shows the split as one row with
a chip for each tab.

Two side by side are laid, moved and kept exactly as before. Sessions
keep the panes past the second beside the pair, so an older Yab reads a
valid pair; sync carries the first two, and an update from sync keeps
this Mac's other panes. Pinned pairs, Swap Halves and Duplicate stay
two side by side.

Part of yetanotherbrowser#71, yetanotherbrowser#14, yetanotherbrowser#522, yetanotherbrowser#1054.
@naman0r
naman0r marked this pull request as ready for review November 25, 2026 02:28
@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge, with no new actionable issue found.

Summary

This PR expands Split View to four tabs with side-by-side, stacked, and grid layouts. The latest changes address all five previous findings.

  • Split View holds up to four tabs in several layouts.
  • Split panes stay together when tabs move, return, or sync.

naman0r explicitly deferred taller window minimums for stacked panes and noted that visual approval is still pending.

Review checks were limited to source inspection. macOS tests and visual checks were not run in this Linux environment.

Reviews (2) · Last reviewed commit: "Three or four panes keep their widths, a..." · Reviewed by Greptile

Comment thread Sources/Fast/Split.swift Resolved
Comment thread Sources/Fast/Split.swift Resolved
Comment thread Sources/Fast/ColumnCells.swift Resolved
Comment thread Sources/Fast/Side.swift Resolved
Comment thread Sources/Fast/App.swift Resolved
…n front

A divider dragged toward an earlier one pushes it back, as it already
pushed the later ones on. The window and the column now leave every pane
of a split on screen its least width, not two halves' worth. Middle-click
closes a split's third and fourth chips, and a space sliding in shows all
of a split's chips. The find bar and notices stand over the pane in
front of a stacked or grid split, and an agent's question at its bottom.

Two side by side are unchanged.
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