ovis icon indicating copy to clipboard operation
ovis copied to clipboard

Split view: more than two tabs, side by side and stacked, across windows of their own

Open bricks-8 opened this issue 1 month ago • 2 comments

Problem

I run several agent sessions at once, in different workspaces and on two PCs (a Mac mini as the host and a MacBook added over SSH). Before herdr web ui I kept them in VS Code terminal groups, three columns side by side or three rows stacked, so every session stays in view.

The split view from #861 puts two tabs side by side, from different workspaces or PCs, which covers half of that. A third session still has to replace one of the two halves, and nothing can be placed above or below.

I also use a second, vertical monitor for more sessions. The split lives in one browser window, so there is no way to take a pane out to that screen and split it again there.

Once there are several slots and windows, two more things get in the way: picking a session in the sidebar that another window already shows opens it a second time here, and there is no way to move between slots, or between windows, from the keyboard.

Proposal

Let the split view hold more than two tabs, in rows and columns, with the drag and drop that #861 already has.

  • Dropping a sidebar row or a tab on the edge band of a slot (a quarter of its width or height) opens it beside that slot: left, right, above or below. Dropping it on the slot's middle opens it in that slot's place, as dropping on a half does now.
  • With a single pane, the left and right halves behave as they do now (the midpoint with its 12px band). A band along the top and bottom splits above and below.
  • The layout is a binary tree of row and column splits, at most six slots. Every slot keeps a stable id and is drawn in one container at the rectangle the tree gives it, so a slot that moves keeps its terminal attached, as the a and b slots do today.
  • The boundary between two slots can be dragged, or focused and moved with the arrow keys (5% steps, 15% to 85%).
  • The rest stays as #861 made it: a press or a Tab into a slot makes it active, a tab is never drawn in two slots, a window up to 768px shows the active slot alone, and the split is kept across a reload. A split saved by the two-half version is read and opened as before.

The same split view gives a pane a window of its own:

  • "Move to a new window" on a split slot's bar, or a tab (or a sidebar row that crossed the pane area) let go outside the window, opens the pane in a new browser window near the pointer and closes its slot here. A pane shown alone stays here too.
  • More gets "Open in a new window" on a desktop with a mouse, which opens the selected pane there and leaves this window as it is.
  • The window opens blank first, so a blocked pop-up changes nothing here and is named over the pane. Its copy of this window's session storage is cleared and its opener let go before it loads, so it starts with the pane alone and keeps a split of its own.
  • Without the browser's window management permission the window opens on the current screen and is moved to the other one by hand.

Moving between slots and windows:

  • The active slot gets an accent frame around the whole slot, and the slot arrived at holds a heavier frame for a moment, so it is clear where the keys go.
  • Option+Tab steps to the next slot in reading order and Option+Shift+Tab to the one before, with the keyboard in it. Plain Tab stays with the terminal's and the composer's completion. The steps are claimed only while there is another slot or window to go to.
  • The app's windows know each other: each window is named and announces over a BroadcastChannel which tabs it draws. A pane picked in the sidebar or the palette that another window already shows is shown there (that window comes forward with its slot active and framed) instead of opening a second time. Option+Tab past the last slot goes on to the next window's first slot, and back.
  • Bringing another window forward: I checked this in macOS Chrome with a small test page. otherWindow.focus() raised a window the page itself had opened, but not its opener, and a window calling window.focus() on itself after a BroadcastChannel message did not come forward at all. window.open("", thatWindowsName) from a click or a key brought the other window forward in both directions, so that is what the change uses. A name the browser cannot reach (a window opened by hand, or on another origin) opens a blank window, which is closed at once; that window is not tried again and the pick opens the pane here as before.

All of this is working on a fork, with unit tests for the layout model and a new case in scripts/split-view-regression.ts (three columns, a slot below, a keyboard resize, a moved slot keeping its terminal, closing down to one pane): https://github.com/bricks-8/herdr-web-ui/tree/feat/window-presence

That branch stacks the changes as separate commits, each building on the one before: the split grid, a pane in a window of its own, the slot frame and Option+Tab, and the windows knowing each other. scripts/split-view-regression.ts has a case for each (moving from a slot, a torn-off tab, the More item and a blocked pop-up; stepping slots with Option+Tab; a pane shown in the window that has it, and Option+Tab between two windows). I would open one PR with those commits, as CONTRIBUTING.md allows for changes that need each other's code, or split it into PRs in order if you prefer. Happy to change the approach first.

Where

Desktop pane area (split view)

Where it exists today

  • VS Code: terminals in editor groups, split right or down into a grid, with draggable boundaries.
  • herdr's TUI: splits one tab into any number of panes, right or down. The split view here does the same across tabs, workspaces and PCs.
  • VS Code: "Move Editor into New Window" takes an editor group out to a window of its own, and "Focus Next Editor Group" moves between groups from the keyboard.

Workarounds and alternatives

  • Two browser windows, each with a two-half split. It works, but every window has its own sidebar and header.
  • Moving panes into one herdr tab with herdr pane move. It only works within one PC, and the sidebar then shows all of them as one workspace.
  • Opening a second browser window by hand and picking the pane there. It works, but the pane stays in the first window's split as well, and the two windows do not know about each other.

bricks-8 avatar Oct 15 '26 07:10 bricks-8

I have the same need, and my case for three views in one window is concrete: a plan or specification, the session implementing it, and a review of the result. Two halves force me to swap one out exactly when I need to compare all three.

My request is three or more simultaneous views in one Ovis window, resizable and focusable, with the drag and drop that already exists. Separate windows are useful, but they do not replace the single-window layout.

The scope I would ask for first is three or four visible views, with a layout that can grow, and multi-window coordination discussed separately if it is too large. I am not assuming an unlimited number is free; the initial limit should follow layout and performance testing.

#1176 now lets the same tab appear in both halves, while this issue's original text says a tab is never drawn twice. An updated design should reconcile that with attachment, active and follower behaviour, and drafts.

I have not run the linked fork or its tests. Is that implementation still the preferred starting point, and is there a smaller scope you would want this request to focus on?

vibewriter-hand avatar Oct 26 '26 11:10 vibewriter-hand

Closing this as done: the split view holds more than two panes in rows and columns, with the existing drag and drop (#3072, #3171; up to four slots). Bringing a pane of another tab beside a pane is in review in #4870.

Remaining: taking a pane out into a browser window of its own.

If you still need that remaining part, please open a new issue for it — thank you!

devswha avatar Nov 27 '26 18:11 devswha