oficina / meet Public

Calls' pages on the spacing scale: the stack, the spacing gate and the rhythm audit

WIP: commit message completed at landing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 6ef31fcd7845327aaa4aadfc26071cfbeef7e7d6 parent f0f2f4c
13 files changed, +589 −115
  • .amadan/ci.d/60-spacing +2 −0
  • AGENTS.md +16 −0
  • Makefile +18 −3
  • internal/calls/static/calls-shell.css +16 −7
  • internal/calls/static/calls.css +80 −82
  • internal/calls/static/chat.css +1 −1
  • internal/calls/static/noscript.css +2 −2
  • internal/calls/templates/index.html +4 −4
  • internal/calls/templates/join.html +16 −12
  • internal/calls/templates/layout.html +1 −1
  • internal/calls/templates/settings.html +3 −3
  • internal/callstest/rhythm_browser_test.go +295 −0
  • test/browser/rhythm.mjs +135 −0

CI passed — run details

CI log
=== vet ===
go vet ./...
go: downloading amadan.net/rastrillo/rastrillo v0.45.0
go: downloading amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e
go: downloading amadan.net/rastrillo/fiesta v1.6.1
go vet -tags browser ./internal/calls/ ./internal/callstest/
=== fmt ===
=== test ===
go test ./...
ok  	amadan.net/oficina/calls/callscore	7.457s
ok  	amadan.net/oficina/calls/cmd/calls	13.458s
?   	amadan.net/oficina/calls/cmd/calls-contract	[no test files]
ok  	amadan.net/oficina/calls/cmd/quality-summary	0.015s
?   	amadan.net/oficina/calls/gen	[no test files]
ok  	amadan.net/oficina/calls/gen/locales	0.003s
ok  	amadan.net/oficina/calls/internal/calls	14.668s
ok  	amadan.net/oficina/calls/internal/calls/apns	0.008s
ok  	amadan.net/oficina/calls/internal/calls/hub	1.093s
?   	amadan.net/oficina/calls/internal/calls/icons	[no test files]
?   	amadan.net/oficina/calls/internal/calls/keymailtest	[no test files]
ok  	amadan.net/oficina/calls/internal/calls/relay	0.003s
ok  	amadan.net/oficina/calls/internal/calls/seal	0.006s
?   	amadan.net/oficina/calls/internal/calls/teamstate	[no test files]
ok  	amadan.net/oficina/calls/internal/callstest	12.526s
ok  	amadan.net/oficina/calls/protocol	0.002s
?   	amadan.net/oficina/calls/scripts/writeestilo	[no test files]
=== migration-check ===
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo migration check
rastrillo migration check: models and migrations agree
=== race ===
CGO_ENABLED=1 go test -race ./internal/...
ok  	amadan.net/oficina/calls/internal/calls	110.348s
ok  	amadan.net/oficina/calls/internal/calls/apns	1.025s
ok  	amadan.net/oficina/calls/internal/calls/hub	4.833s
?   	amadan.net/oficina/calls/internal/calls/icons	[no test files]
?   	amadan.net/oficina/calls/internal/calls/keymailtest	[no test files]
ok  	amadan.net/oficina/calls/internal/calls/relay	1.017s
ok  	amadan.net/oficina/calls/internal/calls/seal	1.011s
?   	amadan.net/oficina/calls/internal/calls/teamstate	[no test files]
ok  	amadan.net/oficina/calls/internal/callstest	50.205s
=== spacing ===
go tool fiesta spacing -skip tokens.css internal/calls/static
go: downloading golang.org/x/net v0.58.0
diff --git a/.amadan/ci.d/60-spacing b/.amadan/ci.d/60-spacing
new file mode 100755
index 0000000..53c0bd3
--- /dev/null
+++ b/.amadan/ci.d/60-spacing
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec make spacing
diff --git a/AGENTS.md b/AGENTS.md
index c88f09e..c0efa21 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -106,6 +106,22 @@ mechanically.
a C dependency. Run it for any change to `internal/calls/hub` or the
stream — a hub behind a mutex, a tick goroutine and one goroutine per
stream is more concurrency than `make ci` can see.
+- **Spacing is on the scale, and a stack spaces the page** (Paul,
+ 2026-11-22; Fiesta's DESIGN.md, "The stack"). `<main>` is `rst-stack`
+ (layout.html), and so is any region holding blocks of its own (a
+ section, the holding screen's device panel and its audio test);
+ `rst-section` opens a section and `rst-actions` is a row of buttons.
+ No hand margins between a page's blocks; every other margin, padding
+ and gap is a `var(--rst-sp-N)`, or carries `/* spacing-allow: why */`
+ for real geometry. The call window (room.html: tiles, bar, PiP,
+ popovers, chat) is that geometry, pinned to the Mac app's, and its
+ allowances say so. `make spacing` (in `make ci`) reads static/;
+ `TestEveryPageKeepsTheRhythm` (`make browser`) runs Fiesta's rhythm
+ audit over the pages in its list, in the states that change their
+ blocks, with script and without. A new page or state goes in that
+ list. Write a hidden input first in a stack (a hidden child between
+ two blocks costs the next one its spacing), and give a positioned
+ child of a stack back its own margins (`dialog.calls-report:modal`).
- `make browser` is the second gate, for any change to a page or to the
client: a real call in real Chromium. It needs the Claude Code bash
sandbox **off** — the sandbox blocks UDP, so Chromium gathers no ICE
diff --git a/Makefile b/Makefile
index c632fab..64b12d3 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ export GOPRIVATE := $(GOPRIVATE),amadan.net/oficina/estilo.git,amadan.net/oficin
# moved on (go1.26.10): main's CI failed on that alone. Memoria and
# Calendar export it for the whole Makefile; here it is scoped to the
# gate's targets, so the native builds keep whichever Go they had.
-vet test race migration-check ci credits: export GOTOOLCHAIN := go1.26.5
+vet test race migration-check spacing ci credits: export GOTOOLCHAIN := go1.26.5
APP := calls
@@ -27,7 +27,7 @@ RELEASE_BIN := releases/$(APP)-$(RELEASE_GOOS)-$(RELEASE_GOARCH)
# first commit, name it yourself: make release VERSION=v0.1.0
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null)
-.PHONY: build release version-check test vet fmt-check migration-check ci race browser
+.PHONY: build release version-check test vet fmt-check migration-check spacing ci race browser
# build is the compile check: with more than one package matched, go
# build discards the output, so this catches a broken package without
@@ -107,6 +107,17 @@ fmt-check:
migration-check:
go run amadan.net/rastrillo/rastrillo/cmd/rastrillo migration check
+# spacing is Fiesta's stylesheet half of the spacing rhythm (Paul,
+# 2026-11-22: no ad-hoc spacing): every margin, padding and gap in
+# static/ is a var(--rst-sp-N) step, or says why not with
+# /* spacing-allow: why */ where it is written. The call window's
+# allowances are its geometry, pinned to the Mac app's. tokens.css is
+# rastrillo's, vendored and pinned byte for byte (vendored_test.go), so
+# it is skipped; estilo's files are read like Calls' own. The rendered
+# half is the rhythm audit, TestEveryPageKeepsTheRhythm, in make browser.
+spacing:
+ go tool fiesta spacing -skip tokens.css internal/calls/static
+
# ci is the one gate: what a runner executes and what you run before
# pushing are the same definition. amadan's runner falls back to this
# target when .amadan/ci is absent; ci.d/ carries the same targets,
@@ -114,7 +125,7 @@ migration-check:
# fails the build the moment models.go and migrations/ disagree,
# instead of at boot on whatever machine notices next. If the app
# declares manifest resources, also add: rastrillo generate --check
-ci: vet fmt-check test migration-check
+ci: vet fmt-check test migration-check spacing
# The browser gate: a real call between two real Chromium contexts, with
# fake camera and microphone. The scenarios, and the order they run in,
@@ -187,6 +198,10 @@ browser:
# The smart door (signin_browser_test.go): every sign-in state at
# 320px and 1280px, forced light. No media, no UDP.
go test -tags browser -count=1 -timeout 10m -run TestSmartDoorInABrowser -v ./internal/calls/
+ # Fiesta's rhythm audit (rhythm_browser_test.go) over Calls' own
+ # pages, at 1280px and 390px, with script and without. No media
+ # beyond Chromium's fake devices, no UDP.
+ go test -tags browser -count=1 -timeout 10m -run TestEveryPageKeepsTheRhythm -v ./internal/callstest/
# Native builds isolate gomobile's cgo bridge from the cgo-free server.
.PHONY: native-mac native-test native-browser native-pair
diff --git a/internal/calls/static/calls-shell.css b/internal/calls/static/calls-shell.css
index 91490cc..c2d5d99 100644
--- a/internal/calls/static/calls-shell.css
+++ b/internal/calls/static/calls-shell.css
@@ -2,7 +2,10 @@
(the bar itself is estilo's chrome.css). */
body { background: var(--rst-bg); }
[rst-page] { max-inline-size: 80rem; margin-inline: auto; }
-.calls-lobby-heading h1 { font-size: 2rem; }
+/* The holding screen's title, larger: the page header right before who
+ you will join as. Not a wrapper round the header, which would hide it
+ from the stack's "after the page header" rule. */
+[rst-page-header]:has(+ .calls-standing) h1 { font-size: 2rem; }
/* The meeting and agent lists: rastrillo's list rows (rst-list >
rst-row), with the row's ⋯ menu drawn as estilo's floating menu, the
@@ -16,10 +19,9 @@ body { background: var(--rst-bg); }
[rst-row] > [rst-row-menu] > summary { inline-size: 2rem; block-size: 2rem; border-radius: 0; color: var(--rst-text-muted); }
.calls-row-menu { position: absolute; inset-inline-end: 0; inset-block-start: calc(100% + 4px); }
.calls-row-title { color: var(--rst-text); font-weight: 600; }
-.calls-row-badge { display: inline-flex; align-items: center; gap: 0.25rem; flex: none; position: relative; z-index: 1; color: var(--rst-text-muted); }
-.calls-ended { margin-block-start: var(--rst-sp-5); }
+.calls-row-badge { display: inline-flex; align-items: center; gap: var(--rst-sp-1); flex: none; position: relative; z-index: 1; color: var(--rst-text-muted); }
.calls-ended > summary { cursor: pointer; font-weight: 600; margin-block-end: var(--rst-sp-3); }
-.calls-option-help { margin-block: 0.25rem var(--rst-sp-3); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
+.calls-option-help { margin-block: var(--rst-sp-1) var(--rst-sp-3); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); }
.calls-share-link a { overflow-wrap: anywhere; }
/* The Home account page's linked address (connect's home_link.html).
Its template asks for this with a style attribute, which rastrillo's
@@ -37,6 +39,13 @@ body { background: var(--rst-bg); }
/* The holding screen: who you'll join as, then the device panel, then
the other ways in and the meeting's own pages. */
.calls-standing { color: var(--rst-text-muted); }
-.calls-holding-more { display: grid; gap: var(--rst-sp-3); justify-items: start; margin-block-start: var(--rst-sp-5); }
-.calls-holding-more p { margin: 0; }
-.calls-holding-more form { margin: 0; }
+/* .calls-holding-more is a stack of its own (join.html); its one-button
+ form is as wide as its button. */
+.calls-holding-more > form { align-self: flex-start; }
+
+/* The Colophon under Help (estilo's credits template, /help/open-source):
+ its heading and list on the stack's terms, the heading a step from the
+ list, as estilo's card is since 6238a47. estilo's template carries no
+ rst-stack of its own yet; when it does, this goes. */
+[estilo-credits] { display: flex; flex-direction: column; gap: var(--rst-sp-2); }
+[estilo-credits] > * { margin-block: 0; }
diff --git a/internal/calls/static/calls.css b/internal/calls/static/calls.css
index 594d00e..598fe2e 100644
--- a/internal/calls/static/calls.css
+++ b/internal/calls/static/calls.css
@@ -30,7 +30,6 @@
display: flex;
flex-wrap: wrap;
gap: var(--rst-sp-3);
- margin-block: var(--rst-sp-3);
}
/* Off screen, still in the accessibility tree and still announced. */
@@ -38,7 +37,7 @@
position: absolute;
inline-size: 1px;
block-size: 1px;
- margin: -1px;
+ margin: -1px; /* spacing-allow: the visually hidden pattern's 1px box, pulled off its own edge */
padding: 0;
overflow: hidden;
clip-path: inset(50%);
@@ -126,7 +125,6 @@
.calls-preview-wrap { border-radius: 20px; overflow: hidden; background: #000; }
.calls-preview { display: block; max-width: none; aspect-ratio: 16 / 9; border: 0; border-radius: 0; }
.calls-preview[hidden] { display: none; }
-.calls-pickers { margin-block-start: 0; }
.calls-pickers > div { flex: 1 1 12rem; min-inline-size: 0; }
.calls-pickers select { max-inline-size: 100%; }
/* The rule above makes every picker a ~12rem flex item, which is right
@@ -146,9 +144,6 @@
device choices, one row per test — the button, its meter, and the
sentence that says what it found. The sentence is the result; the
meter only shows it happening. */
-.calls-audio-test {
- margin-block: var(--rst-sp-3);
-}
.calls-audio-test[hidden] { display: none; }
/* The holding screen keeps the speaker row's place while it is hidden:
@@ -163,23 +158,23 @@
cursor: pointer;
font-weight: 600;
}
-.calls-audio-row {
+/* The disclosure's body and each test are stacks (join.html): the
+ summary, then the body a step under it. */
+.calls-audio-body { margin-block-start: var(--rst-sp-3); }
+/* Closed, the body is not drawn; saying so lets a measure of the panel
+ (the rhythm audit) see what the browser does. */
+.calls-audio-test:not([open]) > .calls-audio-body { display: none; }
+.calls-audio-line {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--rst-sp-2) var(--rst-sp-3);
- margin-block: var(--rst-sp-3);
}
-.calls-audio-row meter {
+.calls-audio-line meter {
flex: 1 1 8rem;
max-inline-size: 16rem;
block-size: 0.75rem;
}
-.calls-audio-row .calls-raw-help,
-.calls-audio-result {
- flex-basis: 100%;
- margin: 0;
-}
.calls-audio-result {
color: var(--rst-text);
font-weight: 600;
@@ -317,7 +312,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
align-items: center;
justify-content: center;
block-size: 44px;
- padding: 0 72px;
+ padding: 0 72px; /* spacing-allow: the call window's title strip keeps 72px clear each side for the window's corner controls, as the Mac title bar does */
pointer-events: none;
}
.calls-top-named::before {
@@ -350,12 +345,12 @@ body:has(> .calls-window) { background: var(--rst-bg); }
position: absolute;
inline-size: 1px;
block-size: 1px;
- margin: -1px;
+ margin: -1px; /* spacing-allow: the visually hidden pattern's 1px box, pulled off its own edge */
overflow: hidden;
clip-path: inset(50%);
}
.calls-top-line {
- margin: 1px 0 0;
+ margin: 1px 0 0; /* spacing-allow: the call title's second line, 1px under the first, the Mac window subtitle's */
font-size: 0.8125rem;
line-height: 1.35;
color: rgb(255 255 255 / 0.85);
@@ -369,7 +364,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
align-items: center;
min-block-size: 40px;
- padding: 0 12px;
+ padding: 0 var(--rst-sp-3);
border: 0;
border-radius: 9px;
background: none;
@@ -386,7 +381,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-menu form { margin: 0; }
.calls-menu-standing {
margin: 0;
- padding: 6px 12px 8px;
+ padding: 6px var(--rst-sp-3) var(--rst-sp-2); /* spacing-allow: the More menu's rows are the Mac call menu's: 6px over the standing line */
max-inline-size: 18rem;
color: rgb(255 255 255 / 0.85);
font-size: 0.8125rem;
@@ -394,22 +389,22 @@ body:has(> .calls-window) { background: var(--rst-bg); }
}
.calls-menu hr {
inline-size: 100%;
- margin: 4px 0;
+ margin: var(--rst-sp-1) 0;
border: 0;
border-block-start: 1px solid rgb(255 255 255 / 0.12);
}
.calls-menu-heading {
display: block;
margin: 0;
- padding: 6px 12px 2px;
+ padding: 6px var(--rst-sp-3) 2px; /* spacing-allow: the More menu's section heading, set 6px over and 2px under, the Mac call menu's */
color: rgb(255 255 255 / 0.6);
font-size: 0.75rem;
font-weight: 600;
}
-.calls-menu-who { margin: 0; padding-block-end: 6px; }
+.calls-menu-who { margin: 0; padding-block-end: 6px; /* spacing-allow: the More menu's row rhythm, the Mac call menu's 6px */ }
.calls-menu-address {
display: block;
- padding: 0 12px;
+ padding: 0 var(--rst-sp-3);
color: #fff;
font-size: 0.8125rem;
overflow-wrap: anywhere;
@@ -423,12 +418,12 @@ body:has(> .calls-window) { background: var(--rst-bg); }
flex-direction: column;
align-items: center;
justify-content: center;
- gap: 12px;
- padding: calc(var(--calls-title-h) + 40px) 24px 24px;
+ gap: var(--rst-sp-3);
+ padding: calc(var(--calls-title-h) + 40px) 24px 24px; /* spacing-allow: the call window's no-script sentence clears the title strip's own height, which is not a step */
text-align: center;
}
.calls-scriptless p { margin: 0; max-inline-size: 34rem; line-height: 1.5; }
-.calls-scriptless-links { display: flex; gap: 16px; justify-content: center; }
+.calls-scriptless-links { display: flex; gap: var(--rst-sp-4); justify-content: center; }
.calls-scriptless form { margin: 0; }
/* ── The room: everything scripted, over the whole window ── */
@@ -447,14 +442,14 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
flex-direction: column;
align-items: center;
- gap: 8px;
+ gap: var(--rst-sp-2);
pointer-events: none;
}
.calls-notices > * { pointer-events: auto; max-inline-size: min(40rem, 100%); }
.calls-window .calls-status {
margin: 0;
min-block-size: 0;
- padding: 8px 16px;
+ padding: var(--rst-sp-2) var(--rst-sp-4);
border-radius: 18px;
color: #fff;
font-size: 0.875rem;
@@ -467,10 +462,10 @@ body:has(> .calls-window) { background: var(--rst-bg); }
Mac, fades with them). */
.calls-window .calls-status[data-quiet] { transition: opacity var(--calls-fade-in) ease-out; }
.calls-window[data-chrome='hidden'] .calls-status[data-quiet] { opacity: 0; transition-duration: var(--calls-fade-out); }
-.calls-window .calls-status a { color: #fff; font-weight: 600; margin-inline-start: 8px; }
+.calls-window .calls-status a { color: #fff; font-weight: 600; margin-inline-start: var(--rst-sp-2); }
.calls-window .calls-ice-warning {
margin: 0;
- padding: 8px 16px;
+ padding: var(--rst-sp-2) var(--rst-sp-4);
border-radius: 18px;
font-size: 0.875rem;
text-align: center;
@@ -486,14 +481,14 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
flex-direction: column;
align-items: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
}
.calls-share-notice-row {
display: inline-flex;
align-items: center;
- gap: 8px;
+ gap: var(--rst-sp-2);
margin: 0;
- padding: 6px 6px 6px 14px;
+ padding: 6px 6px 6px 14px; /* spacing-allow: the sharing pill's 6px inset keeps its Stop button concentric with the pill's round ends */
border-radius: 999px;
color: #ffd99a;
font-size: 0.875rem;
@@ -504,7 +499,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-sound-banner button,
.calls-queue li button {
min-block-size: 28px;
- padding: 2px 12px;
+ padding: 2px var(--rst-sp-3); /* spacing-allow: the over-video pill buttons are 28px tall: 2px over the line, not a step */
border: 0;
border-radius: 999px;
background: #fff;
@@ -520,7 +515,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-queue li button:hover { background: #e8e8e8; }
.calls-share-recovery {
margin: 0;
- padding: 4px 12px;
+ padding: var(--rst-sp-1) var(--rst-sp-3);
border-radius: 999px;
background: var(--calls-glass);
font-size: 0.8125rem;
@@ -530,8 +525,8 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-floor-notice:not([hidden]) {
display: flex;
align-items: center;
- gap: 8px;
- padding: 6px 6px 6px 16px;
+ gap: var(--rst-sp-2);
+ padding: 6px 6px 6px var(--rst-sp-4); /* spacing-allow: the relay notice's pill: a 6px inset keeps Dismiss concentric with the 18px round ends */
border-radius: 18px;
font-size: 0.875rem;
}
@@ -556,8 +551,8 @@ body:has(> .calls-window) { background: var(--rst-bg); }
flex-wrap: wrap;
align-items: center;
justify-content: center;
- gap: 8px 12px;
- padding: 6px 6px 6px 16px;
+ gap: var(--rst-sp-2) var(--rst-sp-3);
+ padding: 6px 6px 6px var(--rst-sp-4); /* spacing-allow: the sound banner's pill: a 6px inset keeps its button concentric with the round ends */
border-radius: 999px;
}
.calls-sound-banner[hidden] { display: none; }
@@ -565,11 +560,11 @@ body:has(> .calls-window) { background: var(--rst-bg); }
/* Each person waiting, with Admit. */
.calls-queue {
- padding: 8px 8px 8px 16px;
+ padding: var(--rst-sp-2) var(--rst-sp-2) var(--rst-sp-2) var(--rst-sp-4);
border-radius: 18px;
}
.calls-queue h2 {
- margin: 0 0 4px;
+ margin: 0 0 var(--rst-sp-1);
font-size: 0.75rem;
font-weight: 600;
color: rgb(255 255 255 / 0.85);
@@ -581,14 +576,14 @@ body:has(> .calls-window) { background: var(--rst-bg); }
padding: 0;
display: flex;
flex-direction: column;
- gap: 6px;
+ gap: 6px; /* spacing-allow: the admission queue's rows sit 6px apart over the picture, the Mac's queue */
}
.calls-queue li {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
- gap: 8px 16px;
+ gap: var(--rst-sp-2) var(--rst-sp-4);
font-size: 0.875rem;
overflow-wrap: anywhere;
}
@@ -719,10 +714,10 @@ body:has(> .calls-window) { background: var(--rst-bg); }
flex-direction: row;
align-items: flex-end;
justify-content: safe center;
- gap: 8px;
+ gap: var(--rst-sp-2);
min-block-size: 0;
- padding: 8px 12px;
- margin-block-end: var(--calls-lift);
+ padding: var(--rst-sp-2) var(--rst-sp-3);
+ margin-block-end: var(--calls-lift); /* spacing-allow: the speaker strip lifts clear of the call bar by the bar's measured reserve, not a step */
overflow-x: auto;
overflow-y: hidden;
scrollbar-width: thin;
@@ -818,9 +813,9 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: grid;
grid-template-columns: repeat(var(--calls-cols, 2), var(--calls-tile-w, 320px));
grid-auto-rows: var(--calls-tile-h, 180px);
- gap: 4px;
+ gap: var(--rst-sp-1);
place-content: center;
- padding: 4px;
+ padding: var(--rst-sp-1);
overflow: auto;
scrollbar-width: none;
}
@@ -845,9 +840,9 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 6px;
+ gap: 6px; /* spacing-allow: the tile caption's pieces, 6px apart on a pill over video, the Mac caption's */
max-inline-size: calc(100% - 16px);
- padding: 3px 10px;
+ padding: 3px 10px; /* spacing-allow: the tile caption pill: 3px by 10px round the name, the Mac caption's */
border-radius: 999px;
color: #fff;
font-size: var(--rst-fs-sm);
@@ -865,7 +860,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-tile-name a {
min-block-size: 24px;
min-inline-size: 24px;
- padding: 0 6px;
+ padding: 0 6px; /* spacing-allow: a caption's own button, 24px square with 6px either side of its glyph */
border: 0;
border-radius: 8px;
background: rgb(255 255 255 / 0.14);
@@ -884,7 +879,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-tile-muted {
display: inline-flex;
align-items: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
flex: none;
}
.calls-tile-muted .icon { inline-size: 1em; block-size: 1em; }
@@ -922,7 +917,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
}
.calls-tile-off::after, .calls-tile-pause::after { min-block-size: var(--calls-caption-clear); }
.calls-tile-off > *, .calls-tile-pause > * { flex: none; }
-.calls-tile-off > * + *, .calls-tile-pause > * + * { margin-block-start: 8px; }
+.calls-tile-off > * + *, .calls-tile-pause > * + * { margin-block-start: var(--rst-sp-2); }
.calls-tile-off .icon, .calls-tile-pause .icon { inline-size: 2rem; block-size: 2rem; }
.calls-tile-camera-off .calls-tile-name { z-index: 1; }
@@ -948,9 +943,9 @@ body:has(> .calls-window) { background: var(--rst-bg); }
flex-direction: column;
align-items: center;
justify-content: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
margin: 0;
- padding: 8px 8px 2rem;
+ padding: var(--rst-sp-2) var(--rst-sp-2) 2rem; /* spacing-allow: the paused self view's cover keeps 2rem clear of the caption pill under it */
border: 0;
border-radius: inherit;
background: #212121;
@@ -965,7 +960,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-tile-paused-show { font-weight: 600; color: #fff; text-decoration: underline; }
.calls-tile-self:has(.calls-tile-paused:not([hidden])) .calls-tile-name { z-index: 2; }
@container (max-width: 15rem) {
- .calls-tile-paused { font-size: var(--rst-fs-xs); padding-block-end: 1.75rem; }
+ .calls-tile-paused { font-size: var(--rst-fs-xs); padding-block-end: 1.75rem; /* spacing-allow: the paused cover on a small tile keeps 1.75rem clear of the smaller caption */ }
}
/* What a tile says about its audio when the rim cannot: no sound,
@@ -977,7 +972,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: inline-flex;
flex-wrap: wrap;
align-items: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
font-weight: 600;
}
.calls-tile-hear[hidden],
@@ -994,7 +989,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
.calls-info summary::-webkit-details-marker { display: none; }
.calls-info[open] { flex-basis: 100%; }
.calls-info p {
- margin: 4px 0 0;
+ margin: var(--rst-sp-1) 0 0;
font-weight: 400;
max-inline-size: 30rem;
}
@@ -1035,7 +1030,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
max-inline-size: calc(100% - 22px);
inset-block-end: 6px;
inset-inline-start: 6px;
- padding: 2px 8px;
+ padding: 2px var(--rst-sp-2); /* spacing-allow: the filmstrip caption pill, 2px over the line, the Mac's small caption */
font-size: var(--rst-fs-xs);
}
.calls-tile-name > span:first-child { flex: 0 1 auto; min-inline-size: 0; }
@@ -1132,7 +1127,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
inset-block-start: 8px;
inset-inline-end: 8px;
display: flex;
- gap: 4px;
+ gap: var(--rst-sp-1);
z-index: 2;
}
.calls-tile-tools > .calls-tool {
@@ -1156,10 +1151,10 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: inline-flex;
align-items: center;
justify-content: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
min-inline-size: 30px;
min-block-size: 30px;
- padding: 2px 8px;
+ padding: 2px var(--rst-sp-2); /* spacing-allow: a tile's ⋯ and pin buttons, 30px round targets on a 2px inset */
border: 0;
border-radius: 999px;
background: var(--calls-glass, rgb(0 0 0 / 0.62));
@@ -1170,7 +1165,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
font-size: var(--rst-fs-xs);
cursor: pointer;
}
-.calls-tool-more { padding: 2px; }
+.calls-tool-more { padding: 2px; /* spacing-allow: the ⋯ glyph on a 2px inset inside its 30px round target */ }
.calls-tool .icon { inline-size: 16px; block-size: 16px; }
.calls-tool:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.calls-tool-more[aria-expanded='true'] { background: #f0f0f0; color: #1a1a1a; }
@@ -1186,7 +1181,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
flex-direction: column;
min-inline-size: 13rem;
- padding: 6px;
+ padding: 6px; /* spacing-allow: the tile menu's 6px inset keeps its rows concentric with the 14px corners */
border-radius: 14px;
background: var(--calls-panel);
color: #fff;
@@ -1198,7 +1193,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
align-items: center;
min-block-size: 40px;
- padding: 0 12px;
+ padding: 0 var(--rst-sp-3);
border: 0;
border-radius: 9px;
background: none;
@@ -1211,7 +1206,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
}
.calls-menu button:hover:not(:disabled) { background: rgb(255 255 255 / 0.1); }
.calls-menu button:disabled { opacity: 0.45; cursor: default; }
-.calls-tile-menu .calls-tile-remove { margin-block-start: 4px; border-block-start: 1px solid rgb(255 255 255 / 0.12); border-radius: 0 0 9px 9px; }
+.calls-tile-menu .calls-tile-remove { margin-block-start: var(--rst-sp-1); border-block-start: 1px solid rgb(255 255 255 / 0.12); border-radius: 0 0 9px 9px; }
/* The tile being dragged: lifted over the others, with the accent edge,
following the pointer (its translate is set as it moves); the others
@@ -1246,10 +1241,10 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
flex-wrap: nowrap;
align-items: center;
- gap: 10px;
+ gap: 10px; /* spacing-allow: the call bar's buttons sit 10px apart, the Mac bar's */
inline-size: min(760px, calc(100% - 32px));
box-sizing: border-box;
- padding: 10px;
+ padding: 10px; /* spacing-allow: the call bar's 10px inset keeps its round buttons concentric with the bar's ends */
margin: 0;
border-radius: 999px;
box-shadow: 0 4px 24px rgb(0 0 0 / 0.25);
@@ -1325,7 +1320,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
inset-inline-end: -3px;
min-inline-size: 18px;
block-size: 18px;
- padding: 0 5px;
+ padding: 0 5px; /* spacing-allow: the unread count badge on Chat, 18px tall with 5px round a digit */
box-sizing: border-box;
border-radius: 999px;
background: var(--rst-accent);
@@ -1357,7 +1352,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
inset-block-end: calc(100% + 14px);
inset-inline-start: 50%;
translate: -50% 0;
- padding: 4px 10px;
+ padding: var(--rst-sp-1) 10px; /* spacing-allow: the bar's tooltip, 4px by 10px round its words, the Mac tooltip's */
border-radius: 8px;
background: rgb(20 20 20 / 0.94);
color: #fff;
@@ -1390,15 +1385,15 @@ body:has(> .calls-window) { background: var(--rst-bg); }
max-inline-size: calc(100% - 24px);
max-block-size: calc(100% - var(--calls-bar-reserve) - 28px);
overflow: auto;
- padding: 12px 14px;
+ padding: var(--rst-sp-3) 14px; /* spacing-allow: the bar's popovers have a 14px side inset, the Mac popover's */
border-radius: 16px;
background: var(--calls-panel);
color: #fff;
box-shadow: 0 8px 28px rgb(0 0 0 / 0.4);
}
.calls-popover[hidden] { display: none; }
-.calls-popover-title { margin: 0 0 8px; font-size: 0.9375rem; font-weight: 650; }
-.calls-popover-help { margin: 10px 0 0; max-inline-size: 16rem; font-size: 0.8125rem; color: rgb(255 255 255 / 0.8); }
+.calls-popover-title { margin: 0 0 var(--rst-sp-2); font-size: 0.9375rem; font-weight: 650; }
+.calls-popover-help { margin: 10px 0 0; /* spacing-allow: the popover's help line sits 10px under its control, the Mac popover's */ max-inline-size: 16rem; font-size: 0.8125rem; color: rgb(255 255 255 / 0.8); }
.calls-popover [estilo-call-segmented] { background: rgb(255 255 255 / 0.08); border-color: transparent; }
.calls-popover [estilo-call-segmented] button { color: #fff; min-inline-size: 88px; }
.calls-popover [estilo-call-segmented] [aria-pressed='true'] { background: #f0f0f0; color: #1a1a1a; border-color: transparent; }
@@ -1406,14 +1401,14 @@ body:has(> .calls-window) { background: var(--rst-bg); }
inline-size: 320px;
flex-direction: column;
flex-wrap: nowrap;
- gap: 12px;
+ gap: var(--rst-sp-3);
margin: 0;
}
.calls-window .calls-devices:not([hidden]) { display: flex; }
.calls-window .calls-devices > div { flex: none; }
.calls-window .calls-devices .calls-popover-title { margin: 0; }
.calls-window .calls-devices .calls-raw-help { color: rgb(255 255 255 / 0.8); }
-.calls-menu { padding: 6px; min-inline-size: 14rem; }
+.calls-menu { padding: 6px; /* spacing-allow: the More menu's 6px inset keeps its rows concentric with the 14px corners */ min-inline-size: 14rem; }
.calls-menu a.calls-menu-danger { color: #ff9c96; font-weight: 600; }
/* ── Chat: a sidebar sliding over the picture's right-hand side ── */
@@ -1442,7 +1437,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
margin: 0;
border: 0;
border-radius: 16px;
- padding: 14px 14px 12px;
+ padding: 14px 14px var(--rst-sp-3); /* spacing-allow: the chat sidebar's 14px inset, the Mac chat panel's */
}
.calls-chat-overlay .chat-title { color: var(--rst-text); font-size: 0.9375rem; font-weight: 650; }
.calls-chat-overlay .chat-log { flex: 1; min-block-size: 4rem; max-block-size: none; }
@@ -1528,8 +1523,8 @@ body:has(> .calls-window) { background: var(--rst-bg); }
inset-inline: 0;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 8px;
- padding: 12px;
+ gap: var(--rst-sp-2);
+ padding: var(--rst-sp-3);
border-radius: 22px;
background: color-mix(in srgb, var(--rst-surface) 96%, transparent);
box-shadow: 0 8px 28px rgb(0 0 0 / 0.4);
@@ -1539,11 +1534,11 @@ body:has(> .calls-window) { background: var(--rst-bg); }
display: flex;
flex-direction: column;
justify-content: center;
- gap: 6px;
+ gap: 6px; /* spacing-allow: a phone sheet button's glyph and word, 6px apart, as iOS's */
inline-size: 100%;
block-size: auto;
min-block-size: 76px;
- padding: 8px 4px;
+ padding: var(--rst-sp-2) var(--rst-sp-1);
border-radius: 16px;
background: rgb(255 255 255 / 0.08);
font-size: var(--rst-fs-xs);
@@ -1573,7 +1568,7 @@ body:has(> .calls-window) { background: var(--rst-bg); }
inset-block-start: 8px;
inline-size: auto;
}
- .calls-top { padding-inline: 16px; }
+ .calls-top { padding-inline: var(--rst-sp-4); }
.calls-window #tiles > .calls-tile-pip {
inline-size: clamp(88px, 28cqw, 150px);
aspect-ratio: 3 / 4;
@@ -1607,6 +1602,9 @@ body:has(> .calls-window) { background: var(--rst-bg); }
color: var(--rst-text);
box-shadow: var(--rst-shadow-pop);
}
+/* On the holding screen the sheet is a child of <main>, a stack, whose
+ rule would take the modal's auto margins and pin it to the top. */
+[rst-stack] > dialog.calls-report:modal { margin: auto; }
.calls-report::backdrop { background: rgb(0 0 0 / 0.55); }
.calls-report-form { margin: 0; }
.calls-report-title { margin: 0 0 var(--rst-sp-3); font-size: 1.0625rem; font-weight: 650; }
@@ -1641,5 +1639,5 @@ body:has(> .calls-window) { background: var(--rst-bg); }
text-decoration: underline;
cursor: pointer;
}
-.calls-window .calls-status .calls-report-after { margin-inline-start: 8px; color: #fff; font-weight: 600; }
+.calls-window .calls-status .calls-report-after { margin-inline-start: var(--rst-sp-2); color: #fff; font-weight: 600; }
.calls-quality-row .calls-raw-help { margin-block-start: var(--rst-sp-1); }
diff --git a/internal/calls/static/chat.css b/internal/calls/static/chat.css
index f9a42f5..a600f93 100644
--- a/internal/calls/static/chat.css
+++ b/internal/calls/static/chat.css
@@ -80,7 +80,7 @@
flex: 1 0 100%;
color: var(--rst-text-muted);
font-size: var(--rst-fs-sm);
- margin-block-end: -0.2rem;
+ margin-block-end: -0.2rem; /* spacing-allow: the call chat's label tucks onto its field, the call panel's */
}
/* The control grows and the button keeps its own width; rst-input's
diff --git a/internal/calls/static/noscript.css b/internal/calls/static/noscript.css
index 45c7701..29b80d7 100644
--- a/internal/calls/static/noscript.css
+++ b/internal/calls/static/noscript.css
@@ -14,7 +14,7 @@
display: block;
block-size: auto;
max-inline-size: min(420px, calc(100% - 24px));
- padding: 10px 14px;
+ padding: 10px 14px; /* spacing-allow: the no-script call title's card is the scripted title strip's 10px by 14px */
border-radius: 14px;
background: rgb(18 18 18 / 0.92);
pointer-events: auto;
@@ -30,6 +30,6 @@
white-space: normal;
text-shadow: none;
}
-.calls-window .calls-top-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; font-size: 0.875rem; }
+.calls-window .calls-top-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-1) var(--rst-sp-4); margin: var(--rst-sp-2) 0 0; font-size: 0.875rem; }
.calls-window .calls-top-links form { margin: 0; }
.calls-window .calls-top-links button { padding: 0; border: 0; background: none; color: #fff; font: inherit; text-decoration: underline; cursor: pointer; }
diff --git a/internal/calls/templates/index.html b/internal/calls/templates/index.html
index 7defa73..d6e6f58 100644
--- a/internal/calls/templates/index.html
+++ b/internal/calls/templates/index.html
@@ -1,7 +1,7 @@
{{define "head"}}<script defer src="{{asset "static/zone.js"}}"></script>{{end}}
{{define "content"}}{{$L := localizer $}}
{{template "page-header" dict "L" $L "Title" "Meetings"}}
-<section>
+<section rst-stack rst-section>
<form method="post" action="/meetings/start">
{{/* zone.js fills this with the browser's own time zone, so a call's
automatic title ("Call, 30 Sep 21:47") is in the starter's time,
@@ -11,7 +11,7 @@
<button type="submit" rst-btn="primary lg">Start a call</button>
</form>
</section>
-<section>
+<section rst-stack rst-section>
<h2>Upcoming</h2>
{{if .Partial}}<div data-partial>{{template "callout" dict "L" $L "Title" .PartialTitle "Body" .PartialBody "Tone" "warning"}}</div>
{{else if .Upcoming}}
@@ -36,7 +36,7 @@
{{template "empty-state" dict "L" $L "Body" "No meetings yet. Start a call now, or make one below and share its link."}}
{{end}}
</section>
-<section>
+<section rst-stack rst-section>
<h2>New meeting</h2>
<form rst-form method="post" action="/meetings">
{{template "field" dict "L" $L "ID" "title" "Name" "title" "Label" "Title" "Required" true "Maxlength" "200" "Error" .TitleError}}
@@ -45,7 +45,7 @@
</form>
</section>
{{if .Ended}}
-<details class="calls-ended">
+<details class="calls-ended" rst-section>
<summary>Ended meetings ({{len .Ended}})</summary>
<div rst-list>
{{range .Ended}}<div rst-row><span rst-row-main><span class="calls-row-title">{{.Title}}</span><small rst-row-sub>{{if .ByAgent}}By {{.CreatedByPrincipal}} · {{end}}Ended</small></span>{{if .ByAgent}}<span class="calls-row-badge">{{icon "bot"}}{{template "badge" dict "L" $L "Label" "Agent"}}</span>{{end}}</div>{{end}}
diff --git a/internal/calls/templates/join.html b/internal/calls/templates/join.html
index 7049564..13386d4 100644
--- a/internal/calls/templates/join.html
+++ b/internal/calls/templates/join.html
@@ -13,7 +13,7 @@
already on screen moves when they arrive. */}}
{{define "content"}}{{$L := localizer $}}
{{if .IsMember}}{{template "back-nav" dict "L" $L "Href" "/" "Label" "Meetings"}}{{end}}
-<div class="calls-lobby-heading">{{template "page-header" dict "L" $L "Title" .Title}}</div>
+{{template "page-header" dict "L" $L "Title" .Title}}
<p class="calls-standing">{{if .Starts}}Starts {{.Starts}}. {{end}}You’ll join as {{.Name}}{{if eq .Standing "guest"}}, a guest{{end}}.</p>
{{if .Floor}}{{template "callout" dict "L" $L "Body" "Calls outside your network may not connect yet." "Tone" "warning"}}{{end}}
{{if .OpenElsewhere}}<div rst-callout rst-tone="warning"><span rst-callout-ic aria-hidden="true">{{icon "alert-triangle"}}</span><div rst-callout-body><p>This meeting is already open in another tab. <a href="/m/{{.Sqid}}/takeover">Use this tab instead</a>.</p></div></div>{{end}}
@@ -21,7 +21,7 @@
<div id="devices" data-sqid="{{.Sqid}}" data-join-href="{{if .OpenElsewhere}}/m/{{.Sqid}}/takeover{{else}}/m/{{.Sqid}}{{end}}">
<div class="calls-device-layout">
<div class="calls-preview-wrap"><video id="preview" muted autoplay playsinline aria-label="Your camera preview" class="calls-preview"></video></div>
-<div estilo-call-panel>
+<div estilo-call-panel rst-stack>
<div class="calls-controls" estilo-call-actions>
<button type="button" id="toggle-mute" rst-btn aria-label="Microphone" aria-pressed="false">{{icon "mic"}}Microphone<span id="toggle-mute-state" class="calls-toggle-state" aria-hidden="true">On</span></button>
<button type="button" id="toggle-camera" rst-btn aria-label="Camera" aria-pressed="false">{{icon "video"}}Camera<span id="toggle-camera-state" class="calls-toggle-state" aria-hidden="true">On</span></button>
@@ -54,29 +54,33 @@
and dropped. */}}
<details id="audio-test" class="calls-audio-test">
<summary>Test audio</summary>
+ {{/* The disclosure's content is a stack, and each test is one too:
+ the button and its meter on one line, then what it found. */}}
+ <div class="calls-audio-body" rst-stack>
<p class="calls-raw-help">Everything here stays in this browser. Nothing you say is sent anywhere.</p>
- <div class="calls-audio-row">
- <button type="button" id="test-mic" rst-btn>Test microphone</button>
- <meter id="mic-level" min="0" max="1" value="0" aria-label="Microphone level"></meter>
+ <div class="calls-audio-row" rst-stack>
+ <div class="calls-audio-line"><button type="button" id="test-mic" rst-btn>Test microphone</button>
+ <meter id="mic-level" min="0" max="1" value="0" aria-label="Microphone level"></meter></div>
<p id="mic-result" class="calls-audio-result" role="status"></p>
</div>
- <div class="calls-audio-row">
- <button type="button" id="test-speaker" rst-btn>Play a test sound</button>
- <meter id="speaker-level" min="0" max="1" value="0" aria-label="Test sound level"></meter>
+ <div class="calls-audio-row" rst-stack>
+ <div class="calls-audio-line"><button type="button" id="test-speaker" rst-btn>Play a test sound</button>
+ <meter id="speaker-level" min="0" max="1" value="0" aria-label="Test sound level"></meter></div>
<p id="speaker-result" class="calls-audio-result" role="status"></p>
</div>
- <div class="calls-audio-row">
- <button type="button" id="test-loopback" rst-btn aria-describedby="loopback-help">Hear yourself as others will</button>
- <meter id="loopback-level" min="0" max="1" value="0" aria-label="Recording and playback level"></meter>
+ <div class="calls-audio-row" rst-stack>
+ <div class="calls-audio-line"><button type="button" id="test-loopback" rst-btn aria-describedby="loopback-help">Hear yourself as others will</button>
+ <meter id="loopback-level" min="0" max="1" value="0" aria-label="Recording and playback level"></meter></div>
<p id="loopback-help" class="calls-raw-help">Records five seconds from your microphone, with the same settings the call will use, and plays it back to you here. The recording never leaves this browser and is thrown away once it has played.</p>
<p id="loopback-result" class="calls-audio-result" role="status"></p>
</div>
+ </div>
<audio id="test-audio" hidden></audio>
</details>
</div>
</div>
</div>
-<div class="calls-holding-more">
+<div class="calls-holding-more" rst-stack rst-section>
{{/* Spec §15.26: for ten minutes after leaving a call, the call can
still be reported from here. report.js reveals it only when this
tab left this meeting's call that recently, and never without
diff --git a/internal/calls/templates/layout.html b/internal/calls/templates/layout.html
index 5ef08af..8f217cc 100644
--- a/internal/calls/templates/layout.html
+++ b/internal/calls/templates/layout.html
@@ -54,7 +54,7 @@
<div estilo-shell>
<a rst-skip href="#main">{{.Frame.Chrome.Labels.Skip}}</a>
{{template "estilo-bar" (withL (.Frame.Chrome) $L)}}
-<main rst-page id="main">
+<main rst-page rst-stack id="main">
{{template "content" .}}
</main>
</div>
diff --git a/internal/calls/templates/settings.html b/internal/calls/templates/settings.html
index 7a10124..90ad3a1 100644
--- a/internal/calls/templates/settings.html
+++ b/internal/calls/templates/settings.html
@@ -1,6 +1,6 @@
{{define "content"}}{{$L := localizer $}}
{{template "page-header" dict "L" $L "Title" "Settings"}}
-<section>
+<section rst-stack rst-section>
<h2>Meeting defaults</h2>
<p>Applies to new meetings created by anyone on this team. Existing meetings keep their own settings.</p>
{{if .Saved}}{{template "callout" dict "L" $L "Body" "Meeting defaults saved." "Tone" "positive"}}{{end}}
@@ -9,7 +9,7 @@
<div rst-form-actions><button type="submit" rst-btn="primary lg">Save defaults</button></div>
</form>
</section>
-<section>
+<section rst-stack rst-section>
<h2>Agents</h2>
{{if .Agents}}
<div rst-list class="calls-agents">
@@ -24,7 +24,7 @@
{{template "empty-state" dict "L" $L "Body" "No agents yet. An agent is a token a program uses to make and end meetings for you."}}
{{end}}
</section>
-<section>
+<section rst-stack rst-section>
<h2>Create an agent</h2>
<form rst-form method="post" action="/settings/agents">
{{template "field" dict "L" $L "ID" "name" "Name" "name" "Label" "Name" "Required" true "Maxlength" "64" "Error" .NameError "Value" .Name}}
diff --git a/internal/callstest/rhythm_browser_test.go b/internal/callstest/rhythm_browser_test.go
new file mode 100644
index 0000000..7df681b
--- /dev/null
+++ b/internal/callstest/rhythm_browser_test.go
@@ -0,0 +1,295 @@
+//go:build browser
+
+// Fiesta's rhythm audit over Calls' own pages, in a real Chromium
+// (test/browser/rhythm.mjs). `make browser` runs it.
+//
+// Paul, 2026-11-22: no ad-hoc spacing ("Can we somehow put something in
+// place to avoid weird spacing issues like this in future?"), then
+// "Release and start the rollout". `make ci` runs the stylesheet half
+// (go tool fiesta spacing); this is the half only a laid-out page can
+// answer: every gap between two blocks is a step of the scale, no text
+// rests on a control, and every heading sits closer to its own content
+// than to what comes before it.
+//
+// What it reads: the meetings list (empty, with upcoming and ended
+// meetings, the ended list open, the new-meeting form refused), Settings
+// (empty, with agents, saved, refused), a meeting's settings, the three
+// confirm pages, the meeting and agent pages shown once, Share, the
+// holding screen (a member's with script, with its audio test open, and
+// without script; a guest's), the guest's name page (and refused), the
+// app hand-off page, Welcome, and the Colophon under Help.
+//
+// What it does not: the call itself (room.html), whose window of video,
+// bar, PiP, tiles and speaking light is component geometry pinned to the
+// Mac app's, not a page's flow; its spacing allowances say so in
+// calls.css. The sign-in door is estilo's card and is audited in estilo
+// (6238a47). The error page is one component, rastrillo's rst-error,
+// which the audit reads as one block and which is Fiesta's to space.
+//
+// RHYTHM_SHOTS=<dir> keeps a screenshot of every state.
+//
+// Written against origin/main (9220b05) first, its static/ and
+// templates/ under this branch's go.mod: see the commit for the count.
+package callstest
+
+import (
+ "bufio"
+ "bytes"
+ "context"
+ "encoding/json"
+ "io"
+ "net/http"
+ "net/url"
+ "os"
+ "os/exec"
+ "regexp"
+ "strconv"
+ "strings"
+ "testing"
+ "time"
+
+ "amadan.net/rastrillo/fiesta/check/rhythm"
+)
+
+// rhythmSkip is what the audit does not read. The holding screen's
+// camera preview is a <video>, one block the audit measures and never
+// walks into, so nothing on the pages Calls draws needs naming.
+var rhythmSkip []string
+
+// rhythmState is one state of one page: where to go, the page's own
+// marker, who is looking, whether scripts run, and an optional step in
+// the page (submit a form, open a disclosure) with what to wait for after
+// it and the path it lands on.
+type rhythmState struct {
+ Name string `json:"name"`
+ Path string `json:"path"`
+ Marker string `json:"marker"`
+ // Root is what the audit reads: main, unless main holds only one
+ // region of somebody else's whose insides are the page, as the
+ // Colophon's [estilo-credits] (estilo's template) is.
+ Root string `json:"root"`
+ As string `json:"as"`
+ NoScript bool `json:"noScript"`
+ Act string `json:"act,omitempty"`
+ Then string `json:"then,omitempty"`
+ After string `json:"after,omitempty"`
+ // NoRefresh takes the page's meta refresh out (rhythm.mjs).
+ NoRefresh bool `json:"noRefresh,omitempty"`
+}
+
+// submitJS sends a form past the browser's own checks, so the server's
+// answer (its errors, or the page after) is what is drawn.
+func submitJS(form string) string {
+ return `HTMLFormElement.prototype.submit.call(document.querySelector(` + strconv.Quote(form) + `))`
+}
+
+// fillAndSubmitJS sets one field, to value and the time so that each
+// width's run makes a thing of its own, and sends the form.
+func fillAndSubmitJS(form, field, value string) string {
+ return `(() => { const f = document.querySelector(` + strconv.Quote(form) + `); f.querySelector(` + strconv.Quote(field) + `).value = ` +
+ strconv.Quote(value+"-") + ` + Date.now(); f.removeAttribute('target'); HTMLFormElement.prototype.submit.call(f); })()`
+}
+
+func TestEveryPageKeepsTheRhythm(t *testing.T) {
+ rig := newBrowserRig(t)
+
+ // Before anything exists: the empty lists.
+ empty := []rhythmState{
+ {Name: "the meetings, none yet", Path: "/", Marker: `form[action="/meetings/start"]`, As: "member"},
+ {Name: "Settings, no agents", Path: "/settings", Marker: `form[action="/settings/agents"]`, As: "member"},
+ }
+ found := rig.auditRhythm(t, empty)
+
+ sqid, token := rig.createMeeting(t)
+ ended, _ := rig.createMeeting(t)
+ rig.post(t, "/meetings/"+ended+"/end", url.Values{})
+ agentPage := rig.post(t, "/settings/agents", url.Values{"name": {"Diary"}})
+ m := regexp.MustCompile(`/settings/agents/(\d+)/revoke`).FindSubmatch(rig.get(t, "/settings"))
+ if m == nil {
+ t.Fatalf("no agent to revoke on /settings after creating one:\n%s", agentPage)
+ }
+ agent := string(m[1])
+ join := "/m/" + sqid + "/join"
+ states := []rhythmState{
+ {Name: "the meetings", Path: "/", Marker: `.calls-meetings [rst-row]`, As: "member"},
+ {Name: "the meetings, without script", Path: "/", Marker: `.calls-meetings [rst-row]`, As: "member", NoScript: true},
+ {Name: "the meetings, the ended list open", Path: "/", Marker: `details.calls-ended[open]`, As: "member",
+ Act: `document.querySelector('details.calls-ended').open = true`},
+ {Name: "a new meeting, refused", Path: "/", Marker: `[rst-field-error]`, As: "member",
+ Act: submitJS(`form[action="/meetings"]`), After: "/meetings"},
+ {Name: "a new meeting's link, shown once", Path: "/", Marker: `.calls-link-input`, As: "member",
+ Act: fillAndSubmitJS(`form[action="/meetings"]`, `[name="title"]`, "Weekly"), After: "/meetings"},
+ {Name: "Settings", Path: "/settings", Marker: `.calls-agents [rst-row]`, As: "member"},
+ {Name: "Settings, saved", Path: "/settings?saved=1", Marker: `[rst-callout]`, As: "member"},
+ {Name: "Settings, without script", Path: "/settings", Marker: `.calls-agents [rst-row]`, As: "member", NoScript: true},
+ {Name: "a new agent, refused", Path: "/settings", Marker: `[rst-field-error]`, As: "member",
+ Act: submitJS(`form[action="/settings/agents"]`), After: "/settings/agents"},
+ {Name: "an agent's token, shown once", Path: "/settings", Marker: `.calls-link-input`, As: "member",
+ Act: fillAndSubmitJS(`form[action="/settings/agents"]`, `[name="name"]`, "Ledger"), After: "/settings/agents"},
+ {Name: "a meeting's settings", Path: "/meetings/" + sqid + "/settings", Marker: `form[action$="/settings"] [rst-form-actions]`, As: "member"},
+ {Name: "a meeting's settings, saved", Path: "/meetings/" + sqid + "/settings?saved=1", Marker: `[rst-callout]`, As: "member"},
+ {Name: "End meeting, confirmed", Path: "/meetings/" + sqid + "/end", Marker: `form[action="/meetings/` + sqid + `/end"]`, As: "member"},
+ {Name: "Replace the link, confirmed", Path: "/meetings/" + sqid + "/links/replace", Marker: `form[action="/meetings/` + sqid + `/links"]`, As: "member"},
+ {Name: "Revoke an agent, confirmed", Path: "/settings/agents/" + agent + "/revoke", Marker: `form[action="/settings/agents/` + agent + `/revoke"]`, As: "member"},
+ {Name: "Share", Path: join, Marker: `#invitation-link`, As: "member",
+ Act: `(() => { const f = document.querySelector('form[action$="/share"]'); f.removeAttribute('target'); HTMLFormElement.prototype.submit.call(f); })()`,
+ After: "/m/" + sqid + "/share"},
+ {Name: "the holding screen", Path: join, Marker: `#join:not([disabled])`, As: "member"},
+ {Name: "the holding screen, its audio test open", Path: join, Marker: `#audio-test[open]`, As: "member",
+ Then: `#join:not([disabled])`, Act: `document.querySelector('#audio-test').open = true`},
+ {Name: "the holding screen, without script", Path: join, Marker: `.calls-holding-more`, As: "member", NoScript: true},
+ {Name: "the guest's name page", Path: "/j/" + token, Marker: `form[action="/j/` + token + `/guest"]`},
+ {Name: "the guest's name page, without script", Path: "/j/" + token, Marker: `form[action="/j/` + token + `/guest"]`, NoScript: true},
+ {Name: "the guest's name, refused", Path: "/j/" + token, Marker: `[rst-field-error]`,
+ Act: submitJS(`form[action="/j/` + token + `/guest"]`), After: "/j/" + token + "/guest"},
+ {Name: "a guest's holding screen", Path: "/j/" + token, Marker: `#join:not([disabled])`,
+ Act: fillAndSubmitJS(`form[action="/j/`+token+`/guest"]`, `[name="name"]`, "Ada"), After: join},
+ {Name: "Join in the app", Path: "/m/" + sqid + "/app", Marker: `#app-offer`, As: "member", NoScript: true, NoRefresh: true},
+ {Name: "Welcome", Path: "/welcome", Marker: `main h1`, As: "member"},
+ {Name: "the Colophon", Path: "/help/open-source", Marker: `[estilo-credits]`, Root: `[estilo-credits]`, As: "member"},
+ }
+ found += rig.auditRhythm(t, states)
+ t.Logf("%d finding(s) over %d states at two widths", found, len(empty)+len(states))
+}
+
+// auditRhythm runs rhythm.mjs over states at both widths, fails the
+// test on every finding, and returns how many there were.
+func (rig *browserRig) auditRhythm(t *testing.T, states []rhythmState) int {
+ t.Helper()
+ audits := map[string]string{}
+ for i := range states {
+ if states[i].Root == "" {
+ states[i].Root = "main"
+ }
+ audits[states[i].Root] = rhythm.Expression(states[i].Root, rhythm.Options{Skip: rhythmSkip})
+ }
+ cfg, err := json.Marshal(map[string]any{
+ "base": rig.origin,
+ "cookie": map[string]string{"name": rig.cookieName, "value": rig.cookieA},
+ "audits": audits,
+ "states": states,
+ "shots": os.Getenv("RHYTHM_SHOTS"),
+ })
+ if err != nil {
+ t.Fatal(err)
+ }
+ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
+ defer cancel()
+ cmd := exec.CommandContext(ctx, "node", "test/browser/rhythm.mjs")
+ cmd.Dir = repoRootForBrowser(t)
+ cmd.Stdin = bytes.NewReader(cfg)
+ var stderr bytes.Buffer
+ cmd.Stderr = &stderr
+ out, err := cmd.Output()
+ if err != nil {
+ t.Fatalf("node: %v\n%s", err, stderr.String())
+ }
+ byName := map[string]rhythmState{}
+ for _, s := range states {
+ byName[s.Name] = s
+ }
+ seen, total := 0, 0
+ sc := bufio.NewScanner(bytes.NewReader(out))
+ sc.Buffer(make([]byte, 1<<20), 1<<22)
+ for sc.Scan() {
+ var got struct {
+ Name string `json:"name"`
+ Width int `json:"width"`
+ Status int `json:"status"`
+ Path string `json:"path"`
+ Marker bool `json:"marker"`
+ Scripted bool `json:"scripted"`
+ Stack bool `json:"stack"`
+ Blocks int `json:"blocks"`
+ Found []rhythm.Finding `json:"found"`
+ Error string `json:"error"`
+ Ms int `json:"ms"`
+ }
+ if err := json.Unmarshal(sc.Bytes(), &got); err != nil {
+ t.Fatalf("node said %q", sc.Text())
+ }
+ seen++
+ s, ok := byName[got.Name]
+ if !ok {
+ t.Fatalf("node audited a state nobody named: %q", got.Name)
+ }
+ where := got.Name + " at " + strconv.Itoa(got.Width) + "px"
+ if got.Ms > 5000 {
+ t.Logf("%s took %dms", where, got.Ms)
+ }
+ if got.Error != "" {
+ t.Errorf("%s: %s", where, got.Error)
+ continue
+ }
+ if s.Act == "" && got.Status != http.StatusOK {
+ t.Errorf("%s: status %d", where, got.Status)
+ }
+ wantPath := s.After
+ if wantPath == "" {
+ wantPath, _, _ = strings.Cut(s.Path, "?")
+ }
+ if got.Path != wantPath {
+ t.Errorf("%s: the browser is on %s, not %s", where, got.Path, wantPath)
+ continue
+ }
+ if !got.Marker {
+ t.Errorf("%s: the page's own marker is missing", where)
+ continue
+ }
+ if got.Scripted == s.NoScript {
+ t.Errorf("%s: page scripts ran = %v, want %v", where, got.Scripted, !s.NoScript)
+ }
+ if !got.Stack {
+ t.Errorf("%s: <main> is not a stack (rst-stack, a flex column)", where)
+ }
+ if got.Blocks < 2 {
+ t.Errorf("%s: the audit had %d block(s) under %s to measure; it would pass vacuously", where, got.Blocks, s.Root)
+ }
+ if len(got.Found) > 0 {
+ total += len(got.Found)
+ t.Errorf("%s: %s", where, rhythm.Report(got.Found))
+ }
+ }
+ if seen != 2*len(states) {
+ t.Fatalf("node audited %d states, want %d\n%s", seen, 2*len(states), stderr.String())
+ }
+ return total
+}
+
+// post is member A sending a form, and the page it ends on.
+func (rig *browserRig) post(t *testing.T, path string, form url.Values) []byte {
+ t.Helper()
+ req, err := http.NewRequest(http.MethodPost, rig.origin+path, strings.NewReader(form.Encode()))
+ if err != nil {
+ t.Fatal(err)
+ }
+ req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
+ req.Header.Set("Origin", rig.origin)
+ req.AddCookie(&http.Cookie{Name: rig.cookieName, Value: rig.cookieA})
+ return rig.do(t, req)
+}
+
+// get is member A reading a page.
+func (rig *browserRig) get(t *testing.T, path string) []byte {
+ t.Helper()
+ req, err := http.NewRequest(http.MethodGet, rig.origin+path, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ req.AddCookie(&http.Cookie{Name: rig.cookieName, Value: rig.cookieA})
+ return rig.do(t, req)
+}
+
+func (rig *browserRig) do(t *testing.T, req *http.Request) []byte {
+ t.Helper()
+ res, err := http.DefaultClient.Do(req)
+ if err != nil {
+ t.Fatalf("%s %s: %v", req.Method, req.URL.Path, err)
+ }
+ defer res.Body.Close()
+ body, _ := io.ReadAll(res.Body)
+ if res.StatusCode != http.StatusOK {
+ t.Fatalf("%s %s: %d\n%s", req.Method, req.URL.Path, res.StatusCode, body)
+ }
+ return body
+}
diff --git a/test/browser/rhythm.mjs b/test/browser/rhythm.mjs
new file mode 100644
index 0000000..743fcd8
--- /dev/null
+++ b/test/browser/rhythm.mjs
@@ -0,0 +1,135 @@
+// Fiesta's rhythm audit over Calls' own pages, in a real Chromium
+// (internal/callstest/rhythm_browser_test.go, TestEveryPageKeepsTheRhythm).
+// Go starts the app, signs a member in and names the states; this opens
+// each one at a desktop width and a phone's, checks it is the page it was
+// asked for, and evaluates the audit Go hands it (rhythm.Expression) over
+// <main> (or the state's own root). It prints one JSON line per state and width; Go decides.
+//
+// The configuration comes on stdin, never argv: it carries the member's
+// session cookie, and a command line is readable by every process on
+// the box.
+//
+// {"base": "http://127.0.0.1:1234", "cookie": {"name": "…", "value": "…"},
+// "audits": {"main": "(function fiestaRhythm…)(\"main\", {…})"},
+// "states": [{"name": "the meetings", "path": "/", "marker": "…", "root": "main",
+// "as": "member", "noScript": false, "act": "", "then": "", "after": ""}]}
+//
+// A state's page is checked three ways before it is audited, so a pass
+// can never mean "the audit read some other page": the browser is on
+// the state's path (after its act, on the path "after" names), the
+// page's own marker is there, and <main> is a stack (rst-stack, laid out
+// by tokens.css as a flex column), which is the CSS under test. With
+// noScript the context runs no script at all, and the page says so: its
+// (scripting) media feature is none and its <noscript> is parsed as
+// markup.
+//
+// A state with noRefresh has its <meta http-equiv="refresh"> taken out
+// of the response (the app hand-off page's, which without script reloads
+// it every three seconds), so the page holds still to be measured.
+//
+// shots, when set, is a directory each state's screenshot is written to.
+import { chromium } from 'playwright';
+import { mkdirSync } from 'node:fs';
+import { join } from 'node:path';
+
+const chunks = [];
+for await (const chunk of process.stdin) chunks.push(chunk);
+const config = JSON.parse(Buffer.concat(chunks).toString('utf8'));
+
+// The holding screen's camera and microphone: Chromium's fakes, as the
+// call gate's, so the device panel is drawn as a person sees it.
+const browser = await chromium.launch({
+ headless: true,
+ args: ['--use-fake-device-for-media-stream', '--use-fake-ui-for-media-stream'],
+});
+
+// blocks is how many blocks the audit had to measure under the state's
+// root: its in-flow children with a box, through display: contents.
+// Fewer than two is a page with no gap to measure, which would pass
+// vacuously.
+const blocks = (root) => `((root) => {
+ const flow = (el) => [...el.children].flatMap((c) => {
+ const s = getComputedStyle(c);
+ if (s.display === 'contents') return flow(c);
+ if (s.display === 'none' || s.position === 'absolute' || s.position === 'fixed') return [];
+ const r = c.getBoundingClientRect();
+ return r.height > 0 && r.width > 0 ? [c] : [];
+ });
+ const el = document.querySelector(root);
+ return el ? flow(el).length : 0;
+})(${JSON.stringify(root)})`;
+
+const stack = `(() => {
+ const main = document.querySelector('main');
+ if (!main) return false;
+ const s = getComputedStyle(main);
+ return main.hasAttribute('rst-stack') && s.display === 'flex' && s.flexDirection === 'column';
+})()`;
+
+try {
+ for (const width of [1280, 390]) {
+ for (const state of config.states) {
+ const context = await browser.newContext({
+ viewport: { width, height: 900 },
+ colorScheme: 'light',
+ javaScriptEnabled: !state.noScript,
+ });
+ if (state.as === 'member') {
+ await context.addCookies([{ name: config.cookie.name, value: config.cookie.value, url: config.base }]);
+ }
+ const page = await context.newPage();
+ if (state.noRefresh) {
+ await page.route(config.base + state.path, async (route) => {
+ const response = await route.fetch();
+ const body = (await response.text()).replace(/<meta http-equiv="refresh"[^>]*>/g, '');
+ await route.fulfill({ response, body });
+ });
+ }
+ const out = { name: state.name, width };
+ const started = Date.now();
+ try {
+ const response = await page.goto(config.base + state.path, { waitUntil: 'load' });
+ out.status = response ? response.status() : 0;
+ if (state.act && state.after) {
+ // A step that sends a form: wait for the page it lands on.
+ await Promise.all([
+ page.waitForURL((u) => u.pathname === state.after, { waitUntil: 'load', timeout: 15000 }),
+ page.evaluate(state.act),
+ ]);
+ } else if (state.act) {
+ if (state.then) await page.waitForSelector(state.then, { state: 'attached', timeout: 15000 });
+ await page.evaluate(state.act);
+ }
+ await page.waitForSelector(state.marker, { state: 'attached', timeout: 15000 });
+ // Web fonts and the scripts' first layout pass settle before the
+ // gaps are read.
+ // (With no script there is no frame callback to wait on, and
+ // nothing of the page's own that moves anything.)
+ if (!state.noScript) {
+ await page.evaluate(() => document.fonts.ready.then(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)))));
+ }
+ out.path = new URL(page.url()).pathname;
+ out.marker = (await page.$(state.marker)) !== null;
+ // The document's own answer: (scripting: none) matches only where
+ // the browser runs no script for it (an evaluate from here still
+ // runs, so a marker set from here would prove nothing).
+ out.scripted = await page.evaluate("matchMedia('(scripting: enabled)').matches && !document.querySelector('noscript > *')");
+ out.stack = await page.evaluate(stack);
+ out.blocks = await page.evaluate(blocks(state.root));
+ out.found = await page.evaluate(config.audits[state.root]);
+ if (config.shots) {
+ mkdirSync(config.shots, { recursive: true });
+ const file = `${state.name.replace(/[^a-z0-9]+/gi, '-').toLowerCase()}-${width}.png`;
+ await page.screenshot({ path: join(config.shots, file), fullPage: true });
+ }
+ } catch (err) {
+ out.error = String(err && err.message || err).slice(0, 500);
+ }
+ out.ms = Date.now() - started;
+ process.stdout.write(JSON.stringify(out) + '\n');
+ await context.close();
+ }
+ }
+} finally {
+ await browser.close();
+}