aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_layout.py
diff options
context:
space:
mode:
authorsl0p <sl0p@sl0p.foo>2026-08-13 23:34:23 +0200
committersl0p <sl0p@sl0p.foo>2026-08-13 23:34:23 +0200
commit9158b04ffdb15d2b163ffda81c82509a5c2ea00b (patch)
treec26a94e11ba66f744666dfd8f518cea9756f4d88 /tests/test_layout.py
parentsl0ptty: M7 — layout files and suspended panes (diff)
downloadslosh-9158b04ffdb15d2b163ffda81c82509a5c2ea00b.tar.gz
slosh-9158b04ffdb15d2b163ffda81c82509a5c2ea00b.tar.xz
slosh-9158b04ffdb15d2b163ffda81c82509a5c2ea00b.zip
sl0ptty: M8 — pane sizes as weights, resize and drag-to-reorder
Sizes are weights now, so an even split is equal weights and resizing is not a special case of anything: the layout pass is still the same pure function of the tree and the rect, and a resized layout survives a collapse/expand cycle without anyone writing code for that. Keyboard: C-a shift-H/J/K/L (and shift+arrows) move the boundary in the direction pressed, whichever side of it the focused pane is on, which is what a person means by wider. A pane can be squeezed but never squeezed out. Mouse: one drag machine, two verbs, both starting from the hit list so neither can disagree with what is on screen. - a frame's top row is a drag handle: drop a pane on another to swap them, with the drop target highlighted while you drag; - the gap between two panes is the boundary: drag it to resize. The gap was dead space until now, and its hit rect is derived from the rects the children were just given rather than recomputed from the config — the same rule that keeps the split button honest. Any keystroke ends a drag. A release can go missing (the pointer leaves the terminal, a client detaches mid-drag) and a mouse wedged in a state the user cannot see is the worst outcome available. One test needed updating rather than the code: the frame's top row is now the drag handle, so the cell beside the split button reports title: rather than focus:. That is the intent, and the hit list said so immediately. 304 checks green (277 headless + 27 live).
Diffstat (limited to 'tests/test_layout.py')
-rw-r--r--tests/test_layout.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/test_layout.py b/tests/test_layout.py
index 083ec97..97744d3 100644
--- a/tests/test_layout.py
+++ b/tests/test_layout.py
@@ -162,8 +162,9 @@ def test_hit_list():
x, y = pos
check("the click target is exactly where the glyph is",
snap.hit_at(x, y) == f"split:{pane['id']}", str(snap.hit_at(x, y)))
+ # the rest of the top row is the drag handle, not the button
check("beside the button is not the button",
- snap.hit_at(x - 1, y) == f"focus:{pane['id']}",
+ snap.hit_at(x - 1, y) == f"title:{pane['id']}",
str(snap.hit_at(x - 1, y)))
s.click(x, y)