diff --git a/tests/e2e.cjs b/tests/e2e.cjs index fe6d257..bd27f25 100644 --- a/tests/e2e.cjs +++ b/tests/e2e.cjs @@ -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, 2 * 64 + 8, "snapped to two whole rows of tiles"); + assert.equal(h1, 2 * 60 + 8, "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,7 +132,7 @@ 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 in 5 columns leaves room for all four + // 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) => { diff --git a/web/app.py b/web/app.py index 34da9d8..f201c6f 100644 --- a/web/app.py +++ b/web/app.py @@ -629,7 +629,7 @@ def view_resize_bar() -> None: def widget_rows(h: i32) -> i32: """Rows of app tiles nearest to a widget height in CSS px, at least one.""" - k: i32 = (h + 8 + 36) // 72 + k: i32 = (h + 8 + 34) // 68 if k < 1: k = 1 return k @@ -644,7 +644,7 @@ def view_home_slot(i: i32) -> None: cls_if("lifted", i == lifted) cls_if("resizing", i == resizing) attr_num("data-slot", i) - # Its height spans whole rows of app tiles (64px rows, 8px gaps; style.css). + # Its height spans whole rows of app tiles (60px rows, 8px gaps; style.css). s_set(scratch, "grid-row:span ") s_add_num(scratch, widget_rows(hh[i])) if hw[i] > 0: diff --git a/web/app.wasm b/web/app.wasm index 3678329..ea63b38 100644 Binary files a/web/app.wasm and b/web/app.wasm differ diff --git a/web/style.css b/web/style.css index 9892a0d..0b1e363 100644 --- a/web/style.css +++ b/web/style.css @@ -36,10 +36,10 @@ body { margin: 0; min-height: 100vh; color: #fff; -webkit-tap-highlight-color: t all one height, so a widget spans whole rows of app tiles, and apps fill the cells beside a widget rather than leaving holes (dense packing). Keep the row height and row gap in sync with widget_rows in app.py. */ -.slots { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 4rem; row-gap: .5rem; +.slots { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 3.75rem; row-gap: .5rem; grid-auto-flow: row dense; } @media (min-width: 480px) { .apps { grid-template-columns: repeat(5, minmax(0, 1fr)); } - .slots { grid-template-columns: repeat(6, minmax(0, 1fr)); } } + .slots { grid-template-columns: repeat(7, minmax(0, 1fr)); } } .tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .35rem .15rem; border-radius: calc(var(--radius) + 4px); cursor: pointer; } .tile:active { background: rgb(255 255 255 / .12); } @@ -49,8 +49,8 @@ body { margin: 0; min-height: 100vh; color: #fff; -webkit-tap-highlight-color: t .name { max-width: 100%; font-size: .75rem; line-height: 1.2; text-align: center; text-shadow: var(--shadow-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .slots .tile { gap: .25rem; padding: .2rem .1rem; } -.slots .icon { width: 2.5rem; height: 2.5rem; } -.slots .name { font-size: .68rem; } +.slots .icon { width: 2.25rem; height: 2.25rem; } +.slots .name { font-size: .64rem; } /* A widget takes whole rows. On a phone the native widget view covers the slot; the label only shows while the slot is not live (or in a desktop browser). */