aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-20 23:53:43 +0200
committeruser <user@clank>2026-08-20 23:53:43 +0200
commit64db2051192a6a6f5a9333f503d14b1ccccd699d (patch)
treef14bdeee8ccbe6f413e20cf2b746ec16f4414ee1 /docs
parentslosh: fold floating panes and the drop grammar into DESIGN.md (diff)
downloadslosh-64db2051192a6a6f5a9333f503d14b1ccccd699d.tar.gz
slosh-64db2051192a6a6f5a9333f503d14b1ccccd699d.tar.xz
slosh-64db2051192a6a6f5a9333f503d14b1ccccd699d.zip
slosh: M10c, the memory -- floats survive being written down
A dumped session quietly re-tiled its floats, which was the one data-loss gap left in D22. dump-layout now records `floating=true x= y= w= h=` -- the *wanted* rect, because intent is what survives a session and the next screen's layout clamps it like any frame -- layout files declare the same (linted: floating is a bool, x/y/w/h mean nothing without it), and a file whose every pane floats self-heals through ensure_tiled: the top float lands, the same rule closing the last tiled pane follows, no lint required. save-workspace inherits all of it from the shared dumper. `float` over the API takes x/y/w/h and then *places* rather than toggles -- a placement is a statement about where, not about whether -- floating the pane first when it is tiled, re-placing when it already floats, with omitted fields meaning "keep". The intent is stored exactly as asked: the write-back rule is for hands, whose drags need the clamp to agree with the eye; a script means what it typed. And kitty graphics respect the stack. The cell compositor gets occlusion free from paint order, but placements are sent after the diff and would paint an image straight over a float covering it. Each pane's placements are now clipped by the float rects above it -- every float for a tiled pane, the higher-raised for a float -- cropping what one clean edge can express (the pane-edge source-rectangle arithmetic aimed at another clipper, including from the top and left, where the source origin moves and the sub-cell offset is consumed) and suppressing what it cannot: a strip across the middle or a corner overlap leaves a shape one placement cannot say, and the image returns whole when the float moves. No z= needed -- clipping is the z-order, since nothing is ever allowed to overlap. D22's "still owed" paragraph is paid and rewritten; M10 is fully checked.
Diffstat (limited to 'docs')
-rw-r--r--docs/layouts.md6
-rw-r--r--docs/panes.md15
-rw-r--r--docs/scripting.md2
3 files changed, 20 insertions, 3 deletions
diff --git a/docs/layouts.md b/docs/layouts.md
index 9f7eabb..cdb57a0 100644
--- a/docs/layouts.md
+++ b/docs/layouts.md
@@ -96,6 +96,12 @@ which file is which.
checked-out projects are not twelve running dev servers. The pane shows what it
*would* run.
- `focus=true` — the pane you start in, within its tab.
+- `floating=true` — the pane starts [floating](panes.md#floating-a-pane), with
+ `x=` `y=` `w=` `h=` as its wanted rect in cells (absent, it takes the centred
+ default). The rect is intent: a smaller screen clamps it, and the place you
+ asked for survives. It still holds a seat in the tree — its `weight=` and
+ position are where un-floating lands it. A file whose every pane floats
+ lands one as the backdrop, because an overlay needs something to be over.
- `purpose=` — a label for tooling; see below.
**A relative `cwd=` in a layout *file* resolves against that file's own
diff --git a/docs/panes.md b/docs/panes.md
index d0a6eb3..ac5d242 100644
--- a/docs/panes.md
+++ b/docs/panes.md
@@ -127,9 +127,18 @@ like any shell, and un-floating lands it beside the pane it was opened over.
it comes back floating; zooming fills the tab and returns it on the way
out. The last tiled pane cannot float — an overlay needs something to be
over — and closing the last tiled pane lands the float in its place.
-- Its rect is not yet written by `dump-layout` (coming with the layout-file
- support); `{"cmd":"float","id":N}` toggles one and `{"cmd":"new-float"}`
- opens one from a [script](scripting.md).
+- **It survives being written down.** `dump-layout` and
+ [`save-workspace`](workspaces.md) record `floating=true x= y= w= h=` — the
+ *wanted* rect, which the next screen's layout clamps like any frame — and a
+ [layout file](layouts.md) can declare the same. From a
+ [script](scripting.md), `{"cmd":"float","id":N}` toggles,
+ `{"cmd":"float","id":N,"x":10,"y":5,"w":40,"h":12}` places (floats first
+ if tiled, re-places if floating; omitted fields mean "keep"), and
+ `{"cmd":"new-float"}` opens one.
+- **Images know their place.** A kitty-graphics picture in a pane a float
+ covers is cropped at the float's edge, or not drawn while the float sits
+ across its middle — a placement is one rectangle, and it must not paint
+ over what covers it.
## Links
diff --git a/docs/scripting.md b/docs/scripting.md
index 0074782..193f46a 100644
--- a/docs/scripting.md
+++ b/docs/scripting.md
@@ -33,6 +33,8 @@ Panes and tabs are addressed by **id**, so a background tab is scriptable.
| `new-tab` `select-tab` `close-tab` `move-tab` `set-name` | tabs, by `id` or `index` |
| `set-name target="pane"` | a pane's name, which outranks the title its program sets |
| `move-pane` | `id` of the pane, `tab` id to move it into (`0` for a tab of its own, with an optional `name`), `dir:"cols"\|"rows"`. The pane keeps running — same pty, same scrollback |
+| `float` | bare: toggle a pane [floating](panes.md#floating-a-pane) (`id`, or 0 for the focused one). With any of `x` `y` `w` `h` it *places*: floats first when tiled, re-places when floating, never un-floats; omitted fields keep their value |
+| `new-float` | a fresh floating shell over the current tab, centred, in the focused pane's directory; answers `id` |
| `set-name` | `target:"tab"` (the default, because that is what this verb has always meant) or `"pane"`, `id`, `name`. A pane accepts 0 for the focused one. A pane's name wins over the title the program sets, so this is how a program that keeps announcing something stale gets overruled; an empty `name` clears it and hands the label back. Refusals say `no such pane` or `no such tab`, so a mistyped target is visible in the reply |
| `set-purpose` | `target:"pane"\|"tab"`, `id` (or 0 for the focused pane, and the tab you are in), `purpose`. An empty `purpose` clears the slot *and* unlocks it, handing the label back to the program — a lock held over an empty string was a state nothing could get out of |
| `dump-layout` `apply-layout` | see [layouts](layouts.md). `dump-layout` takes `tab` (0 for every tab), `relative_to` to write every `cwd=` under that directory instead of absolute, and `suspend` (`as-is` `none` `commands` `all`); it answers `kdl` `panes` `suspended`, and an unknown `tab` is an error rather than an empty document |