diff options
| author | user <user@clank> | 2026-08-11 00:50:30 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-11 00:50:30 +0200 |
| commit | f72c7266fe88070149639d66ae09b43c2d990f6e (patch) | |
| tree | ed230e9d89810ec34932ed95bb106ba02774540e /zellij-utils/src/ipc | |
| parent | sl0p: record the green test baseline in SPEED.md (diff) | |
| download | sl0ppij-f72c7266fe88070149639d66ae09b43c2d990f6e.tar.gz sl0ppij-f72c7266fe88070149639d66ae09b43c2d990f6e.tar.xz sl0ppij-f72c7266fe88070149639d66ae09b43c2d990f6e.zip | |
sl0p: add `arrangement` to build a tree for N panes
A `children` placeholder inserts every pane it receives as a flat sibling.
That single hardcoded policy is why a layout can only express "N equal
columns", "N equal rows" or "one stack" without hand-writing a variant per
pane count -- the max_panes=5 / max_panes=8 / max_panes=12 ladders in a swap
layout file exist purely to work around it.
`pane arrangement="grid" { children; }` builds a tree for N panes instead.
Two to start: grid (ceil(sqrt(n)) columns, rows filled left to right) and
master-stack (one 60%-wide master, the rest beside it).
Generates a TiledPaneLayout rather than geometry, so everything downstream
works unchanged: split_space, the minimum-size feasibility check,
LayoutApplier, swap-layout damage tracking, and the responsive collapse. It
composes with that last one for free -- a grid is simply infeasible on a
narrow terminal, so it is skipped and the collapse takes over.
The arrangement builds ONE self-contained subtree rather than splicing a
variable number of nodes in among the placeholder's siblings, so it stays well
defined next to the pre-existing "children node with sibling nodes" TODO
rather than leaning on it.
Like default_fg/default_bg, the field has no protobuf representation, so it is
defaulted at both plugin-API boundaries and does not survive a round trip.
This is why it is a field rather than a LayoutConstraint variant: a new enum
variant would have no representation when converting TO protobuf, and the
committed prost assets cannot be regenerated here (no protoc).
The 48 snapshot updates are the new field appearing in TiledPaneLayout debug
dumps (324 lines, all `children_arrangement: None`). No snapshot content was
removed. The `expression:` metadata churn in those files is pre-existing drift
that regeneration swept up: the stored snapshots recorded the expression
before normalize_layout_debug was introduced.
Diffstat (limited to 'zellij-utils/src/ipc')
| -rw-r--r-- | zellij-utils/src/ipc/protobuf_conversion.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/zellij-utils/src/ipc/protobuf_conversion.rs b/zellij-utils/src/ipc/protobuf_conversion.rs index c07b34d5..8bd43081 100644 --- a/zellij-utils/src/ipc/protobuf_conversion.rs +++ b/zellij-utils/src/ipc/protobuf_conversion.rs @@ -4512,6 +4512,8 @@ impl TryFrom<crate::client_server_contract::client_server_contract::TiledPaneLay pane_initial_contents: layout.pane_initial_contents, default_fg: layout.default_fg, default_bg: layout.default_bg, + // no protobuf representation, same as default_fg/default_bg + children_arrangement: None, }) } } |
