A persistent secondary context docked alongside a node's navigation, collapsing behind an edge handle or disappearing as the viewport narrows.
A companion is a secondary region the view layer displays alongside a node's primary master-detail navigation: a chat panel beside a gaming session, a property inspector beside a document editor, or a reference pane beside a campaign tree.
Unlike popovers or modal drawers, a docked companion lives in normal layout flow: it reserves real layout space, causing adjacent navigation columns to compact smoothly without obscuring content.
A domain node opts into displaying a companion by answering the optional protocol method:
nodeCompanionNode () {
return this.someOwnedCompanionNode(); // returns the companion root node, or null for none
}The node specifies which node to show alongside itself, but zero UI details: width, axis, pinning, and collapse state are managed entirely by the view layer. This maintains strict headless testability.
| State | Visual Behavior | Space Allocation |
|---|---|---|
docked | Panel is expanded alongside or beneath navigation columns. | Reserves full length (companionReservedWidth()); columns compact to fit. |
tab | Panel is collapsed into a zero-width tab handle. | Panel occupies 0px. Adjacent SvNavView displays expansion handle. |
hidden | Panel and handle are both suppressed. | Viewport is too narrow to offer companion without breaking primary content. |
SvDetailView arbitrates layout space using setAvailableLength():
tabLength, mode switches to hidden.docked and tab, persisting the choice as userMode.SvStackView
└─ SvDetailView (owns space arbitration)
├── childStackView (primary flexible navigation)
└── SvCompanionView (node = nodeCompanionNode())
├── contentView (embedded isolated SvBrowserView)
├── SvEdgeHandleView (collapse/expand handle)
└── SvCompanionTabView (internal badge plumbing)| CSS Variable | Applies To |
|---|---|
--SvCompanion-bg | Companion panel background color |
--SvCompanionTab-color | Legacy tab text styling |
--SvCompanionTab-border-color | Legacy tab border color |