Documentation
¶
Overview ¶
Package panelayout owns the presentation-neutral pane tree shared by project and global workspace previews. It knows structure, geometry, and the default placement policy, but nothing about terminals, documents, issues, rendering, or persistence.
Index ¶
- func ClampRatio(ratio int) int
- func LayoutPanes(root *Node, box Box, floors Floors) (leaves []Placement, dividers []Divider, fits bool)
- func MaxID(node *Node) int
- func SetRatio(root *Node, splitID, ratio int) bool
- type Axis
- type Box
- type Divider
- type Floor
- type Floors
- type Kind
- type Layout
- type Node
- type OpenPlan
- type Placement
- type Split
- type Target
- type TargetKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClampRatio ¶
func LayoutPanes ¶
Types ¶
type Box ¶
type Box = termpreview.Box
type Node ¶
func Clone ¶
Clone returns a detached copy suitable for trial layout before committing a split that may not fit the current viewport.
func FirstOfKind ¶
type OpenPlan ¶
OpenPlan is the shared click-placement answer. Retarget names an existing leaf of the requested kind; otherwise Split names the leaf to divide.
func ApplyAxisOverride ¶ added in v1.0.0
ApplyAxisOverride rewrites a split plan's axis from the CLI --split flag. auto / empty leave PlanOpen's axis alone. A retarget is unchanged: --split never forces a second leaf of a kind that already exists, and it never retargets the named leaf onto the terminal.
func PlanOpen ¶
PlanOpen keeps the terminal in a full-height left column: the first content opens beside it, a different content kind stacks in the right column, a later content kind stacks on the largest content leaf, and a repeated kind retargets its existing leaf. boxes may be nil; ties and missing geometry follow the first content leaf in the tree.
type Target ¶ added in v1.0.0
type Target struct {
Kind TargetKind
Leaf int
}
Target is a single focusable window. Leaf is meaningful only for TargetLeaf.
func CycleTarget ¶ added in v1.0.0
CycleTarget returns the next target after current, wrapping at both ends. A current target that is not in the ring starts the cycle at the first entry (the last when reverse); an empty ring leaves focus where it is.
func Ring ¶ added in v1.0.0
Ring lists the focusable windows in cycle order: the sidebar (when visible), then every tree leaf in placement order, then the terminal panel (when visible). Leaf order matches the A-then-B walk LayoutPanes performs, so Tab follows the same sequence the panes are drawn in.
type TargetKind ¶ added in v1.0.0
type TargetKind int
TargetKind names the sort of window a focus target refers to.
const ( // TargetSidebar is the workspace list beside the preview. TargetSidebar TargetKind = iota // TargetLeaf is a pane-tree leaf, identified by Target.Leaf. TargetLeaf // TargetTermPanel is the transitional terminal panel entry. It is deleted // when windowing M1 absorbs the panel as a tree leaf; this case and the // termPanelVisible argument to Ring are the only ring-side sites to remove. TargetTermPanel )