Calls' pages on Fiesta's spacing scale: the stack, the spacing gate and the rhythm audit
Paul, 2026-11-22: "Release and start the rollout" (spacing-rollout BRIEF.md), with apps on rastrillo v0.45.0. Web only; native/ untouched. - rastrillo v0.42.0 -> v0.45.0 (Fiesta 1.6.1) and estilo -> 6238a47. tokens.css by rastrillo doctor --fix, brand.css by estilo's brand/distribute.py (the native icon it also copies left as it was), the credits by make credits. scripts/writeestilo had nothing to change. - <main> is rst-stack (layout.html), and so are the meeting list's and Settings' sections (rst-section), the ended list (rst-section), the holding screen's device panel, its audio test (button and meter on one line, then what it found) and the links under it. The holding screen's title is no longer wrapped (its 2rem size is [rst-page-header]:has(+ .calls-standing)), so the stack sees the page header. Hand margins between blocks are gone; the report sheet, a modal <dialog> that is a child of the stack on the holding screen, gets its auto margins back. The Colophon's heading and list are put on the stack's terms in calls-shell.css until estilo's credits template carries rst-stack. - Every other margin, padding and gap is var(--rst-sp-N) (value-identical at a 16px root). Allowances kept, each with its reason: the visually hidden pattern's -1px (two), chat's label tuck (-0.2rem), the no-script call header's card (10px 14px, 14px link gap, 6px), and the call window's own geometry, pinned to the Mac app's: the title strip (72px sides, 1px subtitle, the no-script sentence's title-height calc), the More menu and tile menu rows and insets (6px, 2px), the over-video pills (sharing, relay notice, sound banner, caption: 6px, 3px 10px, 2px), the admission queue's 6px rows, the speaker strip's bar-reserve lift, the paused cover's caption clearance (2rem, 1.75rem), the tile tools (2px), the bar (10px gap and inset), the unread badge (5px), the tooltip (10px), popovers (14px, 10px), the chat sidebar (14px) and the phone sheet's 6px. - Gates: make spacing (go tool fiesta spacing, tokens.css skipped) in make ci and .amadan/ci.d/60-spacing. In make browser, TestEveryPageKeepsTheRhythm (test/browser/rhythm.mjs) runs Fiesta's rhythm audit over 30 states at 1280 and 390px: the meeting list (empty, with meetings, ended list open, refused, link shown once, without script), Settings (empty, with agents, saved, refused, token shown once, without script), a meeting's settings, the three confirm pages, Share (with and without script), the holding screen (member, audio test open, no camera or microphone, without script; a guest's), the guest's name page (and refused, and without script), Join in the app, Welcome and the Colophon. Each is checked to be the requested path with its own marker, <main> a stack, at least two blocks measured, and scripts really off where named ((scripting: none), <noscript> parsed). The call room is not audited: its window is component geometry. - Before -> after: fiesta spacing over Calls' CSS 76 -> 0 (7 stylesheets); the rhythm audit on origin/main's static and templates, 168 findings on 37 of 56 state-widths (and <main> not a stack on all) -> 0. - Fallout from rastrillo v0.45: Config.KeymailServers (nil in production, as cmd/calls leaves it, and cmd/calls' tests boot the real process on that path) lets the tests name keymailtest's host or none: v0.45 dials a nil list on a clone of http.DefaultTransport, which panics on keymailtest's wrapper. The door tests pin rastrillo's new words, which never name Keymail. No app copy changed; sign-in flow unchanged. Review: Fable, APPROVE (no High or Medium). Lows fixed: the no-script call header's values kept rather than snapped, steps inside the allowed calc, [rst-empty] markers, no-media holding screen and no-script Share audited (the latter found and fixed a 20px gap under an empty status line). make ci green; make browser green (mutualshare, laterolls and connecting failed once under load and pass alone; laterolls fails the same way on origin/main); hub CI green at a98af02. Not deployed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from feat/rhythm into main.
30 files changed,
+749
−135
.amadan/ci.d/60-spacing+2 −0AGENTS.md+16 −0Makefile+18 −3go.mod+8 −4go.sum+8 −0internal/calls/auth.go+7 −6internal/calls/config.go+7 −0internal/calls/config_test.go+3 −0internal/calls/credits/notices.json+2 −2internal/calls/signin_browser_test.go+1 −1internal/calls/signin_door_states_test.go+2 −1internal/calls/signin_mail_test.go+6 −1internal/calls/static/brand/brand.css+1 −1internal/calls/static/calls-shell.css+22 −7internal/calls/static/calls.css+80 −82internal/calls/static/chat.css+1 −1internal/calls/static/noscript.css+2 −2internal/calls/static/tokens.css+84 −0internal/calls/templates/index.html+4 −4internal/calls/templates/join.html+16 −12internal/calls/templates/layout.html+1 −1internal/calls/templates/settings.html+3 −3internal/callstest/browser_test.go+1 −0internal/callstest/config_test.go+3 −2internal/callstest/harness_test.go+1 −0internal/callstest/main_test.go+7 −0internal/callstest/rhythm_browser_test.go+303 −0internal/callstest/schema_test.go+1 −1internal/callstest/signin_test.go+1 −1test/browser/rhythm.mjs+138 −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 (cached) ok amadan.net/oficina/calls/cmd/calls 13.402s ? amadan.net/oficina/calls/cmd/calls-contract [no test files] ok amadan.net/oficina/calls/cmd/quality-summary (cached) ? amadan.net/oficina/calls/gen [no test files] ok amadan.net/oficina/calls/gen/locales 0.002s ok amadan.net/oficina/calls/internal/calls 14.181s ok amadan.net/oficina/calls/internal/calls/apns (cached) ok amadan.net/oficina/calls/internal/calls/hub (cached) ? 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 (cached) ok amadan.net/oficina/calls/internal/calls/seal (cached) ? amadan.net/oficina/calls/internal/calls/teamstate [no test files] ok amadan.net/oficina/calls/internal/callstest 12.284s ok amadan.net/oficina/calls/protocol (cached) ? 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 106.235s ok amadan.net/oficina/calls/internal/calls/apns (cached) ok amadan.net/oficina/calls/internal/calls/hub (cached) ? 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 (cached) ok amadan.net/oficina/calls/internal/calls/seal (cached) ? amadan.net/oficina/calls/internal/calls/teamstate [no test files] ok amadan.net/oficina/calls/internal/callstest 48.255s === 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/go.mod b/go.mod| index 05d411a..c112358 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -4,12 +4,12 @@ go 1.26.0 |
| require ( |
| amadan.net/oficina/agent-access.git v0.0.0-20261025011012-4b94ff9e8a8d |
| - amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803 |
| + amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e |
| amadan.net/oficina/home/connect v0.0.0-20261122114341-150d94e2370f |
| amadan.net/oficina/home/handoff v0.0.0-20261122114341-150d94e2370f |
| amadan.net/oficina/home/roster v0.0.0-20261028171508-67c12e39a9d2 |
| amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2 |
| - amadan.net/rastrillo/rastrillo v0.42.0 |
| + amadan.net/rastrillo/rastrillo v0.45.0 |
| github.com/go-chi/chi/v5 v5.3.2 |
| github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 |
| github.com/google/uuid v1.6.0 |
| @@ -19,7 +19,7 @@ require ( |
| ) |
| require ( |
| - amadan.net/rastrillo/fiesta v1.5.0 // indirect |
| + amadan.net/rastrillo/fiesta v1.6.1 // indirect |
| amadan.net/rastrillo/rastrillo/money v0.1.0 // indirect |
| github.com/BurntSushi/toml v1.6.0 // indirect |
| github.com/carlosframework/rastrillo v0.23.0 // indirect |
| @@ -38,6 +38,7 @@ require ( |
| github.com/tdewolff/parse/v2 v2.8.16 // indirect |
| github.com/yosida95/uritemplate/v3 v3.0.2 // indirect |
| golang.org/x/mod v0.38.0 // indirect |
| + golang.org/x/net v0.58.0 // indirect |
| golang.org/x/oauth2 v0.35.0 // indirect |
| golang.org/x/sync v0.22.0 // indirect |
| golang.org/x/sys v0.47.0 // indirect |
| @@ -51,4 +52,7 @@ require ( |
| modernc.org/sqlite v1.55.0 // indirect |
| ) |
| -tool amadan.net/rastrillo/rastrillo/cmd/rastrillo |
| +tool ( |
| + amadan.net/rastrillo/fiesta/cmd/fiesta |
| + amadan.net/rastrillo/rastrillo/cmd/rastrillo |
| +) |
diff --git a/go.sum b/go.sum| index 3d63a2d..64d94a2 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -2,6 +2,8 @@ amadan.net/oficina/agent-access.git v0.0.0-20261025011012-4b94ff9e8a8d h1:bSsf1N |
| amadan.net/oficina/agent-access.git v0.0.0-20261025011012-4b94ff9e8a8d/go.mod h1:Ph9PIa3VE1IEaUzZiQH6D+IQ6HThWWGfVr0ecMMgrFA= |
| amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803 h1:yl1LyYZW3/722xRPnXMu5veg4sZGjyDMJFLqOWST0ws= |
| amadan.net/oficina/estilo.git v0.0.0-20261121233240-468fab16e803/go.mod h1:2UFIFrbTrhew8EFM0C94WmTo2OASM2pHEgT4jzeE/s8= |
| +amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e h1:g2EvXlQAleAEFsc4yIBvS7ycMG3GyuEySEOia0yo8nY= |
| +amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e/go.mod h1:2UFIFrbTrhew8EFM0C94WmTo2OASM2pHEgT4jzeE/s8= |
| amadan.net/oficina/home/connect v0.0.0-20261122114341-150d94e2370f h1:gnH04Aq06V9RVdv2OSdg+MqluUzsXZcnzSC+fUZ8gxg= |
| amadan.net/oficina/home/connect v0.0.0-20261122114341-150d94e2370f/go.mod h1:B45bHBZF5AtFJqy4d1qSDNDOqYcNkSz1qD20TLF1DI8= |
| amadan.net/oficina/home/handoff v0.0.0-20261122114341-150d94e2370f h1:KVdTBLD+GWe9WJLpxmkOAHOKAHKMNd6yuC+cIRzEg+w= |
| @@ -12,8 +14,12 @@ amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2 h1:0PQiRUkC+ |
| amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2/go.mod h1:dXBZeB2ic33SIZiGUCzafmviUT8TYWgzSYZvo2rM6zA= |
| amadan.net/rastrillo/fiesta v1.5.0 h1:wKfTsL5zRMofJBAqOxNlCY7aCtgHCtfwvTPBMA+ZA20= |
| amadan.net/rastrillo/fiesta v1.5.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY= |
| +amadan.net/rastrillo/fiesta v1.6.1 h1:WYgHt652+uQj6eR0Y0JLin+XrdRPGk1WPW7o0lSrc94= |
| +amadan.net/rastrillo/fiesta v1.6.1/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY= |
| amadan.net/rastrillo/rastrillo v0.42.0 h1:RJ0ecpdb2kMqwW9216bBpUqzpboxLYKb/51wq/+ceyo= |
| amadan.net/rastrillo/rastrillo v0.42.0/go.mod h1:0bufVMz8D4aWvxvJjehW70T8Jsvytrp1YEwoIzFTKm8= |
| +amadan.net/rastrillo/rastrillo v0.45.0 h1:zJfxetxg/H/CkCBFIvdGQbiATQ0hV3JR7H82AMk4bmM= |
| +amadan.net/rastrillo/rastrillo v0.45.0/go.mod h1:Vk7QL+RePyKtcP+7XclR9hpSDp/CjrVo37TENKifaFY= |
| amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM= |
| amadan.net/rastrillo/rastrillo/money v0.1.0/go.mod h1:cmgkjBEIQh1pFSYvQk0UU6oPYS8kSDypdT9+t4Flx0U= |
| github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= |
| @@ -82,6 +88,8 @@ golang.org/x/crypto v0.56.0 h1:GUh5Ii4J5jtcseSMiRqr1jXCNHoxjeV9Fmekc2oLy6Y= |
| golang.org/x/crypto v0.56.0/go.mod h1:OMW5y6CY9l38uPLmxU6l6pwcXp1obtLo3e6gT7gQR2I= |
| golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= |
| golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= |
| +golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= |
| +golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= |
| golang.org/x/oauth2 v0.35.0 h1:Mv2mzuHuZuY2+bkyWXIHMfhNdJAdwW3FuWeCPYN5GVQ= |
| golang.org/x/oauth2 v0.35.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= |
| golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= |
diff --git a/internal/calls/auth.go b/internal/calls/auth.go| index e1d4b45..471eadd 100644 |
| --- a/internal/calls/auth.go |
| +++ b/internal/calls/auth.go |
| @@ -57,12 +57,13 @@ func (a *app) newAuthPlugin(writer *sql.DB) (*rauth.Auth, error) { |
| // link and Forget lands on /signin, which with Home configured is |
| // connect's SigninDoor, offering Continue with Oficina ID |
| // (home/connect MIGRATING.md, item 3). |
| - SigninScreen: true, |
| - SigninOneWay: true, |
| - SigninPath: signinPath, |
| - ForgetPath: signinForgetPath, |
| - SignedInPath: landing, |
| - Logger: a.logger, |
| + SigninScreen: true, |
| + SigninOneWay: true, |
| + SigninPath: signinPath, |
| + ForgetPath: signinForgetPath, |
| + SignedInPath: landing, |
| + Logger: a.logger, |
| + KeymailServers: a.cfg.KeymailServers, |
| }) |
| } |
diff --git a/internal/calls/config.go b/internal/calls/config.go| index 84d8a5b..6bc0d2e 100644 |
| --- a/internal/calls/config.go |
| +++ b/internal/calls/config.go |
| @@ -106,6 +106,13 @@ type Config struct { |
| // `carlos logs --field` reads fields only from JSON lines. Nil is |
| // Logger. |
| ReportLogger *slog.Logger |
| + // KeymailServers is rastrillo/auth's Config.KeymailServers. Nil, as |
| + // cmd/calls leaves it, is any server an address's own _keymail |
| + // delegation names, which rastrillo (v0.45) dials at public addresses |
| + // only, on a transport of its own. Tests name their in-process fake's |
| + // host here (keymailtest), the one way a probe still goes through the |
| + // test's transport; an empty list is no Keymail at all. |
| + KeymailServers []string |
| } |
| func (cfg Config) development() bool { return cfg.Env == EnvDevelopment } |
diff --git a/internal/calls/config_test.go b/internal/calls/config_test.go| index 4e7e848..d463ffd 100644 |
| --- a/internal/calls/config_test.go |
| +++ b/internal/calls/config_test.go |
| @@ -21,6 +21,9 @@ func minimalConfig(t *testing.T) Config { |
| DEK: base64.StdEncoding.EncodeToString(make([]byte, 32)), |
| Mailer: failingSender{}, |
| AllowedAddresses: []string{"paul@example.com"}, |
| + // The fake's host, as buildForTest names it: rastrillo v0.45 |
| + // dials a nil list on a transport keymailtest cannot stand under. |
| + KeymailServers: []string{keymailHost}, |
| } |
| } |
diff --git a/internal/calls/credits/notices.json b/internal/calls/credits/notices.json| index fc779c8..917f381 100644 |
| --- a/internal/calls/credits/notices.json |
| +++ b/internal/calls/credits/notices.json |
| @@ -35,7 +35,7 @@ |
| }, |
| { |
| "Name": "amadan.net/rastrillo/fiesta", |
| - "Version": "v1.5.0", |
| + "Version": "v1.6.1", |
| "SourceURL": "https://amadan.net/rastrillo/fiesta", |
| "Notices": [ |
| { |
| @@ -46,7 +46,7 @@ |
| }, |
| { |
| "Name": "amadan.net/rastrillo/rastrillo", |
| - "Version": "v0.42.0", |
| + "Version": "v0.45.0", |
| "SourceURL": "https://amadan.net/rastrillo/rastrillo", |
| "Notices": [ |
| { |
diff --git a/internal/calls/signin_browser_test.go b/internal/calls/signin_browser_test.go| index c4e1b64..f7840d6 100644 |
| --- a/internal/calls/signin_browser_test.go |
| +++ b/internal/calls/signin_browser_test.go |
| @@ -71,7 +71,7 @@ func TestSmartDoorInABrowser(t *testing.T) { |
| {Name: "first visit", Path: "/signin", Glyph: true, want: "Continue with Oficina ID"}, |
| {Name: "Oficina ID remembered", Path: "/signin", Glyph: true, jar: jarFor(oficina), want: "Continue with Oficina ID"}, |
| {Name: "a long remembered email", Path: "/signin", jar: jarFor(&lastsignin.Record{Method: lastsignin.MethodMagicLink, Address: long}), want: "Continue as"}, |
| - {Name: "a long remembered Keymail", Path: "/signin", jar: jarFor(&lastsignin.Record{Method: lastsignin.MethodKeymail, Address: long}), want: "Continue to Keymail"}, |
| + {Name: "a long remembered Keymail", Path: "/signin", jar: jarFor(&lastsignin.Record{Method: lastsignin.MethodKeymail, Address: long}), want: "Continue as"}, |
| {Name: "the chooser", Path: "/signin?ways=1", jar: jarFor(&lastsignin.Record{Method: lastsignin.MethodMagicLink, Address: long}), want: "Other ways to sign in"}, |
| {Name: "the email way", Path: "/signin?way=email", want: "Email"}, |
| {Name: "email only", Path: "/signin/local", want: "Email"}, |
diff --git a/internal/calls/signin_door_states_test.go b/internal/calls/signin_door_states_test.go| index 9672326..c5c9ec2 100644 |
| --- a/internal/calls/signin_door_states_test.go |
| +++ b/internal/calls/signin_door_states_test.go |
| @@ -37,7 +37,8 @@ func TestDoorStatesWithHome(t *testing.T) { |
| {"a problem", "/signin?err=expired", email, "Problem signing in to Calls", []string{"That link has expired or was already used.", emailField}, []string{oficinaButton}}, |
| {"rate", "/signin?err=rate", nil, "Problem signing in to Calls", []string{"Too many tries."}, nil}, |
| {"a bad address", "/signin?err=address", nil, "Problem signing in to Calls", []string{"That doesn't look like an email address."}, nil}, |
| - {"Keymail failed", "/signin?force=1&err=keymail", nil, "Problem signing in to Calls", []string{`name="force" value="1"`, "Keymail couldn't confirm it's you."}, nil}, |
| + // rastrillo's own words since v0.45.0, which never name Keymail. |
| + {"Keymail failed", "/signin?force=1&err=keymail", nil, "Problem signing in to Calls", []string{`name="force" value="1"`, "We couldn't confirm it's you."}, []string{"Keymail"}}, |
| {"sent", "/signin?sent=1", email, "Check your email to sign in to Calls", []string{"Check your email", "Use a different email"}, []string{oficinaButton, emailField}}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
diff --git a/internal/calls/signin_mail_test.go b/internal/calls/signin_mail_test.go| index 999a8ad..2ed3aa9 100644 |
| --- a/internal/calls/signin_mail_test.go |
| +++ b/internal/calls/signin_mail_test.go |
| @@ -325,6 +325,11 @@ func TestMailQueueCloseIsBoundedWithAStalledLogger(t *testing.T) { |
| // build), so whoever builds an app closes its queue. |
| func buildForTest(t *testing.T, d *db.DB, cfg Config) (*http.ServeMux, *app, error) { |
| t.Helper() |
| + if cfg.KeymailServers == nil { |
| + // rastrillo v0.45 dials a nil list's servers on a transport of |
| + // its own, which keymailtest's cannot stand under: name the fake. |
| + cfg.KeymailServers = []string{keymailHost} |
| + } |
| mux, a, err := build(t.Context(), d, cfg) |
| if err == nil { |
| t.Cleanup(a.signinMail.close) |
| @@ -347,7 +352,7 @@ func TestShutdownStopsTheMailWorker(t *testing.T) { |
| } |
| t.Cleanup(func() { d.Close() }) |
| ctx, cancel := context.WithCancel(context.Background()) |
| - _, a, err := build(ctx, d, Config{Env: EnvDevelopment, Origin: "http://app.test", Logger: logger}) |
| + _, a, err := build(ctx, d, Config{Env: EnvDevelopment, Origin: "http://app.test", Logger: logger, KeymailServers: []string{keymailHost}}) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/calls/static/brand/brand.css b/internal/calls/static/brand/brand.css| index 27e25ad..475fb08 100644 |
| --- a/internal/calls/static/brand/brand.css |
| +++ b/internal/calls/static/brand/brand.css |
| @@ -3,7 +3,7 @@ |
| [estilo-brand] { |
| display: inline-flex; |
| align-items: center; |
| - gap: .5rem; |
| + gap: var(--rst-sp-2); |
| min-block-size: 24px; |
| } |
| [estilo-brand-icon] { |
diff --git a/internal/calls/static/calls-shell.css b/internal/calls/static/calls-shell.css| index 91490cc..8ab15a9 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 |
| @@ -32,11 +34,24 @@ body { background: var(--rst-bg); } |
| .calls-share-actions[hidden], .calls-share-actions > [hidden] { display: none; } |
| /* …and Share… inside it, which share-link.js reveals only where the |
| browser can share: rst-btn's display beats hidden the same way. */ |
| +/* The status line under Copy link and Share… keeps its line, so "Link |
| + copied." moves nothing; without script there is no row and nothing |
| + will ever be said, so it takes no space either (share-link.js reveals |
| + the row). */ |
| +#share-status { min-block-size: 1lh; } |
| +#share-actions[hidden] + #share-status { display: none; } |
| .calls-link-input { inline-size: 100%; max-inline-size: 44rem; } |
| /* 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..30ec1fe 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) + var(--rst-sp-6)) var(--rst-sp-5) var(--rst-sp-5); /* 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..786ce2b 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) 14px; /* spacing-allow: the no-script call header's links, 14px apart as the scripted strip's */ margin: 6px 0 0; /* spacing-allow: the links sit 6px under the title on the call header's card */ 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/static/tokens.css b/internal/calls/static/tokens.css| index 3ae9664..07f8b10 100644 |
| --- a/internal/calls/static/tokens.css |
| +++ b/internal/calls/static/tokens.css |
| @@ -2476,6 +2476,90 @@ small.rst-field__hint, small[rst-field-hint] { display: block; font-size: var(-- |
| and every caller writes by hand, is rst-form-bar now. */ |
| .rst-form-foot, [rst-form-foot] { display: flex; gap: var(--rst-sp-3); margin-block-start: var(--rst-sp-3); } |
| +/* ── stack: a page's vertical rhythm ────────────────────────────────── |
| + The blocks a screen is written in, a heading, a paragraph, a hint, a |
| + card, a row of buttons, are spaced by the stack they sit in and by |
| + nothing else. Hand-rolled margins gave every screen its own rhythm: |
| + a heading further from its own text than from the section before |
| + it, a hint resting on the button under it. So a stack is a flex |
| + column, where no margin collapses, every child's own block margins |
| + are zeroed, and the space before each child is read off one table |
| + by what it is and what it follows (DESIGN.md, "Spacing"): |
| + |
| + after a heading (h1 to h6) --rst-sp-2 |
| + before an actions row, a button --rst-sp-4 |
| + a label or hint, then its input, or an |
| + input, then its hint --rst-sp-2 |
| + before h1, h2 or a section, or after |
| + the page header --rst-sp-5 |
| + before h3 to h6 --rst-sp-4 |
| + anything else --rst-sp-3 |
| + |
| + Higher in the table wins. Each relation sets its own custom property |
| + on the child, and the one margin rule reads them in the table's |
| + order through var() fallbacks, so which rule wins is written in one |
| + place rather than left to specificity. Every child resets all five |
| + first, so a nested stack's child never inherits its parent's answer. |
| + rst-section marks a child that opens a new section; a section that |
| + holds blocks of its own is a stack too, <section rst-stack |
| + rst-section>. |
| + |
| + The column's gap is the table's smallest step, --rst-sp-2, and a |
| + child's block-start margin is the rest of its answer. The gap is |
| + the floor: it falls only between children that are drawn, so a |
| + [hidden] child, which a sibling selector cannot see past, costs the |
| + block after it its relation but never leaves it touching. A hidden |
| + input, a form's CSRF field, is passed over the same way, so the |
| + first block after one still opens the stack flush. */ |
| +.rst-stack, [rst-stack] { display: flex; flex-direction: column; gap: var(--rst-sp-2); } |
| +.rst-stack > :not([hidden]), [rst-stack] > :not([hidden]) { |
| + --rst-stack-actions: initial; |
| + --rst-stack-heading: initial; |
| + --rst-stack-control: initial; |
| + --rst-stack-section: initial; |
| + --rst-stack-sub: initial; |
| + margin-block: 0; |
| +} |
| +.rst-stack > :not([hidden], [type="hidden"]) + :not([hidden]), [rst-stack] > :not([hidden], [type="hidden"]) + :not([hidden]) { |
| + margin-block-start: calc(var(--rst-stack-heading, var(--rst-stack-actions, var(--rst-stack-control, var(--rst-stack-section, var(--rst-stack-sub, var(--rst-sp-3)))))) - var(--rst-sp-2)); |
| +} |
| +/* A column stretches its children across; a button or a picture keeps |
| + its own width. */ |
| +.rst-stack > button, [rst-stack] > button, .rst-stack > .rst-btn, [rst-stack] > [rst-btn], .rst-stack > img, [rst-stack] > img { align-self: flex-start; } |
| +.rst-stack > :not([hidden], [type="hidden"]) + h3, [rst-stack] > :not([hidden], [type="hidden"]) + h3, |
| +.rst-stack > :not([hidden], [type="hidden"]) + h4, [rst-stack] > :not([hidden], [type="hidden"]) + h4, |
| +.rst-stack > :not([hidden], [type="hidden"]) + h5, [rst-stack] > :not([hidden], [type="hidden"]) + h5, |
| +.rst-stack > :not([hidden], [type="hidden"]) + h6, [rst-stack] > :not([hidden], [type="hidden"]) + h6 { --rst-stack-sub: var(--rst-sp-4); } |
| +.rst-stack > :not([hidden], [type="hidden"]) + h1, [rst-stack] > :not([hidden], [type="hidden"]) + h1, |
| +.rst-stack > :not([hidden], [type="hidden"]) + h2, [rst-stack] > :not([hidden], [type="hidden"]) + h2, |
| +.rst-stack > :not([hidden], [type="hidden"]) + .rst-section, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-section], |
| +.rst-stack > .rst-page-header + :not([hidden]), [rst-stack] > [rst-page-header] + :not([hidden]) { --rst-stack-section: var(--rst-sp-5); } |
| +.rst-stack > label + input:not([hidden]), [rst-stack] > label + input:not([hidden]), |
| +.rst-stack > label + select:not([hidden]), [rst-stack] > label + select:not([hidden]), |
| +.rst-stack > label + textarea:not([hidden]), [rst-stack] > label + textarea:not([hidden]), |
| +.rst-stack > .rst-field__help + input:not([hidden]), [rst-stack] > [rst-field-help] + input:not([hidden]), |
| +.rst-stack > .rst-field__help + select:not([hidden]), [rst-stack] > [rst-field-help] + select:not([hidden]), |
| +.rst-stack > .rst-field__help + textarea:not([hidden]), [rst-stack] > [rst-field-help] + textarea:not([hidden]), |
| +.rst-stack > input + .rst-field__help, [rst-stack] > input + [rst-field-help], |
| +.rst-stack > select + .rst-field__help, [rst-stack] > select + [rst-field-help], |
| +.rst-stack > textarea + .rst-field__help, [rst-stack] > textarea + [rst-field-help] { --rst-stack-control: var(--rst-sp-2); } |
| +.rst-stack > h1 + :not([hidden]), [rst-stack] > h1 + :not([hidden]), |
| +.rst-stack > h2 + :not([hidden]), [rst-stack] > h2 + :not([hidden]), |
| +.rst-stack > h3 + :not([hidden]), [rst-stack] > h3 + :not([hidden]), |
| +.rst-stack > h4 + :not([hidden]), [rst-stack] > h4 + :not([hidden]), |
| +.rst-stack > h5 + :not([hidden]), [rst-stack] > h5 + :not([hidden]), |
| +.rst-stack > h6 + :not([hidden]), [rst-stack] > h6 + :not([hidden]) { --rst-stack-heading: var(--rst-sp-2); } |
| +.rst-stack > :not([hidden], [type="hidden"]) + .rst-actions, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-actions], |
| +.rst-stack > :not([hidden], [type="hidden"]) + .rst-form-foot, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-form-foot], |
| +.rst-stack > :not([hidden], [type="hidden"]) + .rst-form-actions, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-form-actions], |
| +.rst-stack > :not([hidden], [type="hidden"]) + button, [rst-stack] > :not([hidden], [type="hidden"]) + button, |
| +.rst-stack > :not([hidden], [type="hidden"]) + .rst-btn, [rst-stack] > :not([hidden], [type="hidden"]) + [rst-btn] { --rst-stack-actions: var(--rst-sp-4); } |
| +/* The actions row: buttons, links styled as buttons, and the one-button |
| + forms a POST action needs, side by side and wrapping on a phone. A |
| + form stays a box (display: contents would make it one no driver can |
| + see), and a one-button form is as wide as its button. */ |
| +.rst-actions, [rst-actions] { align-items: center; display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); } |
| + |
| @media (prefers-reduced-motion: reduce) { |
| .rst-switch__track, [rst-switch-track], .rst-switch[data-rst-settle] .rst-switch__track, [rst-switch][data-rst-settle] [rst-switch-track], .rst-tblock > .rst-tblock__head[data-rst-settle] > .rst-switch__track, [rst-tblock] > [rst-tblock-head][data-rst-settle] > [rst-switch-track] { transition: none; } |
| } |
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/browser_test.go b/internal/callstest/browser_test.go| index 7fa4a8d..041a27e 100644 |
| --- a/internal/callstest/browser_test.go |
| +++ b/internal/callstest/browser_test.go |
| @@ -424,6 +424,7 @@ func (rig *browserRig) serve(t *testing.T, ln net.Listener) { |
| Mailer: rig.mail, |
| Logger: slog.New(slog.NewTextHandler(io.Discard, nil)), |
| ReportLogger: slog.New(slog.NewJSONHandler(&rig.reports, nil)), |
| + KeymailServers: noKeymail, |
| }) |
| if err != nil { |
| t.Fatalf("calls.NewForTest: %v", err) |
diff --git a/internal/callstest/config_test.go b/internal/callstest/config_test.go| index 98828e1..d537c77 100644 |
| --- a/internal/callstest/config_test.go |
| +++ b/internal/callstest/config_test.go |
| @@ -47,6 +47,7 @@ func TestProductionRefusesToStartWithoutSecrets(t *testing.T) { |
| "no allowlist": {Env: "production", Origin: "https://x.test", InstanceKey: "k", DEK: validDEK, Mailer: nopMailer{}}, |
| } |
| for name, cfg := range cases { |
| + cfg.KeymailServers = noKeymail |
| if _, rt, err := calls.App(testCtx(t), openDB(t), cfg); err == nil { |
| rt.Close() |
| t.Errorf("%s: production started without it", name) |
| @@ -55,7 +56,7 @@ func TestProductionRefusesToStartWithoutSecrets(t *testing.T) { |
| } |
| func TestDevelopmentStartsWithNothing(t *testing.T) { |
| - _, rt, err := calls.App(testCtx(t), openDB(t), calls.Config{Env: calls.EnvDevelopment}) |
| + _, rt, err := calls.App(testCtx(t), openDB(t), calls.Config{Env: calls.EnvDevelopment, KeymailServers: noKeymail}) |
| if err != nil { |
| t.Fatalf("development refused: %v", err) |
| } |
| @@ -63,7 +64,7 @@ func TestDevelopmentStartsWithNothing(t *testing.T) { |
| } |
| func TestBadDEKIsRefusedEvenInDevelopment(t *testing.T) { |
| - _, rt, err := calls.App(testCtx(t), openDB(t), calls.Config{Env: calls.EnvDevelopment, DEK: "not base64!"}) |
| + _, rt, err := calls.App(testCtx(t), openDB(t), calls.Config{Env: calls.EnvDevelopment, DEK: "not base64!", KeymailServers: noKeymail}) |
| if err == nil { |
| rt.Close() |
| } |
diff --git a/internal/callstest/harness_test.go b/internal/callstest/harness_test.go| index f4accd8..7fef40a 100644 |
| --- a/internal/callstest/harness_test.go |
| +++ b/internal/callstest/harness_test.go |
| @@ -259,6 +259,7 @@ func newHarnessWith(t *testing.T, env string, logger *slog.Logger, adjust func(* |
| rec := &recordingMailer{} |
| cfg := calls.Config{ |
| Env: env, Origin: testOrigin, AllowedAddresses: members, Mailer: rec, Logger: logger, |
| + KeymailServers: noKeymail, |
| } |
| if env != calls.EnvDevelopment { |
| cfg.InstanceKey = "test-instance-key-not-a-real-secret" |
diff --git a/internal/callstest/main_test.go b/internal/callstest/main_test.go| index 8abb9fc..5f0366e 100644 |
| --- a/internal/callstest/main_test.go |
| +++ b/internal/callstest/main_test.go |
| @@ -40,6 +40,13 @@ func TestMain(m *testing.M) { |
| os.Exit(code) |
| } |
| +// noKeymail is every test app's KeymailServers: none, so every address |
| +// is plain email without a lookup, as the NXDOMAIN resolver above makes |
| +// it anyway. Production leaves the list nil, and rastrillo (v0.45) dials |
| +// a nil list's servers on a transport of its own, a clone of |
| +// http.DefaultTransport that panics on keymailtest's wrapper. |
| +var noKeymail = []string{} |
| + |
| // mailWorkers counts goroutines running a sign-in mail queue's worker |
| // or log pump (internal/calls/signin_mail.go). |
| func mailWorkers() int { |
diff --git a/internal/callstest/rhythm_browser_test.go b/internal/callstest/rhythm_browser_test.go| new file mode 100644 |
| index 0000000..5de8957 |
| --- /dev/null |
| +++ b/internal/callstest/rhythm_browser_test.go |
| @@ -0,0 +1,303 @@ |
| +//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 (with |
| +// script and without), the holding screen (a member's with script, with |
| +// its audio test open, with no camera or microphone to reach, 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"` |
| + // NoMedia takes navigator.mediaDevices away before the page's |
| + // scripts run, as an insecure context or an old browser has it. |
| + NoMedia bool `json:"noMedia,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: `main [rst-empty]`, As: "member"}, |
| + {Name: "Settings, no agents", Path: "/settings", Marker: `main [rst-empty]`, 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: "Share, without script", Path: join, Marker: `#invitation-link`, As: "member", NoScript: true, |
| + Act: `(() => { const f = document.querySelector('form[action$="/share"]'); f.removeAttribute('target'); HTMLFormElement.prototype.submit.call(f); })()`, |
| + After: "/m/" + sqid + "/share"}, |
| + {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, no camera or microphone to reach", Path: join, Marker: `#join:not([disabled])`, As: "member", NoMedia: 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/internal/callstest/schema_test.go b/internal/callstest/schema_test.go| index 5cb4bd1..64e7935 100644 |
| --- a/internal/callstest/schema_test.go |
| +++ b/internal/callstest/schema_test.go |
| @@ -8,7 +8,7 @@ import ( |
| func TestBootCreatesEveryTable(t *testing.T) { |
| d := openDB(t) |
| - _, rt, err := calls.App(testCtx(t), d, calls.Config{Env: calls.EnvDevelopment}) |
| + _, rt, err := calls.App(testCtx(t), d, calls.Config{Env: calls.EnvDevelopment, KeymailServers: noKeymail}) |
| if err != nil { |
| t.Fatal(err) |
| } |
diff --git a/internal/callstest/signin_test.go b/internal/callstest/signin_test.go| index e89f790..1fa65ca 100644 |
| --- a/internal/callstest/signin_test.go |
| +++ b/internal/callstest/signin_test.go |
| @@ -91,7 +91,7 @@ func TestSigninOverAFailingMailerLeavesNoAddressInTheLog(t *testing.T) { |
| failing := &failingMailer{err: fmt.Errorf("rastrillo/mail: send to %s: %w", address, errFakeSMTPFailure)} |
| mux, rt, err := calls.App(testCtx(t), d, calls.Config{ |
| Env: calls.EnvDevelopment, Origin: testOrigin, AllowedAddresses: []string{address}, |
| - Mailer: failing, Logger: logger, |
| + Mailer: failing, Logger: logger, KeymailServers: noKeymail, |
| }) |
| if err != nil { |
| t.Fatal(err) |
diff --git a/test/browser/rhythm.mjs b/test/browser/rhythm.mjs| new file mode 100644 |
| index 0000000..83d8c38 |
| --- /dev/null |
| +++ b/test/browser/rhythm.mjs |
| @@ -0,0 +1,138 @@ |
| +// 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.noMedia) { |
| + await context.addInitScript(() => { Object.defineProperty(Navigator.prototype, 'mediaDevices', { get: () => undefined }); }); |
| + } |
| + 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(); |
| +} |