aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-09 20:49:18 +0200
committeruser <user@clank>2026-09-09 20:49:18 +0200
commit2d006fdc97df7eecde0f49f94f24e096bcdebe28 (patch)
treeb0e45b3b4d2828ab119d645fed2350004909a9c5 /tests
parentpane: shift consumed by the character is consumed, tell the encoder (diff)
downloadslosh-2d006fdc97df7eecde0f49f94f24e096bcdebe28.tar.gz
slosh-2d006fdc97df7eecde0f49f94f24e096bcdebe28.tar.xz
slosh-2d006fdc97df7eecde0f49f94f24e096bcdebe28.zip
compact: the minimised bar sits below a shared line, not on the border
A compact pane owns no border cells -- its bottom border is the shared line one cell outside its rect. With panes minimised, that cell was the bar's top row: the chips sat directly on the bottom panes' content, reading as frames cut into the pane. Classic panes carry their own border row and never collided. The layout now reserves one extra row above the bar in compact, and draw_compact_lines strokes the boundary there: it joins the outer ring with real junctions, a divider from above ends into it, and a focused bottom pane re-strokes its stretch like any shared line.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_compact.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/test_compact.py b/tests/test_compact.py
index 4d15131..c1217dc 100644
--- a/tests/test_compact.py
+++ b/tests/test_compact.py
@@ -300,6 +300,48 @@ def test_compact_float_keeps_the_classic_frame():
s.settle(30)
+def test_compact_min_bar_sits_below_a_shared_line():
+ """The minimised bar and the bottom panes share no border row. A compact
+ pane's bottom border is the shared line one cell outside its rect; the
+ layout reserves that row above the bar and draw_compact_lines strokes it,
+ ring junctions included. Without it the chips sat directly on the panes'
+ content -- "the minimised rectangles overlap the bottom pane's border"."""
+ with Session(SH, cols=90, rows=24, config=COMPACT) as s:
+ s.settle(30)
+ s.key("\\\\")
+ s.settle(30)
+ s.key("-")
+ s.settle(30)
+ s.key("m")
+ s.settle(30)
+ snap = s.snapshot()
+ bar = min(
+ (h for h in snap.hits if h["action"].startswith("focus:") and h["h"] == 3),
+ key=lambda h: h["y"],
+ default=None,
+ )
+ check("a chip is in the hit list", bar is not None, str(snap.hits))
+ if not bar:
+ return
+ line = snap.line(bar["y"] - 1)
+ check(
+ "the row above the chips is the panes' bottom border",
+ line.startswith("\u251c") and line.rstrip().endswith("\u2524"),
+ repr(line),
+ )
+ check(
+ "the divider from above ends into it as a junction",
+ "\u2534" in line,
+ repr(line),
+ )
+ low = max(p["y"] + p["h"] for p in s.panes() if p["h"])
+ check(
+ "no pane reaches the line's row",
+ low <= bar["y"] - 1,
+ f"panes end {low}, line at {bar['y'] - 1}",
+ )
+
+
def test_compact_is_a_config_key():
import subprocess
@@ -334,5 +376,6 @@ if __name__ == "__main__":
test_compact_focus_ring_wears_the_frame_colour()
test_compact_dead_pane_epitaph_overlays_the_last_row()
test_compact_float_keeps_the_classic_frame()
+ test_compact_min_bar_sits_below_a_shared_line()
test_compact_is_a_config_key()
sys.exit(report())