Documentation
¶
Overview ¶
Package layoutreport owns the versioned JSON projection `sidecar layout get` returns: grid, kinds, targets, sessions, caps, and floors. Both the project workspace and the global Sessions surface build this document from a pane tree so the wire shape cannot drift.
Index ¶
Constants ¶
const Version = 1
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(src Source) json.RawMessage
Build projects Source onto the get-report JSON document. A tree that escapes the grid vocabulary reports "grid": null plus the raw tree.
func LiveBoxes ¶
func LiveBoxes(root *panelayout.Node, peer panelayout.Box, floors panelayout.Floors) map[int]panelayout.Box
LiveBoxes is each leaf's tiled OUTER box for the current viewport, or nil when the tree does not fit: a get answer then reports structure without pretending geometry it cannot draw.
Types ¶
type CSSViewport ¶ added in v1.16.0
CSSViewport describes a graphical screen without terminal cell geometry.
type Floors ¶
Floors reports the per-kind minimum OUTER box the frame enforces, keyed by the vocabulary's wire names.
func FloorsJSON ¶
func FloorsJSON(floors panelayout.Floors) Floors
FloorsJSON projects panelayout.Floors onto the get-report's keyed object.
type Pane ¶
type Pane struct {
Cell string `json:"cell"`
Kind string `json:"kind"`
Pane int `json:"pane"`
Provider string `json:"provider,omitempty"`
// Collection and Query are the active tab's plugin collection, when the
// Resource pane is showing one. They round-trip: a get → edit → apply of
// this report reopens the same list, searched the same way.
Collection string `json:"collection,omitempty"`
Query string `json:"query,omitempty"`
Session string `json:"session,omitempty"`
Attachment *state.PaneAttachmentJSON `json:"attachment,omitempty"`
Tabs []string `json:"tabs,omitempty"`
Active int `json:"active,omitempty"`
Box *Box `json:"box,omitempty"`
}
type Report ¶
type Report struct {
Version int `json:"version"`
Surface string `json:"surface,omitempty"`
Root string `json:"root,omitempty"`
Grid *Grid `json:"grid"`
Tree json.RawMessage `json:"tree,omitempty"`
Viewport *Box `json:"viewport,omitempty"`
CSSViewport *CSSViewport `json:"viewport_css_pixels,omitempty"`
FloorsUnit string `json:"floors_unit,omitempty"`
Caps Caps `json:"caps"`
Floors Floors `json:"floors"`
}
Report is one versioned JSON document describing a surface's pane tree.
type Source ¶
type Source struct {
Surface string
Root string
Tree *panelayout.Node
CSSViewport *CSSViewport
FloorsUnit string
Viewport *panelayout.Box
Floors panelayout.Floors
Layout *state.PaneLayoutJSON
Boxes map[int]panelayout.Box
LeafLayouts map[int]*state.PaneLayoutJSON
}
Source is everything a host supplies to project a get answer. Layout is the panecodec encoding of Tree (tabs, session, raw tree); Boxes are live outer geometry keyed by leaf id, omitted when the tree does not fit.