Layouts
A layout is how the panes in a space are arranged: side by side, one above another, or one pane taking the whole space. A layout is data, like everything else in Mod, so a person and an agent can both change it, and it is the same on every device.
How it works
There are three layouts. Columns puts panes side by side. Stacked puts one above another. Focus gives the focused pane the whole space while the others wait behind it.
Pane sizes are stored as fractions of the space, not pixels, which is why an arrangement still fits when you open it on a different screen. Things that are about one screen, such as the width of your sidebar, stay on that device.
A layout only arranges work. A pane shows a session, a document, an app or a web page that lives somewhere else, so closing a pane deletes nothing.
An agent can lay out a space for the work in front of it, such as a diff beside its spec, then hand it back. It can also move a pane to a heading, a line or a step of a review, in a space you are not looking at, without moving your window. When you go to that space, the pane is already where it should be.
Using it as you build
Agents change the layout with set_view, and move a pane to a place within its document with set_pane_view:
set_view { "layout": "columns" }
set_view { "focusPane": 2, "layout": "focus" }
set_view { "closePane": 3 }
set_pane_view { "documentId": "<documentId>", "view": { "heading": "Rollout" } }
read_view returns each pane and the arrangement, so an agent can see the layout before it changes it. See awareness.
Limits
- If two devices rearrange the same space at the same moment, the last arrangement written wins. The two are not merged.