layoutreport

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 Box

type Box struct {
	X, Y, W, H int
}

type Caps

type Caps struct {
	MaxColumns int `json:"maxColumns"`
	MaxRows    int `json:"maxRows"`
	LiveLeaves int `json:"liveLeaves"`
}

type Column

type Column struct {
	Column int    `json:"column"`
	Panes  []Pane `json:"panes"`
}

type Floor

type Floor struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

type Floors

type Floors map[string]Floor

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 Grid

type Grid struct {
	Columns []Column `json:"columns"`
}

type Pane

type Pane struct {
	Cell     string   `json:"cell"`
	Kind     string   `json:"kind"`
	Pane     int      `json:"pane"`
	Provider string   `json:"provider,omitempty"`
	Session  string   `json:"session,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"`
	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
	Viewport *panelayout.Box
	Floors   panelayout.Floors
	Layout   *state.PaneLayoutJSON
	Boxes    map[int]panelayout.Box
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL