Mobile pass: a top bar that stays put, a menu that scrolls, room for notches

On phones the top bar is now sticky and compact with a 44 px menu button, an
open menu scrolls by itself with finger-sized rows, the page asks for the whole
screen (viewport-fit=cover) and keeps toasts, drawers and the bar clear of the
notch and home bar, text is slightly larger on small screens, toasts and
drawers use the full width, and presses do not wait for a second tap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-12 22:18:59 +01:00
1 parent 645816d5a8
commit 5750350565
4 files changed
+166 -1

No files matched your search

+2
View File
@@ -913,6 +913,8 @@ exists; it can be hidden, and brought back from the search box.
**Proxmox snapshots.** Click a guest on Infrastructure → Proxmox and its drawer has a **Snapshots** section: what there is (oldest first, a branch indented, *with memory* marked), **Take a snapshot** for operators (a name or one from the time, a description, and for a running VM whether to keep its memory), and **Roll back…** and **Delete…** for administrators, each behind a confirmation that says what is lost. Proxmox does each as a task, followed for up to 20 seconds; each is in the audit log and the change log. The API token needs VM.Snapshot and VM.Snapshot.Rollback (the PVEVMAdmin role has them). The guest actions (start, shut down, restart, stop) were there already. **Proxmox snapshots.** Click a guest on Infrastructure → Proxmox and its drawer has a **Snapshots** section: what there is (oldest first, a branch indented, *with memory* marked), **Take a snapshot** for operators (a name or one from the time, a description, and for a running VM whether to keep its memory), and **Roll back…** and **Delete…** for administrators, each behind a confirmation that says what is lost. Proxmox does each as a task, followed for up to 20 seconds; each is in the audit log and the change log. The API token needs VM.Snapshot and VM.Snapshot.Rollback (the PVEVMAdmin role has them). The guest actions (start, shut down, restart, stop) were there already.
**On a phone.** Below desktop width the top bar (logo and menu button) stays at the top of the screen so the menu is always within reach, with a menu button of at least 44 px; an open menu scrolls by itself (it no longer pushes the page down), its rows are finger-sized and the favourite stars are always visible; text is a little larger on a small screen, toasts run across the width and drawers fill it. The page asks for the whole screen (`viewport-fit=cover`) and keeps clear of the notch, the rounded corners and the home bar, which matters when it is installed to the home screen (the status bar then sits over the app). Tables turn into stacked cards, form fields are 16 px so a phone does not zoom in on them, and what is pressed does not wait for a second tap. Checked at 375 px: no page scrolls sideways.
**Swedish interface.** Press *Svenska* under *Language* in the user menu and the whole screen is drawn again in Swedish at once; the choice is kept on your account and follows you to any browser (without a choice the browser's language decides, and that guess is not stored). Swedish covers the menu, the shared parts (search, tables, dialogs, "5 min ago"), the sign-in page, and the headings, buttons, table columns, filters and messages of the pages used every day — Dashboard, Alerts, Servers, Updates, Maintenance, My work, Coming up, To do, Integrations and Settings → Display. Text with no Swedish yet is shown in English, so nothing looks broken. Not yet translated: what the server writes (alert messages, notifications, digests, reports, e-mail), the long page introductions and the less-used pages. How to add more is in docs/LANGUAGES.md. **Swedish interface.** Press *Svenska* under *Language* in the user menu and the whole screen is drawn again in Swedish at once; the choice is kept on your account and follows you to any browser (without a choice the browser's language decides, and that guess is not stored). Swedish covers the menu, the shared parts (search, tables, dialogs, "5 min ago"), the sign-in page, and the headings, buttons, table columns, filters and messages of the pages used every day — Dashboard, Alerts, Servers, Updates, Maintenance, My work, Coming up, To do, Integrations and Settings → Display. Text with no Swedish yet is shown in English, so nothing looks broken. Not yet translated: what the server writes (alert messages, notifications, digests, reports, e-mail), the long page introductions and the less-used pages. How to add more is in docs/LANGUAGES.md.
**Accessibility.** There is a skip-to-content link, labelled landmarks, visible **Accessibility.** There is a skip-to-content link, labelled landmarks, visible
+60
View File
@@ -0,0 +1,60 @@
/**
* What the phone layout depends on, read from the page and its style sheet: the page asks for the whole screen (so the notch and the home bar can be left clear), the top bar stays put and has a
* menu button that can be hit, an open menu scrolls by itself, and the rows in it are finger-sized.
*
* Run with: npm test --workspace server
*/
import { test, describe } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const web = (...p: string[]) => readFileSync(new URL(`../../web/${p.join("/")}`, import.meta.url), "utf8");
const html = web("index.html");
const css = web("src", "styles.css");
/** The body of the first rule block that starts with `selector` inside the narrowest "phone" media query we wrote last. */
const phoneBlock = css.slice(css.lastIndexOf("@media (max-width: 991.98px) {\n .navbar-vertical {"));
describe("the page asks for the whole screen and the app leaves room", () => {
test("viewport-fit=cover, and a status bar that sits over the app (which keeps clear of it)", () => {
assert.match(html, /<meta name="viewport" content="[^"]*viewport-fit=cover/);
assert.match(html, /apple-mobile-web-app-status-bar-style" content="black-translucent"/);
});
test("the top bar, the toasts and the drawers keep clear of the notch and the home bar", () => {
for (const rule of [/padding-top: env\(safe-area-inset-top\)/, /padding-bottom: env\(safe-area-inset-bottom\)/, /bottom: calc\(1rem \+ env\(safe-area-inset-bottom\)\)/, /padding-left: env\(safe-area-inset-left\)/]) assert.match(css, rule);
});
});
describe("the top bar and the menu on a phone", () => {
test("the bar stays at the top of the screen (the menu was out of reach after scrolling) and sits above the page", () => {
assert.ok(phoneBlock.startsWith("@media (max-width: 991.98px)"), "the phone block is there");
assert.match(phoneBlock, /\.navbar-vertical \{\s*position: sticky;\s*top: 0;\s*z-index: 1030;/);
});
test("the menu button is at least 44 px, and the rows in the menu are finger-sized", () => {
assert.match(phoneBlock, /\.navbar-toggler \{[^}]*width: 2\.75rem;\s*height: 2\.75rem;/);
assert.match(phoneBlock, /\.nav-link,\s*\.navbar-vertical \.dropdown-item \{\s*min-height: 2\.75rem;/);
assert.match(phoneBlock, /\.fav-star \{\s*width: 2\.5rem;\s*height: 2\.5rem;/);
});
test("an open menu is as tall as the screen at most and scrolls by itself without passing the scroll on to the page", () => {
assert.match(phoneBlock, /\.navbar-collapse\.show[^{]*\{[^}]*max-height: calc\(100dvh - 4\.5rem - env\(safe-area-inset-top\)\);[^}]*overflow-y: auto;[^}]*overscroll-behavior: contain;/);
});
});
describe("small screens and touch", () => {
test("a little larger text on a small screen, toasts across the width, drawers the full width", () => {
assert.match(css, /@media \(max-width: 575\.98px\) \{\s*\/\*[^*]*\*\/\s*body \{\s*--tblr-body-font-size: 0\.9375rem;/);
assert.match(css, /\.toast-stack \{\s*left: calc\(1rem \+ env\(safe-area-inset-left\)\);\s*width: auto;/);
assert.match(css, /\.detail-drawer \{\s*width: 100vw;/);
});
test("what is pressed does not wait for a second tap", () => {
assert.match(css, /a,\s*button,\s*summary,\s*label,\s*select,\s*\[role="button"\],\s*\[role="tab"\] \{\s*touch-action: manipulation;/);
});
test("the small buttons and fields keep their finger size", () => {
assert.match(css, /\.btn\.btn-sm:not\(\.btn-link\):not\(\.btn-icon\),\s*\.form-select-sm,\s*\.form-control-sm \{\s*min-height: 2\.5rem;/);
});
});
+2 -1
View File
@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Homelab Manager</title> <title>Homelab Manager</title>
<link rel="manifest" href="/manifest.webmanifest" /> <link rel="manifest" href="/manifest.webmanifest" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" /> <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
@@ -12,6 +12,7 @@
<meta name="mobile-web-app-capable" content="yes" /> <meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-title" content="Homelab" /> <meta name="apple-mobile-web-app-title" content="Homelab" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<script> <script>
(function () { (function () {
try { try {
+102
View File
@@ -2226,3 +2226,105 @@ html[data-menu-icons="off"] .dropdown-item .menu-item-icon {
display: inline-block; display: inline-block;
padding-block: 0.3rem; padding-block: 0.3rem;
} }
/* ── Phones and tablets held upright ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
The top bar stays where the thumb can reach it (the menu was out of reach after scrolling), is compact, and has a menu button that can be hit; an open menu scrolls by itself instead of
pushing the page down; the rows in it are finger-sized; and the notch, the rounded corners and the home bar are left clear (the page asks for the whole screen with viewport-fit=cover). */
@media (max-width: 991.98px) {
.navbar-vertical {
position: sticky;
top: 0;
z-index: 1030;
padding-top: env(safe-area-inset-top);
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
.navbar-vertical .navbar-brand .logo-frame {
width: 8.5rem;
}
.navbar-vertical .navbar-toggler {
display: inline-grid;
place-items: center;
width: 2.75rem;
height: 2.75rem;
padding: 0;
}
.navbar-vertical .navbar-collapse.show,
.navbar-vertical .navbar-collapse.collapsing {
max-height: calc(100vh - 4.5rem - env(safe-area-inset-top));
max-height: calc(100dvh - 4.5rem - env(safe-area-inset-top));
padding-bottom: env(safe-area-inset-bottom);
overflow-y: auto;
overscroll-behavior: contain;
}
.navbar-vertical .nav-link,
.navbar-vertical .dropdown-item {
min-height: 2.75rem;
align-items: center;
}
.navbar-vertical .dropdown-menu .dropdown-item {
padding-top: 0.55rem;
padding-bottom: 0.55rem;
}
.fav-star {
width: 2.5rem;
height: 2.5rem;
}
}
body {
padding-left: env(safe-area-inset-left);
padding-right: env(safe-area-inset-right);
}
.page-body {
padding-bottom: env(safe-area-inset-bottom);
}
.toast-stack {
bottom: calc(1rem + env(safe-area-inset-bottom));
right: calc(1rem + env(safe-area-inset-right));
}
.detail-drawer-header {
padding-top: calc(1rem + env(safe-area-inset-top));
}
.detail-drawer-body {
padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
@media (max-width: 575.98px) {
/* A little larger text where the screen is small and held close, and toasts across the width instead of a corner. */
body {
--tblr-body-font-size: 0.9375rem;
font-size: 0.9375rem;
}
.toast-stack {
left: calc(1rem + env(safe-area-inset-left));
width: auto;
}
.detail-drawer {
width: 100vw;
border-left: 0;
}
}
/* No wait for a second tap and no zoom on a double tap, on anything that is pressed. */
a,
button,
summary,
label,
select,
[role="button"],
[role="tab"] {
touch-action: manipulation;
}