Let a widget be dragged onto any row, including the top
Dragging a widget over apps used to move it in the order, but a wide widget can't fit beside earlier apps, so the packed flow kept pushing it below them. A widget now always goes to the cell under it (MOVE_CELL) and the apps flow around it; apps still reorder by dragging over each other. 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:
2 files changed
+11
-5
No files matched your search
+6
-3
@@ -147,15 +147,18 @@ const BASE = process.env.BASE || "http://localhost:8000";
|
||||
assert.deepEqual(await size(), [w1, h1], "the size is saved");
|
||||
// while it shows handles, dragging the widget itself moves it, without another long press
|
||||
await longpress(".widget-slot");
|
||||
const order = () => p.$$eval(".slots > li", (ls) => ls.map((l) => l.classList.contains("widget-slot") ? "W" : "a"));
|
||||
assert.notEqual((await order())[0], "W");
|
||||
const atStart = () => p.$eval(".widget-slot", (w) => {
|
||||
const r = w.getBoundingClientRect(), s = w.parentElement.getBoundingClientRect();
|
||||
return Math.abs(r.left - s.left) < 2 && Math.abs(r.top - s.top) < 2;
|
||||
});
|
||||
assert.ok(!(await atStart()));
|
||||
const wb = await p.locator(".widget-slot").boundingBox(), first = await p.locator(".slots > li").first().boundingBox();
|
||||
await p.mouse.move(wb.x + wb.width / 2, wb.y + wb.height / 2);
|
||||
await p.mouse.down(); await settle();
|
||||
assert.ok(await p.$(".widget-slot.lifted"), "pressing a widget with handles picks it up");
|
||||
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");
|
||||
assert.ok(await atStart(), "dragged onto the top row, first cell");
|
||||
// the apps flow into the cells beside it: a 2x2 widget in 5 columns leaves room for all four
|
||||
const beside = await p.$eval(".widget-slot", (w) => {
|
||||
const r = w.getBoundingClientRect();
|
||||
|
||||
Reference in new issue
Block a user