Automatic column compaction, last-column stretching, and per-node width hooks, without per-screen layout code.
Responsive behavior in STRVCT is not a separate rendering mode or set of CSS breakpoints. The same master-detail composition that produces a multi-column Miller view on a wide desktop produces a one-column stack with breadcrumbs on a phone, because each column states what it needs and one allocation over the whole chain hides the columns that would overflow.
This behavior—automatic collapsing—falls out of the same primitives used for navigation at any width; there is zero separate "mobile" code path in the view hierarchy.
Each level of a browser's chain states a claim: a small record of plain values that says what it needs, such as the width it asks for, whether it fills the width left over, and how much its companion or anchored panes reserve (SvStackView.layerClaim()). The root hands every claim in the chain, with the root's width, to SvLayerAllocation, which uses no DOM and no views. It answers for each level whether it is hidden and which width rule it takes. Each column applies its own answer in one place (SvNavView.applyLayerAnswer()).
The rules, each held by a check in tests/headless/TestLayerAllocation.js:
nodeChildrenLayout() is "inline" or "grid") fills whenever it is shown, not only when it is last, and is hidden by the same test as any other column.When a pass runs. A pass runs only when something it depends on has changed: the root's width, which stacks make up the chain and whether each is on the page, or a level's claim. The root keeps the signature of its last pass and skips one that would change nothing, so an ordinary node update, such as a streamed chat chunk, costs nothing. Widths are read once per pass from cached measurements, never after a write.
The design, its history and the measurements are in Compaction Coordinator.
Domain nodes can influence layout without writing custom view code:
| Node Method | Purpose & Behavior |
|---|---|
nodeMinTileWidth() | The width the node's column asks for (its target). The default target is 270px; a column whose tiles show thumbnails adds room for them. |
nodeFillsRemainingWidth() | When true, the column stretches to take the width left over whenever it is the last visible column. Useful for document editors or chat logs. |
nodeChildrenLayout() | "inline" draws the children within the node's own column, as a document; "grid" draws them as cells that wrap at the column's edge (at least nodeChildrenTileWidth() wide). Either way the column fills whenever it is shown. |
SvWebBrowserWindow.shared().width(): Returns current viewport width in CSS pixels. Use it for layout decisions in views. (Compaction itself uses the root's own width, so a browser embedded in a panel compacts to the panel, not the window.)SvWebBrowserWindow.shared().isOnMobile(): User-agent string match (iPhone/Android). Use only for touch-gesture or platform-specific permissions, never for column width sizing.On iPhone Safari, CSS 100vh units fail to subtract the animated URL bar area (~40px overflow). The reliable fix is binding root page height to window.visualViewport.height during visualViewport.resize and orientationchange events.