Expand description
lingxia-surface — the platform-agnostic core of the Adaptive Surface
Layout model (see docs/draft/adaptive-surface-layout.md).
Pure Rust, no UI: the Surface Graph, its invariants and state transitions,
the two-axis derivation into DerivedLayout, and the Host arbitration
pure function. Each platform skin binds the DerivedLayout output.
Structs§
- Derived
Layout - Shared-core output bound by each platform skin. The pure core view: the
resolved
sizeClass/forms/bottomOwnerand the authoritativelayoutTree. The renderable, skin-bindable contract isLayoutPresentationPlan(derived from this graph), not this type. - Float
Spec - Minimal semantics carried only by
floatsurfaces (§1.1). - Layout
Presentation Plan - The stable, complete render contract a skin binds. Unlike the pure-core
DerivedLayout, this flattens the graph into the renderable view any skin needs: orderedmains,asides(with edge + preferred size),floats, and the full id-onlytree. Derived from the graph so the shared core output isn’t bound to one skin’s needs. - Placement
- Placement hint (input). Authoritative layout is the
LayoutTree(output). - Plan
Aside - One aside in the
LayoutPresentationPlan: the surface id, the requested edge, and its preferred size. Skins readsplit_formto decide whether these asides dock beside the main or present full-screen on compact. - Plan
Float - One float in the
LayoutPresentationPlan: the surface id plus the render-relevantFloatSpecsemantics (anchor, dismiss, modal). Floats are popups above the layout and are never in the tree, so the skin reads this list to know which popups to show and how each behaves. The reconciler is the single authority for float visibility. - Policy
- Tunable arbitration policy. Defaults are the spec’s cross-platform defaults.
- Surface
- One node in the Surface Graph.
- Surface
Graph - One window’s graph. Surfaces are kept in insertion order so that “adjacent main” succession and “oldest aside” replacement are deterministic.
- Surface
Manager - One window’s stateful surface driver.
Enums§
- Axis
- Bottom
Owner - Who owns the bottom bar in compact.
- Decision
- Structured outcome of a request (§3.1). A subset of the spec’s full set;
mergedIntoTabslands when tab-grouping is implemented. - Edge
- Which edge a surface docks to (asides) or anchors from.
- Float
Anchor - How a
floatsurface anchors. - Float
Dismiss - How a
floatsurface is dismissed. - Layout
Tree - Authoritative layout produced by the Host (output), referencing surfaces only by id. Overlay/float surfaces never appear here.
- Role
- Relationship of a surface to the main content. The single core abstraction behind every platform skin (window / panel / sheet / tab …).
- Size
Class - Available-width band. Aligned to Material breakpoints and computed from the container width, not the physical screen.
- Split
Form - How asides (the split axis) render.
sheetbelongs tofloat, not here. - Surface
Content - What a surface shows. Only two kinds: a declared catalog
entry(resolved by the host fromlingxia.toml) or an ad-hocwebpage. - Surface
Owner - Owner scope: decides when the surface is closed (§5).
- Surface
State - Runtime state of a surface.
- Switcher
Form - How the main-switcher renders on this platform/size.
Constants§
- DEFAULT_
HYSTERESIS - Default hysteresis margin to avoid breakpoint thrashing.
Functions§
- arbitrate
- Run arbitration. Pure: clones the graph, applies the resolved request, and returns the new graph plus the decision. The result graph is always valid.
Type Aliases§
- Surface
Id - Stable identifier of a surface within a graph.