Skip to content

layout: place-split-adaptive - #949

Merged
fizzy-pm[bot] merged 3 commits into
mainfrom
layout/place-split-adaptive
Oct 28, 2026
Merged

fizzy-pm[bot] merged 3 commits into
mainfrom
layout/place-split-adaptive

Conversation

@fizzy-linux

@fizzy-linux fizzy-linux Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Part of fizzyedit/work#543

Goal

The two placement commands the layout-placement design note asks for (work#543, item 4 of
work#312): layout.place.split, which makes two groups the way the room asks, and
layout.place.adaptive, which makes a person's split follow its room or stop. Both are in the
place menu and the palette, and the phone has a button for the split.

What changed and why

  • layout.place.split ("Place: Split"): splits the place along core.placement.orient(null, w, h)
    of its drawn size (bottom when tall, right when wide), then markAdaptive on the new half
    (Layout.splitAdaptive). No size floor beyond the layout's own, because the person asked.
  • layout.place.adaptive ("Place: Split Follows the Room"): toggles the split the place is one
    half of (Layout.setAdaptive). State.adaptiveOf decides which splits may toggle. A forest
    split may, and so may a seed-tree split made at runtime (a place on one side was minted from
    a place on the other). A split the shape declared may not, and neither may a fit or fixed
    one (Architect must-fix 1). On keeps the drawn size: the forest's share is taken again from
    the current extent, and the dock already sizes by ratio. Off keeps the drawn direction: a
    turned forest branch takes the turn into its side and extent, and the dock's dir becomes
    axis().
  • Region.settleTurn (Architect must-fix 2): a branch that stops being adaptive is flagged
    settle, and the next orientBranch drops what a turn left behind (_turned, _fold,
    _share, _set, _seen on the branch, _turned/_fold on the leaf). Without that, the
    place stayed shut, or never saved a drag again. loadRuntimeSplits flags each split it
    rebuilds, so a demo putting an arrangement back drops a turn from the split it replaces.
  • The menu lights the toggle while it is on. Anchors: region.menu.split:<place> and
    region.menu.adaptive:<place> (docs/AUTOMATION.md).
  • Phone: a split button in layout_mobile.zig's top strip (fizzy.mobile.split) runs
    layout.place.split on Main. It has a TODO(seam) naming plans#60's strip gesture and plans#109
    D11's split header.

How it was verified

New tests:

  • State: seed splits refuse (one with fixed, one plain), runtime dock splits toggle,
    including nested ones.
  • SplitTree: halfOf, and a turned-then-unmarked branch saves its new side, not adaptive.
  • Integration:
    • split stacks a tall place (Main/b1) and puts a wide one side by side (Main/r1),
      adaptive, with even halves.
    • adaptive on a person's 300-pt split keeps 300 and turns with the window. Off while turned,
      it stays stacked at the same size, and a later drag is saved.
    • off mid-fold opens back to its width.
    • refused on Main with no split. The menu shows Split, and shows the toggle only once there
      is a split; clicking the toggle turns it on and the menu stays open.
    • both commands are listed in the palette.
    • tapping the phone's fizzy.mobile.split at 390x844 makes an adaptive Main/b1.
  • The two settle tests fail with settleTurn turned off (300 vs 390: the drag is not saved;
    0 vs 585: the place stays shut).
  • Gates below. Headless only: no window was launched, so there is no screenshot or tape of the
    phone button. The integration test that taps it is the evidence.

Not done / follow-ups

  • plans#60's swipe on the strip and plans#109 D11's split header should call layout.place.split
    (the TODO(seam)). The note amendment the Architect listed (Who asks it, item 2: the ON/OFF
    rules, runtime-made splits only) is the PM's to commit.
  • No keymap default and no new keywords, as approved. No SDK change.
Changes (12 files, +490/-49)
 .github/known-failing-windows.txt |   2 +-
 app/layout/Layout.zig             |   4 +
 app/layout/Picker.zig             |  27 ++--
 app/layout/Region.zig             |  70 ++++++++++-
 app/layout/SplitTree.zig          |  48 ++++++++
 app/layout/State.zig              |  87 +++++++++++++
 app/layout/place_commands.zig     |   2 +
 core/widgets/ScrollArea.zig       |  36 ------
 docs/AUTOMATION.md                |   2 +-
 src/editor/Editor.zig             |   3 +
 src/editor/layout_mobile.zig      |   8 ++
 tests/integration.zig             | 250 ++++++++++++++++++++++++++++++++++++++
 12 files changed, 490 insertions(+), 49 deletions(-)
Gates: 6 of 6 passed

scripts/check-fmt.sh (exit 0)

check-fmt: listing tracked files
check-fmt: checking 566 files

scripts/zb build --summary all (exit 0)

... (earlier output omitted)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- options (reused)
|     +- translate-c dvui-c cached
|     |  +- compile exe translate-c debug native (+21 more reused dependencies)
|     +- options cached
|     +- options cached
+- install text cached
|  +- compile lib text debug native cached 13ms MaxRSS:39M
|     +- WriteFile plugin_root.zig cached
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- install markdown cached
|  +- compile lib markdown debug native cached 13ms MaxRSS:35M
|     +- WriteFile plugin_root.zig cached
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- options (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
|     +- translate-c (reused)
+- install image cached
   +- compile lib image debug native cached 13ms MaxRSS:38M
      +- WriteFile plugin_root.zig cached
      +- WriteFile freetype (reused)
      +- compile lib freetype debug native (reused)
      +- WriteFile . (reused)
      +- compile lib tree-sitter debug native (reused)
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- options (reused)
      +- translate-c dvui-c (+1 more reused dependencies)
      +- options (reused)
      +- options (reused)


scripts/zb build test --summary all (exit 0)

... (earlier output omitted)
      +- WriteFile freetype cached
      +- compile lib freetype debug native cached 12ms MaxRSS:38M
      +- WriteFile . cached
      +- compile lib tree-sitter debug native cached 9ms MaxRSS:36M
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- translate-c dvui-c cached
      |  +- compile exe translate-c debug native cached 7ms MaxRSS:39M
      |     +- options cached
      |     +- options cached
      |     +- options cached
      |     +- run exe generate-def (aarch64.zig) cached
      |     |  +- compile exe generate-def debug native cached 4ms MaxRSS:39M
      |     +- run exe generate-def (amdgcn.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (arm.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (bpf.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (common.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (hexagon.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (loongarch.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (mips.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (neon.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (nvptx.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (powerpc.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (riscv.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (s390x.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (ve.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (wasm.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (x86_64.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (x86.zig) cached
      |     |  +- compile exe generate-def debug native (reused)
      |     +- run exe generate-def (xcore.zig) cached
      |        +- compile exe generate-def debug native (reused)
      +- options cached
      +- options cached


scripts/zb build test-integration --summary all (exit 0)

... (earlier output omitted)
|     +- options (reused)
+- run test fizzy-plugin-loader-tests cached
|  +- compile test fizzy-plugin-loader-tests debug native cached 13ms MaxRSS:37M
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-text-plugin-tests cached
|  +- compile test fizzy-text-plugin-tests debug native cached 13ms MaxRSS:39M
|     +- options (reused)
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-dashboard-plugin-tests cached
|  +- compile test fizzy-dashboard-plugin-tests debug native cached 14ms MaxRSS:38M
|     +- options (reused)
|     +- WriteFile freetype (reused)
|     +- compile lib freetype debug native (reused)
|     +- WriteFile . (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- compile lib freetype debug native (reused)
|     +- compile lib tree-sitter debug native (reused)
|     +- translate-c dvui-c (+1 more reused dependencies)
|     +- options (reused)
|     +- options (reused)
+- run test fizzy-workbench-plugin-tests cached
   +- compile test fizzy-workbench-plugin-tests debug native cached 13ms MaxRSS:39M
      +- options (reused)
      +- options (reused)
      +- WriteFile freetype (reused)
      +- compile lib freetype debug native (reused)
      +- WriteFile . (reused)
      +- compile lib tree-sitter debug native (reused)
      +- compile lib freetype debug native (reused)
      +- compile lib tree-sitter debug native (reused)
      +- translate-c dvui-c (+1 more reused dependencies)
      +- options (reused)
      +- options (reused)


scripts/zb build check-web --summary all (exit 0)

... (earlier output omitted)
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (arm.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (bpf.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (common.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (hexagon.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (loongarch.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (mips.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (neon.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (nvptx.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (powerpc.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (riscv.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (s390x.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (ve.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (wasm.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (x86_64.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (x86.zig) cached
|  |     |  +- compile exe generate-def debug native (reused)
|  |     +- run exe generate-def (xcore.zig) cached
|  |        +- compile exe generate-def debug native (reused)
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- options cached
|  +- translate-c cached 4ms MaxRSS:34M
+- compile obj rehome-fixture-web debug wasm32-freestanding cached 6ms MaxRSS:39M
   +- translate-c dvui-c (+1 more reused dependencies)
   +- options (reused)
   +- options (reused)


scripts/zb build test-sdk-version --summary all (exit 0)

... (earlier output omitted)
   +- WriteFile . cached
   +- compile lib tree-sitter debug native cached 10ms MaxRSS:33M
   +- compile lib freetype debug native (reused)
   +- compile lib tree-sitter debug native (reused)
   +- options cached
   +- options cached
   +- translate-c dvui-c cached
   |  +- compile exe translate-c debug native cached 5ms MaxRSS:39M
   |     +- options cached
   |     +- options cached
   |     +- options cached
   |     +- run exe generate-def (aarch64.zig) cached
   |     |  +- compile exe generate-def debug native cached 5ms MaxRSS:34M
   |     +- run exe generate-def (amdgcn.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (arm.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (bpf.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (common.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (hexagon.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (loongarch.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (mips.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (neon.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (nvptx.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (powerpc.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (riscv.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (s390x.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (ve.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (wasm.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (x86_64.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (x86.zig) cached
   |     |  +- compile exe generate-def debug native (reused)
   |     +- run exe generate-def (xcore.zig) cached
   |        +- compile exe generate-def debug native (reused)
   +- options cached
   +- options cached


`layout.place.split` splits a place along `core.placement.orient` of its
drawn size (stacked when tall, side by side when wide), the new half
trailing, and marks the split adaptive. `layout.place.adaptive` toggles
whether the split a place is one half of follows its room: only splits
made at runtime (the forest's, or a seed tree's made by `splitDock`),
never one the shape declared or one sized by `fit`/`fixed`. On keeps
the drawn size as the share; off keeps the drawn direction, and a turn
under way settles (`Region.settleTurn`), as does a split rebuilt from a
saved arrangement. Both are in the place menu and the palette; the
phone's top strip has a split button that runs `layout.place.split`.

Part of fizzyedit/work#543

Agent-Team: linux
Worker: claude
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fizzy-pm

fizzy-pm Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

PM note: how this PR will be handled

What it is for: layout: place-split-adaptive
Issue #543: layout: layout.place.split and layout.place.adaptive commands (from #312 item 4)
Done when (from the issue): tests that bite: split and adaptive produce the expected arrangement from a fixture; the commands appear in the palette; a tape or screenshot of the phone gesture.

Rules that apply: none special.
Reviews needed: 1, from any other team or kind.
Needs the maintainer's explicit yes before merge: no

Things to watch (checked by rule):

  • the body names its work issue (Part of fizzyedit/work#N)
  • size within 800 lines outside tests and docs (249)
  • a gates section with what was run

What happens next:

  1. Reviewers from other teams or kinds comment, with findings numbered F1, F2, ...
  2. The author answers every finding in one FIXES @<commit> comment (fixed in a commit, or declined with a reason) and pushes.
  3. Reviewers re-review the new commit on their own.
  4. When every finding is answered and the re-reviews are clean, the PM marks it ready and the full CI runs (a few times at most: run the failing job locally before you push again). Only when CI passes does the PM look, and the PM gives the final okay.

A living status comment below is kept current. Nothing here is a merge decision.

@fizzy-pm

fizzy-pm Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Where this PR stands

Stage: Author's turn
Next: Author should fix the 3 open findings (reply to each in a FIXES comment), then push

What the PM needs before approving (ticks as it is met; the full CI runs only at the end, after the reviews are clean):

  • The body names its basis (Part of fizzyedit/work#N or a plan step)
  • Within the size limit: 249 of 800 lines outside tests and docs
  • The body shows which gates the author ran
  • No open findings at this commit (3 open)
  • Every earlier finding was answered in a FIXES comment
  • Clean reviews at this commit from 1 kind: windows/claude (has 1)
  • Marked ready, which starts the full CI (the PM does this the moment the items above are met)
  • The full CI passes at this commit (CI is green)
  • The PM's final okay (pm-approval)

Reviews at the current commit (3ebcc16):

Reviewer Verdict Findings
windows/agy changes 3
windows/claude clean 3

Updated 2026-10-28 07:08 UTC by the PM. This comment is edited in place.

fizzy-linux Bot and others added 2 commits October 27, 2026 21:43
Part of fizzyedit/work#543

Agent-Team: linux
Worker: claude
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of fizzyedit/work#543

Agent-Team: linux
Worker: claude
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fizzy-pm fizzy-pm Bot added pm:review one assigned reviewer reviews reviewer:windows-claude the PM assigned windows/claude to review this PR labels Oct 28, 2026
@fizzy-windows fizzy-windows Bot added reviewing:windows-claude a windows/claude review is running reviewing:windows-agy a windows/agy review is running and removed reviewing:windows-agy a windows/agy review is running reviewing:windows-claude a windows/claude review is running labels Oct 28, 2026
@fizzy-pm
fizzy-pm Bot marked this pull request as ready for review October 28, 2026 06:12
@fizzy-pm fizzy-pm Bot added pm:approve PM approval, CI, merge queue and removed pm:review one assigned reviewer reviews reviewer:windows-claude the PM assigned windows/claude to review this PR pm:approve PM approval, CI, merge queue labels Oct 28, 2026
@fizzy-pm
fizzy-pm Bot added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 32c4da7 Oct 28, 2026
31 checks passed
@fizzy-pm
fizzy-pm Bot deleted the layout/place-split-adaptive branch October 28, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants