Fit more rows on one screen: 64px rows, 8px gaps, tighter top
Home rows shrink to 64px with 8px gaps and 40px icons, and the space above and below the Windows panel is trimmed, so about two more rows of apps fit on a phone screen. widget_rows and the resize test follow the new 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:
4 files changed
+11
-11
No files matched your search
+2
-2
@@ -111,11 +111,11 @@ const BASE = process.env.BASE || "http://localhost:8000";
|
|||||||
await p.mouse.move(hd.x + hd.width / 2, hd.y + hd.height / 2);
|
await p.mouse.move(hd.x + hd.width / 2, hd.y + hd.height / 2);
|
||||||
await p.mouse.down();
|
await p.mouse.down();
|
||||||
const ws = await p.locator(".widget-slot").boundingBox();
|
const ws = await p.locator(".widget-slot").boundingBox();
|
||||||
await p.mouse.move(ws.x + tile.width * 2.1, ws.y + 175, { steps: 8 }); await settle();
|
await p.mouse.move(ws.x + tile.width * 2.1, ws.y + 140, { steps: 8 }); await settle();
|
||||||
await p.mouse.up(); await settle();
|
await p.mouse.up(); await settle();
|
||||||
const [w1, h1] = await size();
|
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.ok(w1 < w0 && Math.abs(w1 - (2 * tile.width + 8)) < 3, `two columns wide: ${w1} (tile ${tile.width})`);
|
||||||
assert.equal(h1, 2 * 72 + 12, "snapped to two whole rows of tiles");
|
assert.equal(h1, 2 * 64 + 8, "snapped to two whole rows of tiles");
|
||||||
assert.ok(await p.$(".widget-slot.resizing"), "letting go of a handle keeps the handles");
|
assert.ok(await p.$(".widget-slot.resizing"), "letting go of a handle keeps the handles");
|
||||||
await p.click(".resize-bar >> text=Done"); await settle();
|
await p.click(".resize-bar >> text=Done"); await settle();
|
||||||
assert.ok(!(await p.$(".resize-handle")));
|
assert.ok(!(await p.$(".resize-handle")));
|
||||||
|
|||||||
+2
-2
@@ -629,7 +629,7 @@ def view_resize_bar() -> None:
|
|||||||
|
|
||||||
def widget_rows(h: i32) -> i32:
|
def widget_rows(h: i32) -> i32:
|
||||||
"""Rows of app tiles nearest to a widget height in CSS px, at least one."""
|
"""Rows of app tiles nearest to a widget height in CSS px, at least one."""
|
||||||
k: i32 = (h + 12 + 42) // 84
|
k: i32 = (h + 8 + 36) // 72
|
||||||
if k < 1:
|
if k < 1:
|
||||||
k = 1
|
k = 1
|
||||||
return k
|
return k
|
||||||
@@ -644,7 +644,7 @@ def view_home_slot(i: i32) -> None:
|
|||||||
cls_if("lifted", i == lifted)
|
cls_if("lifted", i == lifted)
|
||||||
cls_if("resizing", i == resizing)
|
cls_if("resizing", i == resizing)
|
||||||
attr_num("data-slot", i)
|
attr_num("data-slot", i)
|
||||||
# Its height spans whole rows of app tiles (72px rows, 12px gaps; style.css).
|
# Its height spans whole rows of app tiles (64px rows, 8px gaps; style.css).
|
||||||
s_set(scratch, "grid-row:span ")
|
s_set(scratch, "grid-row:span ")
|
||||||
s_add_num(scratch, widget_rows(hh[i]))
|
s_add_num(scratch, widget_rows(hh[i]))
|
||||||
if hw[i] > 0:
|
if hw[i] > 0:
|
||||||
|
|||||||
Binary file not shown.
+7
-7
@@ -15,17 +15,17 @@ body { margin: 0; min-height: 100vh; color: #fff; -webkit-tap-highlight-color: t
|
|||||||
|
|
||||||
/* ---- home */
|
/* ---- home */
|
||||||
.home { min-height: 100vh; box-sizing: border-box;
|
.home { min-height: 100vh; box-sizing: border-box;
|
||||||
padding: calc(var(--top) + 2.5rem) 16px calc(var(--bottom) + 2rem); }
|
padding: calc(var(--top) + 2rem) 16px calc(var(--bottom) + 1.5rem); }
|
||||||
.pull { position: fixed; top: calc(var(--top) + .4rem); left: 50%; transform: translateX(-50%);
|
.pull { position: fixed; top: calc(var(--top) + .4rem); left: 50%; transform: translateX(-50%);
|
||||||
width: 3rem; height: 1.25rem; padding: 0; border: 0; background: none; cursor: pointer; }
|
width: 3rem; height: 1.25rem; padding: 0; border: 0; background: none; cursor: pointer; }
|
||||||
.pull::before { content: ""; display: block; width: 2.25rem; height: .3rem; margin: auto;
|
.pull::before { content: ""; display: block; width: 2.25rem; height: .3rem; margin: auto;
|
||||||
border-radius: 999px; background: rgb(255 255 255 / .45); }
|
border-radius: 999px; background: rgb(255 255 255 / .45); }
|
||||||
|
|
||||||
.panel { display: flex; gap: .5rem; margin: 0 auto 2rem; padding: .5rem; max-width: 22rem;
|
.panel { display: flex; gap: .5rem; margin: 0 auto 1rem; padding: .4rem; max-width: 22rem;
|
||||||
border-radius: 1.25rem; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16);
|
border-radius: 1.25rem; background: rgb(255 255 255 / .12); border: 1px solid rgb(255 255 255 / .16);
|
||||||
backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
|
backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
|
||||||
.panel-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: .6rem;
|
.panel-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: .6rem;
|
||||||
min-height: 3rem; padding: .5rem 1rem; border: 0; border-radius: .9rem;
|
min-height: 2.5rem; padding: .4rem 1rem; border: 0; border-radius: .9rem;
|
||||||
background: rgb(255 255 255 / .1); color: #fff; font: inherit; font-weight: 500;
|
background: rgb(255 255 255 / .1); color: #fff; font: inherit; font-weight: 500;
|
||||||
cursor: pointer; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
|
cursor: pointer; text-shadow: 0 1px 4px rgb(0 0 0 / .35); }
|
||||||
.panel-btn:hover, .panel-btn:active { background: rgb(255 255 255 / .22); }
|
.panel-btn:hover, .panel-btn:active { background: rgb(255 255 255 / .22); }
|
||||||
@@ -40,7 +40,7 @@ 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
|
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
|
beside a widget rather than leaving holes (dense packing). Keep the row height and
|
||||||
row gap in sync with widget_rows in app.py. */
|
row gap in sync with widget_rows in app.py. */
|
||||||
.slots { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 4.5rem; row-gap: .75rem;
|
.slots { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: 4rem; row-gap: .5rem;
|
||||||
grid-auto-flow: row dense; }
|
grid-auto-flow: row dense; }
|
||||||
@media (min-width: 480px) { .apps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
|
@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(6, minmax(0, 1fr)); } }
|
||||||
@@ -52,9 +52,9 @@ body { margin: 0; min-height: 100vh; color: #fff; -webkit-tap-highlight-color: t
|
|||||||
.icon.missing { border-radius: 999px; background: rgb(255 255 255 / .18); object-position: -999px 0; }
|
.icon.missing { border-radius: 999px; background: rgb(255 255 255 / .18); object-position: -999px 0; }
|
||||||
.name { max-width: 100%; font-size: .75rem; line-height: 1.2; text-align: center;
|
.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; }
|
text-shadow: var(--shadow-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
.slots .tile { gap: .3rem; padding: .25rem .1rem; }
|
.slots .tile { gap: .25rem; padding: .2rem .1rem; }
|
||||||
.slots .icon { width: 2.75rem; height: 2.75rem; }
|
.slots .icon { width: 2.5rem; height: 2.5rem; }
|
||||||
.slots .name { font-size: .7rem; }
|
.slots .name { font-size: .68rem; }
|
||||||
|
|
||||||
/* A widget takes whole rows. On a phone the native widget view covers the slot;
|
/* 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). */
|
the label only shows while the slot is not live (or in a desktop browser). */
|
||||||
|
|||||||
Reference in new issue
Block a user