Add layout module: Tile | Float toggle widget for the panel
CI / test (push) Failing after 1m5s

Two-segment switch over the layout-control capability: click flips tiling <-> floating
(monocle goes to floating). Includes generated bindings and an updated wasm test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-25 00:39:32 -08:00
1 parent 82cac8a915
commit 95a21a0b84
16 files changed
+721 -12

No files matched your search

+13 -12
View File
@@ -118,7 +118,7 @@ test "task list module draws the host's windows and asks to focus one" {
}
///|
test "layout module shows the current mode, opens a popup and sets the layout" {
test "layout module is a tile/float toggle" {
let p = load_module("layout")
let t = Table::new()
for name in ["Tiling (BSP)", "Monocle", "Floating"] {
@@ -126,20 +126,21 @@ test "layout module shows the current mode, opens a popup and sets the layout" {
t.end_row()
}
publish(Layouts, t)
publish_state(1, false)
assert_true(texts_of(p.render(130, 36, test_tokens())).contains("Monocle"))
publish_state(0, false)
let labels = texts_of(p.render(120, 34, test_tokens()))
assert_true(labels.contains("Tile") && labels.contains("Float"))
assert_true(p.popup() is None)
// Tiling -> floating.
assert_true(p.on_event(false, PointerDown(5, 5)))
assert_eq(drain(), [SetLayout(2)])
// Floating -> tiling.
publish_state(2, false)
assert_true(p.on_event(false, PointerDown(5, 5)))
assert_eq(drain(), [SetLayout(0)])
// Monocle -> floating.
publish_state(1, false)
assert_true(p.on_event(false, PointerDown(5, 5)))
match p.popup() {
None => fail("popup should be open")
Some(ps) => {
assert_true(ps.w > 100 && ps.h > 80)
assert_true(texts_of(ps.ops).contains(" Floating"))
}
}
assert_true(p.on_event(true, PointerDown(20, 4 + 28 * 2 + 3)))
assert_eq(drain(), [SetLayout(2)])
assert_true(p.popup() is None)
p.unload()
}