Snap widgets to whole rows and let apps fill the cells beside them
Home rows now share one height (an app tile's) and widgets span whole rows of it, so they line up with the apps. The grid packs densely, so apps fill free cells next to a widget instead of leaving holes. Resizing snaps to whole rows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NYASJ6JNxhYwNNJK7ypK2V
This commit is contained in:
5 files changed
+40
-22
No files matched your search
+9
-1
@@ -115,7 +115,7 @@ const BASE = process.env.BASE || "http://localhost:8000";
|
||||
await p.mouse.up(); await settle();
|
||||
const [w1, h1] = await size();
|
||||
assert.ok(w1 < w0 && Math.abs(w1 - (2 * tile.width + 8)) < 3, `two columns wide: ${w1} (tile ${tile.width})`);
|
||||
assert.equal(h1, 250, "snapped to half rows");
|
||||
assert.equal(h1, Math.round(2 * tile.height + 20), "snapped to two whole rows of tiles");
|
||||
assert.ok(await p.$(".widget-slot.resizing"), "letting go of a handle keeps the handles");
|
||||
await p.click(".resize-bar >> text=Done"); await settle();
|
||||
assert.ok(!(await p.$(".resize-handle")));
|
||||
@@ -132,6 +132,14 @@ const BASE = process.env.BASE || "http://localhost:8000";
|
||||
await p.mouse.move(first.x + first.width / 2, first.y + first.height / 2, { steps: 8 }); await settle();
|
||||
await p.mouse.up(); await settle();
|
||||
assert.equal((await order())[0], "W", "dragged to the front");
|
||||
// the apps flow into the cells beside it: a 2x2 widget leaves room for all four
|
||||
const beside = await p.$eval(".widget-slot", (w) => {
|
||||
const r = w.getBoundingClientRect();
|
||||
return [...document.querySelectorAll(".slots .tile")].filter((t) => {
|
||||
const b = t.getBoundingClientRect(); return b.top >= r.top - 1 && b.bottom <= r.bottom + 1;
|
||||
}).length;
|
||||
});
|
||||
assert.equal(beside, 4, "apps fill the cells beside the widget");
|
||||
assert.ok(await p.$(".widget-slot.resizing"), "it keeps its handles after the move");
|
||||
assert.ok(!(await p.$(".sheet")));
|
||||
await p.click(".resize-bar >> text=Remove"); await settle();
|
||||
|
||||
Reference in new issue
Block a user