oficina / mapa Public

Every screen on the spacing scale: Fiesta's stack, spacing check and rhythm audit

Paul, 2026-11-22: "Release and start the rollout", with every app on
rastrillo v0.45.0. Level-up build note 89.

- rastrillo v0.45.0 (was a v0.35.1 pseudo-version), Fiesta v1.6.1 (was
  1.3.0, now also a go tool), estilo 6238a47. Credits regenerated. The
  new signin package is not adopted. CLDR 48 numbers (rastrillo v0.37.0):
  the three tests pinning fr and es now pin U+202F and 1234.
- [mapa-doc] is rst-stack on every signed-in screen; the doc head is the
  page header, the body a section, the foot's references a stacked
  section; Search's label and row a Fiesta field.
- c66189f's local copies are gone: mapa-stack, mapa-section and
  mapa-action-row for rst-stack, rst-section and rst-actions, and the
  vendored audit for amadan.net/rastrillo/fiesta/check/rhythm.
- make spacing (go tool fiesta spacing internal/mapa/static) in make ci
  and CI step 35-spacing: 171 declarations refused on main (118 off the
  scale, 53 steps typed by hand), none now, 46 allowances with reasons.
- TestEveryScreenKeepsTheRhythm audits 23 screens at 1280 and 390px,
  scripts off and on: 133 findings on main's CSS, none now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 8f032dc42099e8b39dcfb169d44b18535a5e7eb4 parent 73ad257
35 files changed, +385 −671
  • .amadan/ci.d/35-spacing +3 −0
  • AGENTS.md +8 −5
  • Makefile +11 −2
  • docs/superpowers/specs/2026-11-14-mapa-level-up.md +7 −0
  • go.mod +8 −4
  • go.sum +10 −12
  • internal/mapa/credits/notices.json +2 −2
  • internal/mapa/locale/locale_test.go +5 −5
  • internal/mapa/locales_test.go +1 −1
  • internal/mapa/static/frame.css +68 −60
  • internal/mapa/static/history.css +18 −19
  • internal/mapa/static/links.css +36 −34
  • internal/mapa/static/mapa.css +32 −141
  • internal/mapa/static/palette.css +15 −15
  • internal/mapa/static/prose.css +23 −23
  • internal/mapa/templates/day.html +2 −2
  • internal/mapa/templates/frame.html +1 −1
  • internal/mapa/templates/help_markdown.html +1 −1
  • internal/mapa/templates/import.html +6 −8
  • internal/mapa/templates/import_confirm.html +1 −3
  • internal/mapa/templates/look.html +2 −2
  • internal/mapa/templates/page.html +2 −2
  • internal/mapa/templates/partials.html +4 −4
  • internal/mapa/templates/revision.html +1 −1
  • internal/mapa/templates/scratch_new.html +1 −1
  • internal/mapa/templates/search.html +3 −1
  • internal/mapa/templates/shell.html +1 −1
  • internal/mapatest/import_rhythm_browser_test.go +5 −66
  • internal/mapatest/island_test.go +2 −2
  • internal/mapatest/locale_test.go +1 −1
  • internal/mapatest/rhythm_browser_test.go +101 −0
  • internal/mapatest/testdata/rhythm/README +0 −5
  • internal/mapatest/testdata/rhythm/rhythm.js +0 −245
  • internal/mapatest/title_test.go +2 −1
  • internal/mapatest/week_strip_test.go +2 −1

CI passed — run details

CI log
=== editor ===
cd editor && npm ci --no-audit --no-fund --loglevel=error

added 16 packages in 299ms
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.bad1b29c273b6a86.js (364471 bytes, 114.4KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ a badge is named for what it does, starting with its visible word (0.856233ms)
✔ first words stop at five words or forty characters (0.14862ms)
✔ the field keeps one trimmed line, without brackets (0.228791ms)
✔ the field holds at most MaxAlt bytes, cut at a character (0.421765ms)
✔ a block becomes column 1 of two, and undo gives it back (12.419764ms)
✔ a selection over blocks moves them all into column 1 (2.496144ms)
✔ no layout is made inside a layout (0.770231ms)
✔ Add a column, Remove this column and Undo columns (6.136814ms)
✔ Undo columns puts the blocks in reading order (0.826998ms)
✔ Backspace in an empty column takes the column away (1.101115ms)
✔ ⌥⌘→ and ⌥⌘← move between columns (0.644204ms)
✔ typing a fence line in a column never closes it (D16) (7.92212ms)
✔ a selection holding a layout makes no nested layout (H1) (3.612627ms)
✔ a fence typed after a break in a column stays in the column (H2) (3.996831ms)
✔ code holding a fence line and ::: stays code in its column (H2) (3.589384ms)
✔ Backspace after a layout and Delete before one join nothing (M4) (0.698998ms)
✔ deleting across columns keeps every column (M3) (2.853077ms)
✔ a layout pasted into a column arrives as its blocks (M1) (3.371954ms)
✔ copying inside one column puts no fence on the clipboard (M2) (0.287592ms)
✔ typing goes on in the column after a structural reparse (round 2) (6.322834ms)
✔ a structural reparse in a column leaves code as it was (round 2) (2.859849ms)
✔ days and weeks move across months and years (2.455528ms)
✔ a month keeps the day, or takes the month's last (0.268466ms)
✔ the grid is six weeks from Monday, as the month calendar draws it (0.539747ms)
✔ the grid starts the week where the locale does (0.752839ms)
✔ the keys move a day, a week, a month and a year (0.229823ms)
✔ the picked day is the chip [[ makes for a date (32.189588ms)
✔ Insert → Today's date still puts today in at once (1.996864ms)
✔ / offers Date, the picker, and Today's date beside it (0.335092ms)
✔ after a ! the chip goes in after a space, never as an embed (3.395448ms)
✔ where the Markdown would read the chip differently, it is refused (2.702993ms)
✔ over a selection the chip goes after it and the words stay (2.330381ms)
✔ today is the day in the viewer's zone (14.259181ms)
✔ every offered locale has cases (0.817421ms)
✔ dates.mjs writes every date Go writes, byte for byte (2.549705ms)
✔ a chip, the month and the week, in three locales (0.367553ms)
✔ dates.json is what ICU gives, byte for byte (456.268523ms)
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (100.53467ms)
ℹ 904 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (80.688431ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (138.866051ms)
ℹ 891 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (148.689304ms)
ℹ 899 inserts, 837 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (4969.595841ms)
ℹ 21696 edits over 904 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (1208.09598ms)
ℹ 4724 links over 904 bodies; refused: {"A page link can’t hold another link or a line break. Select plain words.":945,"A page link can’t show [ or ]]. Select words without them.":404,"Select some words to link them to a page.":174,"Linked here, the Markdown around these words would read differently: a ! before them makes an embed, and a stray ` or * pairs up. Select other words.":18}
✔ L3: a picked date is one more date chip, or refused where a letter would be too (1291.49676ms)
ℹ over 904 bodies: {"inserted":5356,"spaced":23,"refused":45,"unstable":9}
✔ linear: trailing spaces (37.749547ms)
✔ linear: trailing whitespace (50.22645ms)
✔ linear: unclosed web links (21.478113ms)
✔ linear: web links with no address (23.023135ms)
✔ linear: unclosed wiki links (28.910249ms)
✔ linear: unclosed embeds (15.836172ms)
✔ linear: closes only (6.578186ms)
✔ the selected words become the chip's shown text (14.29056ms)
✔ words that are the title make a plain [[Title]] (5.315266ms)
✔ spaces at the selection's edges stay outside the chip (1.364121ms)
✔ a date makes a date link, in a heading, an item and a quote (8.460885ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (1.813327ms)
✔ only the linked block's bytes change, and undo gives the body back (3.671649ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (2.014266ms)
✔ a target the words cannot be linked to as typed is refused (0.36619ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (2.933077ms)
✔ web-linked words are refused: the address would be lost (review M4) (1.845839ms)
✔ words whose Markdown would read otherwise are refused (review M3) (2.622942ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (1.734999ms)
✔ linkCheck says why it refuses (review low 2) (1.547857ms)
✔ golden file has bodies (1.03459ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (46.604955ms)
✔ markup.mjs strips and spans every block as Go does (48.331085ms)
✔ the schema's toDOM draws every body as Go renders it (57.859973ms)
✔ emphasis draws the four pinned outputs (16.921668ms)
✔ a body ends in the editor's empty paragraph (0.204175ms)
✔ the editor labels date chips as Go does, in every locale L4 holds (9.024255ms)
✔ a POST that never answers is aborted after the timeout (22.259077ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (5.352035ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (13.463671ms)
✔ an offered draft never commits by itself; Save commits it (1.054738ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.470437ms)
✔ closing carries text not yet sent, and the cap leaves it out (26.557377ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (2.93988ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (2.303571ms)
✔ typing mid-flight: the merge is not applied and the base does not move (0.991108ms)
✔ a merge the editor cannot represent stops after three tries (3.39019ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.181767ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.304247ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (0.771885ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (0.73203ms)
✔ noBase and gone lead to the existing choices (1.573334ms)
✔ a commit that merged is applied when nothing was typed since (1.020953ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (7.462162ms)
✔ an own draft committed meanwhile goes on as a new draft (1.834607ms)
✔ a reload keeps a stored draft; unsent text still commits (0.821709ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.973859ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (3.513911ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (1.399897ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (2.826747ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (2.085379ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.593869ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (1.636884ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.788686ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (1.213748ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.991439ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (1.070358ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (6.346499ms)
✔ marks close before code, links and atoms, and reopen after (0.478432ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (8.030935ms)
✔ empty blocks are written as nothing (4.434266ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.846319ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.809595ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (3.289991ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (3.795533ms)
✔ a trailing hard break stays on screen and is written as nothing (1.14649ms)
✔ the reparse waits while an IME is composing (1.283548ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (5.806862ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.773678ms)
✔ rebuild changes origins only, outside undo history (3.723217ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (2.370627ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (2.21837ms)
✔ a duplicate ^id typed above its holder never takes the id from it (1.491721ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.933804ms)
✔ a history command that throws is refused, never thrown (7.98063ms)
✔ an image re-emits its source, and an edited alt changes only its span (1.292266ms)
✔ a paste whose image copy is refused says why and pastes nothing (16.369647ms)
✔ a line of image openers reads in linear time (102.638066ms)
✔ a line of shared link address reads in linear time (8.801176ms)
✔ a line of shared web address reads in linear time (46.440573ms)
✔ one rename at a time, from either field (2.592356ms)
✔ an empty or unchanged title sends nothing (0.208523ms)
✔ a refusal keeps what was typed, and the title (0.393953ms)
✔ the pending state holds for the busy rule (9.47794ms)
✔ a failed POST says so and keeps the title (0.895437ms)
✔ Update links posts the confirm page's POST (0.252626ms)
✔ clean is CleanTitle's whitespace rule (0.457702ms)
✔ the saver's base follows a rename made over it, and only that (0.310595ms)
✔ closing sends the rename as one keepalive POST (3.320448ms)
✔ the port answers every shared case as typeddate.go does (7.165443ms)
✔ numbers follow the locale: 12/11 is November in en-IE, December in en-US (0.285949ms)
✔ M6: several files land in the order they were chosen (41.545149ms)
✔ M5: one Backspace before the box keeps the image where the box is (12.250375ms)
✔ M5: undoing text typed just before the box keeps the upload (11.830755ms)
✔ L12: a failed upload an undo takes away does not stall the next (12.918733ms)
✔ M4: Replace… keeps the old image until the new one is in, and its alt (13.654682ms)
✔ M3 and N1: text wins, except over a picture copied from a page (1.338552ms)
✔ N2: a JPEG over 10 MB is scaled before its size is checked (6.62801ms)
✔ a drag whose anchor the document no longer reaches selects to its end (6.486093ms)
ℹ tests 143
ℹ suites 0
ℹ pass 143
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 8065.374994
=== vet ===
go vet ./...
go vet -tags browser ./internal/mapatest/
=== fmt ===
=== code ===
go tool rastrillo budget code
The base has no .rastrillo/code.txt: skipping the check that records only go down.
budget code: within the limits.
=== spacing ===
go tool fiesta spacing internal/mapa/static
=== test ===
CGO_ENABLED=0 go test ./...
?   	amadan.net/oficina/mapa/cmd/mapa	[no test files]
ok  	amadan.net/oficina/mapa/internal/mapa	4.506s
ok  	amadan.net/oficina/mapa/internal/mapa/emoji	0.008s
?   	amadan.net/oficina/mapa/internal/mapa/icons	[no test files]
ok  	amadan.net/oficina/mapa/internal/mapa/imagefile	0.155s
ok  	amadan.net/oficina/mapa/internal/mapa/locale	0.006s
ok  	amadan.net/oficina/mapa/internal/mapa/markup	0.133s
ok  	amadan.net/oficina/mapa/internal/mapa/notionmd	0.283s
ok  	amadan.net/oficina/mapa/internal/mapa/seal	0.003s
ok  	amadan.net/oficina/mapa/internal/mapatest	14.324s
?   	amadan.net/oficina/mapa/scripts/mutate	[no test files]
?   	amadan.net/oficina/mapa/scripts/preview	[no test files]
=== migration-check ===
go tool rastrillo migration check
rastrillo migration check: models and migrations agree
=== credits-check ===
python3 scripts/credits.py --check
credits: checked
diff --git a/.amadan/ci.d/35-spacing b/.amadan/ci.d/35-spacing
new file mode 100755
index 0000000..1f54422
--- /dev/null
+++ b/.amadan/ci.d/35-spacing
@@ -0,0 +1,3 @@
+#!/bin/sh
+# Fiesta's spacing check over Mapa's own stylesheets (build note 89).
+exec make spacing
diff --git a/AGENTS.md b/AGENTS.md
index 5d0e154..a959c1d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -208,10 +208,14 @@ Makefile, estilo's files served straight from the module).
lives in rastrillo.
- **Screens work with JavaScript off**; destructive actions get their own
confirm page.
-- The gate is `make ci` (vet, gofmt, rastrillo's code budget, tests,
- migration check, and `make editor`: npm ci, the bundle rebuilt with no
- drift, `node --test`), the same definition CI runs. It needs `node` and
- `npm` on PATH. `CGO_ENABLED=0`
+- The gate is `make ci` (vet, gofmt, rastrillo's code budget, Fiesta's
+ spacing check, tests, migration check, and `make editor`: npm ci, the
+ bundle rebuilt with no drift, `node --test`), the same definition CI
+ runs. It needs `node` and `npm` on PATH. `make spacing` holds every
+ margin, padding and gap in `internal/mapa/static` to a
+ `var(--rst-sp-N)` step or a `/* spacing-allow: why */`, and `make
+ browser`'s rhythm audit holds every screen to the scale (level-up
+ build note 89). `CGO_ENABLED=0`
throughout. Use `make`, not bare `go test`: the Makefile pins the
toolchain. `make browser` is gate 7 and `make mutate` proves gates 1, 4
and 8 can fail, that a rename carries only drafts on its own base
@@ -238,6 +242,5 @@ app over synthetic pages, signed in, on loopback.
## Known follow-ups
-- **rastrillo is pinned by pseudo-version**, as Portero and Fichas are.
- **estilo's `chrome` imports the frozen rastrillo path**, so `go.mod`
carries it indirectly. Mapa imports nothing from it.
diff --git a/Makefile b/Makefile
index e9fd631..367661b 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,8 @@ VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null)
.PHONY: build release version-check deps test vet fmt-check code \
migration-check mutate browser preview editor golden editor-golden \
- corpus-local credits credits-check ci locale-dates pandoc-fixture
+ corpus-local credits credits-check ci locale-dates pandoc-fixture \
+ spacing
build:
CGO_ENABLED=0 go build ./...
@@ -68,6 +69,14 @@ fmt-check:
code:
go tool rastrillo budget code
+# spacing is Fiesta's spacing check (level-up build note 89): every
+# margin, padding and gap in Mapa's own stylesheets is a step of the
+# scale, var(--rst-sp-N), or says why it is not with
+# /* spacing-allow: why */. estilo's and rastrillo's files are served
+# from their modules, so nothing here is somebody else's to skip.
+spacing:
+ go tool fiesta spacing internal/mapa/static
+
# A step of its own, so ci.d/ can report it: it fails the build the
# moment models.go and migrations/ disagree, instead of at boot.
migration-check:
@@ -172,4 +181,4 @@ credits-check:
# ci is the one gate: what the runner executes and what you run before
# pushing.
-ci: vet fmt-check code test migration-check editor credits-check
+ci: vet fmt-check code spacing test migration-check editor credits-check
diff --git a/docs/superpowers/specs/2026-11-14-mapa-level-up.md b/docs/superpowers/specs/2026-11-14-mapa-level-up.md
index c11028c..72d198b 100644
--- a/docs/superpowers/specs/2026-11-14-mapa-level-up.md
+++ b/docs/superpowers/specs/2026-11-14-mapa-level-up.md
@@ -1294,6 +1294,13 @@ Phase 1's choices where this spec was silent, or where the build chose different
- **Script.** None is needed: a `<details>` opens, its links go, Pin posts. estilo's chrome.js closes it on Esc (focus back on the ⋯) and on a click outside, as it does every menu in the group. `mapa.js` moves focus to the first row on opening, lets ↓ and ↑ move between rows, and closes it when focus leaves it for another control. `title.mjs` renames a row's ⋯ with its row when the title is renamed in place (`TestTitleClickTypeEnterRenamesInPlace` checks it).
- **Gates.** `sidebar_more_browser_test.go` (`make browser`), each red on main (there is no ⋯ there): the ⋯ shows on hover and on focus and not with the pointer away, scripts off and on, and not at all in the rail; on a coarse pointer it shows on the page's row only, a tap on another row's end lands on its link, and the ⋯, the row and the menu's rows are 44px; the menus of a team page, a pinned team page and a pinned note, each row's label and address; Delete… opens the confirm page and the page is still there after, scripts off and on; with scripts off the last row's menu is whole and on top, and Unpin and Pin post and come back to the screen; Enter focuses the first row, ↓ moves, ↑ from the first goes to the last, Tab out closes it, Esc closes and gives focus back to the ⋯; at 900px with the sidebar open, the open menu is on top of the editor's text (`TestARowsMenuIsOverTheEditor`, red without the lift: the corner hit the `ARTICLE`); axe, closed and open, with a mouse and on a touch screen; and hovering or focusing a long-titled row moves no box in the sidebar, with the title ending before the ⋯. `TestARowsMenuIsThePageVerbs` in `internal/mapa` holds the two menus to one source, `TestARowComesBackWithoutTheNotice` the notice, and `TestPinFromARowComesBack` the return.
+89. **Every screen on the spacing scale** (Paul, 2026-11-22: "Can we somehow put something in place to avoid weird spacing issues like this in future?", then "Release and start the rollout", with every app on rastrillo v0.45.0; amends notes 68 and 84, and §4.1's page column). Fiesta 1.6 ships the stack and two gates; Mapa now uses all three, and replaces the early copies c66189f made of them for the import page.
+ - **The libraries.** rastrillo v0.45.0 (was a v0.35.1 pseudo-version), which serves Fiesta 1.6's `tokens.css` with `rst-stack`; Fiesta v1.6.1 (was 1.3.0), also a `go tool` for the check; estilo 6238a47 (was d004805). Credits regenerated with `make credits`. The new `signin` package is not adopted: Mapa's sign-in is unchanged. rastrillo v0.37.0's CLDR 48 numbers came with the jump: French groups with U+202F and Spanish leaves four digits ungrouped, so `1\u202f234` and `1234`, as browsers write them. That was note 85's upstream report; the three tests that pinned the old output now pin the new.
+ - **The stack.** `[mapa-doc]` is `rst-stack` on every signed-in screen, so a screen's blocks are spaced by Fiesta's one table and every hand margin between them went. A page's head (`mapa-doc-head`, Help's and a version's) is the page's header, `rst-page-header`, drawn as Mapa's (no rule, not a row), so the page opens `--rst-sp-5` under it as before; inside it the kicker is `--rst-sp-3` above the title (was 14px) and the look row `--rst-sp-2` (was 4px, touching the title). The body is `rst-section`, so it opens `--rst-sp-5` below whatever precedes it: the island's scripts stay where `page.mjs` reads them, just before the `<article>`. The foot's references are `rst-stack rst-section`, `--rst-sp-6` under their rule (was 72px above it and 28px under), each group a `rst-stack rst-section` (was 54px and 30px apart); the panel's sections carry the same attributes inside its own grid, where they change nothing. The editor pages' own flex column, and its `margin-block-start: 0` (an ID-weight selector that would have beaten the stack), went: the stack is that column now, and note 84's body still fills it. Search's label and its row are Fiesta's field (the label was 3.2px above the row); Settings' note sits a step under its form (it touched it). Help → Colophon is estilo's credits section, not a stack: `frame.css` gives its heading the stack's step after a heading (it was 18.8px), until estilo's template carries `rst-stack`.
+ - **c66189f's copies.** `mapa-stack`, `mapa-section` and `mapa-action-row` in `mapa.css` are gone, for `rst-stack`, `rst-stack rst-section` and `rst-actions`; the import page and its confirm pages lost their outer wrapper, since the column is the stack. The audit vendored in `internal/mapatest/testdata/rhythm` is gone too: the tests import `amadan.net/rastrillo/fiesta/check/rhythm`.
+ - **The spacing check.** `make spacing` (`go tool fiesta spacing internal/mapa/static`) is in `make ci` and is CI's step `35-spacing`. Nothing is skipped: estilo's and rastrillo's stylesheets are served from their modules, not vendored. On origin/main it refused 171 declarations: 118 off the scale (mostly 6, 10, 2, 14 and 1px, worst in `links.css` and `frame.css`) and 53 steps typed by hand. Now none, with 46 allowances, each saying why on its line: the document's typographic rhythm in `prose.css`, in em of its text, which the server's HTML and the editor's DOM share (15, and the diff's list indents in `history.css`, 3, which follow it); the page column's 48px sides, which the measure (42rem + 96px) and `links.css`'s room arithmetic and breakpoints are built on, its 120px foot room, and 140px on a phone to clear the Links sheet (4); the column's centring arithmetic beside the panel (1); hairlines: 1px between sidebar rows, months' days, the week strip's 2px between seven days in a 284px panel and its letter on its date (5); the rail's tooltip placed beside its 40px row where the engine cannot anchor (4); the sidebar row's room for its ⋯ and one step per level of nesting (2); the ¶ and the task box hanging in the margin on the box the server draws (6, one in `prose.css`); the chip's 1px above and below its text, the reference context lining up past its icon, the 4px dot centred in a 10px mark, and History's time on its title's first line (4); the palette and ⌘K's dialog placed a share of the window down (2). Everything else moved to its nearest step. Visible changes larger than a step's rounding: the page's top is 40px (was 56; 24 on a phone, was 28, with 16px sides, was 20), and the foot's break above.
+ - **The rhythm audit.** `TestEveryScreenKeepsTheRhythm` (`make browser`) runs Fiesta's audit over the page column of 23 screens (Today, a day and its Markdown screen, a team page and its Markdown, History, Rename, Delete, Look, Links and Inside screens, New page twice, All pages, Scratch, New scratch page, Search empty, with results and with none, Settings, Deleted pages, Help's Markdown and Colophon), at 1280 and 390px, scripts off and on, and fails on any finding. It skips two things, each a component whose spacing is not the page's: the page's body (`[mapa-body]`, the editor's document, held by L1 to L5) and the Links panel (fixed over the page, out of its flow; below 64rem its lists are the page's foot, which is audited). On origin/main's CSS and markup it fails with 133 findings, among them the kicker's 14px, Search's 3.2px, Settings' 0px and the Colophon's 18.8px; now none. `TestImportPageRhythm` runs the same package over the import page's states.
+
## 14. Findings and what changed
### Round 1: Fable on revision 1 (`4027e10`), answered in revision 2
diff --git a/go.mod b/go.mod
index f0a52c5..b77d42a 100644
--- a/go.mod
+++ b/go.mod
@@ -5,9 +5,9 @@ go 1.26.0
toolchain go1.26.11
require (
- amadan.net/oficina/estilo.git v0.0.0-20261118055615-d004805f40f2
+ amadan.net/oficina/estilo.git v0.0.0-20261122204240-6238a478888e
amadan.net/oficina/notion.git v0.0.0-20261122204613-b8398e79991e
- amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc
+ amadan.net/rastrillo/rastrillo v0.45.0
github.com/chromedp/cdproto v0.158.6
github.com/chromedp/chromedp v0.21.0
github.com/go-chi/chi/v5 v5.3.2
@@ -18,7 +18,7 @@ require (
)
require (
- amadan.net/rastrillo/fiesta v1.3.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
@@ -33,6 +33,7 @@ require (
github.com/tdewolff/minify/v2 v2.24.19 // indirect
github.com/tdewolff/parse/v2 v2.8.16 // indirect
golang.org/x/mod v0.38.0 // indirect
+ golang.org/x/net v0.58.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/tools v0.48.0 // indirect
@@ -43,4 +44,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 76bf4e1..a140509 100644
--- a/go.sum
+++ b/go.sum
@@ -1,17 +1,11 @@
-amadan.net/oficina/estilo.git v0.0.0-20261118055615-d004805f40f2 h1:E2+IhBdGcjhX3IX8UgQj5t6Bu+4zkGG0J+W1CIeoTAo=
-amadan.net/oficina/estilo.git v0.0.0-20261118055615-d004805f40f2/go.mod h1:2UFIFrbTrhew8EFM0C94WmTo2OASM2pHEgT4jzeE/s8=
-amadan.net/oficina/notion.git v0.0.0-20261122111155-169302d88bbe h1:rTQZz9FJ7tQ7p5adMGNzjFLg6hpplF2NQewgtaQs3ac=
-amadan.net/oficina/notion.git v0.0.0-20261122111155-169302d88bbe/go.mod h1:2WuyjBTLHwurTGri00zfPxSKc9b3pomdT6wSs/UIvA4=
-amadan.net/oficina/notion.git v0.0.0-20261122193726-d36f6e0f6101 h1:EdCkiWKC2PrZuiFEIeSrT4YH3E2Js4d1PKI37kG1qZ8=
-amadan.net/oficina/notion.git v0.0.0-20261122193726-d36f6e0f6101/go.mod h1:2WuyjBTLHwurTGri00zfPxSKc9b3pomdT6wSs/UIvA4=
-amadan.net/oficina/notion.git v0.0.0-20261122203529-9de09416b0e5 h1:vtl6aPel2HbTNoUnigTlUjymI5T6HTfzPBHN/mqXKQc=
-amadan.net/oficina/notion.git v0.0.0-20261122203529-9de09416b0e5/go.mod h1:2WuyjBTLHwurTGri00zfPxSKc9b3pomdT6wSs/UIvA4=
+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/notion.git v0.0.0-20261122204613-b8398e79991e h1:p2wjp4sf2tnBn9HQjdRlAxGJpkyCXhcCOZggInenvYc=
amadan.net/oficina/notion.git v0.0.0-20261122204613-b8398e79991e/go.mod h1:2WuyjBTLHwurTGri00zfPxSKc9b3pomdT6wSs/UIvA4=
-amadan.net/rastrillo/fiesta v1.3.0 h1:7SsHw4aeWPLStR3RHFEEtX4CwqKu+Ig3PgNX8FvD8WM=
-amadan.net/rastrillo/fiesta v1.3.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY=
-amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc h1:QakboVkj9nqA6ZaKXeDVXWLPobQSVvd80ic521aA8/U=
-amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc/go.mod h1:y45ucMD+Al4tN47mmnm7h6pGDw7N20k0CMg6IwB9vfc=
+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.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=
@@ -60,10 +54,14 @@ github.com/tdewolff/parse/v2 v2.8.16 h1:bLk5svUOQRkW/Y2SJ+DeENSIkZBcTIkq+Atyv5D8
github.com/tdewolff/parse/v2 v2.8.16/go.mod h1:XdsoSFThlVIRIajAuqz1evNY7bagZS8LBOPA3aVopwQ=
github.com/tdewolff/test v1.0.12 h1:7F21DqIajswxuche0geHdrUZRCWE4oko4b7bcmkkrxk=
github.com/tdewolff/test v1.0.12/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8=
+golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M=
+golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis=
golang.org/x/image v0.45.0 h1:FMb1nTbH5H9vF55SriQHgFw5GnNL9Jg6L25BwXKzhB0=
golang.org/x/image v0.45.0/go.mod h1:n62x/7RqlwXDvGsSU4u6IUTUf6KghUZ9Bt7cG/T9Fx4=
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/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git a/internal/mapa/credits/notices.json b/internal/mapa/credits/notices.json
index 6da68db..ee5506c 100644
--- a/internal/mapa/credits/notices.json
+++ b/internal/mapa/credits/notices.json
@@ -24,7 +24,7 @@
},
{
"Name": "amadan.net/rastrillo/fiesta",
- "Version": "v1.3.0",
+ "Version": "v1.6.1",
"SourceURL": "https://amadan.net/rastrillo/fiesta",
"Notices": [
{
@@ -35,7 +35,7 @@
},
{
"Name": "amadan.net/rastrillo/rastrillo",
- "Version": "v0.35.1-0.20261116213651-96812beacacc",
+ "Version": "v0.45.0",
"SourceURL": "https://amadan.net/rastrillo/rastrillo",
"Notices": [
{
diff --git a/internal/mapa/locale/locale_test.go b/internal/mapa/locale/locale_test.go
index a22ef4c..77c4a6b 100644
--- a/internal/mapa/locale/locale_test.go
+++ b/internal/mapa/locale/locale_test.go
@@ -137,12 +137,12 @@ func TestDayCarriesTheYearOnlyWhenItIsNotThisOne(t *testing.T) {
}
func TestNumbersAreRastrillos(t *testing.T) {
- // fr and es are rastrillo's, not CLDR 48's: CLDR writes 1\u202f234
- // in French and 1234 in Spanish (two-digit minimum grouping).
- // Reported upstream (build note 85); these pin today's output.
+ // CLDR 48's, from rastrillo v0.37.0 on (build note 89): French
+ // groups with U+202F, and Spanish leaves four digits ungrouped
+ // (two-digit minimum grouping), as browsers write them.
for code, want := range map[string]string{"en-IE": "1,234",
- "en-US": "1,234", "de": "1.234", "fr": "1\u00a0234",
- "es": "1.234"} {
+ "en-US": "1,234", "de": "1.234", "fr": "1\u202f234",
+ "es": "1234"} {
if got := Get(code).Number(1234); got != want {
t.Errorf("%s writes 1234 as %q, want %q", code, got, want)
}
diff --git a/internal/mapa/locales_test.go b/internal/mapa/locales_test.go
index b8f0b2e..bf46ff4 100644
--- a/internal/mapa/locales_test.go
+++ b/internal/mapa/locales_test.go
@@ -18,7 +18,7 @@ func TestPanelCountsAreInTheReadersLocale(t *testing.T) {
data := map[string]any{"ID": "x", "Heading": "Linked from",
"Items": items, "Empty": "", "Target": ""}
for code, want := range map[string]string{"en-IE": "1,234",
- "en-US": "1,234", "de": "1.234", "fr": "1 234"} {
+ "en-US": "1,234", "de": "1.234", "fr": "1\u202f234"} {
drawn, err := fragment(pagesIn[code]["page"], "mapa-panel-linked",
data)
if err != nil {
diff --git a/internal/mapa/static/frame.css b/internal/mapa/static/frame.css
index 291a070..af8dd52 100644
--- a/internal/mapa/static/frame.css
+++ b/internal/mapa/static/frame.css
@@ -47,26 +47,22 @@ body {
box-sizing: border-box;
max-inline-size: calc(var(--mapa-measure) + 96px);
margin-inline: auto;
- padding: 56px 48px 120px;
+ /* spacing-allow: 48px each side is the measure's own (42rem + 96px, the arithmetic links.css's room and breakpoints are built on); 120px under the last line, so a page never ends at the window's foot */
+ padding: var(--rst-sp-6) 48px 120px;
}
@media (max-width: 799.98px) {
- [mapa-doc] { padding: 28px 20px 120px; }
+ [mapa-doc] {
+ padding: var(--rst-sp-5) var(--rst-sp-4) 120px; /* spacing-allow: 120px under the last line, as above */
+ }
}
-/* A page the editor writes on (the island is there): its body fills the
- column down to the page's foot, so a click anywhere below the text
- lands in the editor itself (build note 84). The server draws the same
- box, so mounting moves nothing (L5). A flex column does not collapse
- margins, so each child keeps only the space below it, which was the
- larger of every pair; the foot keeps its own break above. */
-[mapa-doc]:has(> script#mapa-editor) {
- display: flex;
- flex-direction: column;
- min-block-size: 100%;
-}
-[mapa-doc]:has(> script#mapa-editor) > :not([mapa-foot-refs]) {
- margin-block-start: 0;
-}
+/* Every screen's blocks are Fiesta's stack (rst-stack on [mapa-doc]):
+ a flex column, so nothing collapses, spaced by one table (build note
+ 89). A page the editor writes on (the island is there): its body
+ fills the column down to the page's foot, so a click anywhere below
+ the text lands in the editor itself (build note 84). The server draws
+ the same box, so mounting moves nothing (L5). */
+[mapa-doc]:has(> script#mapa-editor) { min-block-size: 100%; }
[mapa-doc]:has(> script#mapa-editor) > article[mapa-body] { flex-grow: 1; }
/* ── The sidebar: one grid per row, a 16px icon column and the label,
@@ -78,9 +74,9 @@ body {
block-size: calc(100dvh - var(--mapa-bar-h));
display: flex;
flex-direction: column;
- gap: 1px;
+ gap: 1px; /* spacing-allow: a hairline between rows, so two lit rows never merge into one */
overflow: auto;
- padding: 10px 8px 12px;
+ padding: var(--rst-sp-3) var(--rst-sp-2);
background: light-dark(#f8f9fb, #191b21);
border-inline-end: 1px solid var(--rst-line);
font-size: 13px;
@@ -91,10 +87,10 @@ body {
display: grid;
grid-template-columns: 16px minmax(0, 1fr) auto;
align-items: center;
- column-gap: 10px;
+ column-gap: var(--rst-sp-2);
inline-size: 100%;
min-block-size: 30px;
- padding: 0 8px 0 10px;
+ padding: 0 var(--rst-sp-2);
border: 0;
border-radius: 8px;
background: none;
@@ -128,7 +124,10 @@ body {
Hidden, it is see-through to the pointer, so a tap there opens the
page; the keyboard still reaches it, and then it shows. ── */
[mapa-side-row] { --mapa-more: var(--rst-sp-5); position: relative; }
-[mapa-side-row] > [mapa-side-page] { padding-inline-end: calc(var(--mapa-more) + var(--rst-sp-2)); }
+[mapa-side-row] > [mapa-side-page] {
+ /* spacing-allow: the ⋯'s room and a step, so the title truncates before the ⋯ whether it shows or not */
+ padding-inline-end: calc(var(--mapa-more) + var(--rst-sp-2));
+}
[mapa-row-menu] {
position: absolute;
inset-block: 0;
@@ -187,21 +186,26 @@ body {
}
}
[mapa-side-head] {
- margin: 14px 0 2px;
- padding: 0 8px 0 10px;
+ margin: var(--rst-sp-3) 0 0;
+ padding: 0 var(--rst-sp-2);
color: var(--rst-text-faint, var(--rst-text-muted));
font-size: 11.5px;
font-weight: 600;
line-height: 22px;
}
-[mapa-side-foot] { margin-block-start: auto; padding-block-start: 10px; display: grid; gap: 1px; }
+[mapa-side-foot] {
+ margin-block-start: auto;
+ padding-block-start: var(--rst-sp-2);
+ display: grid;
+ gap: 1px; /* spacing-allow: the rows' hairline, as the sidebar's */
+}
[mapa-side-foot] form { display: contents; }
kbd[mapa-kbd] {
display: inline-flex;
align-items: center;
justify-content: center;
min-inline-size: 1.4em;
- padding: 0 5px;
+ padding: 0 var(--rst-sp-1);
border: 1px solid var(--rst-line);
border-block-end-width: 2px;
border-radius: 5px;
@@ -225,7 +229,7 @@ kbd[mapa-kbd] {
auto), then moved out beside the 40px row: a fixed box escapes the
sidebar's scrolling, which clipped an absolute one. ── */
@media (min-width: 800px) {
- [mapa-app][data-side="rail"] [mapa-side] { padding-inline: 8px; align-items: center; }
+ [mapa-app][data-side="rail"] [mapa-side] { padding-inline: var(--rst-sp-2); align-items: center; }
[mapa-app][data-side="rail"] [mapa-side-item] {
grid-template-columns: 18px;
justify-content: center;
@@ -254,11 +258,12 @@ kbd[mapa-kbd] {
}
[mapa-app][data-side="rail"] [mapa-side-label] {
position: fixed;
+ /* spacing-allow: the tooltip's place where the engine cannot anchor: beside the 40px row, 10px clear, on its centre line */
margin-inline-start: 50px;
- margin-block-start: 19px;
+ margin-block-start: 19px; /* spacing-allow: the row's centre line, as above */
translate: 0 -50%;
z-index: 30;
- padding: 4px 8px;
+ padding: var(--rst-sp-1) var(--rst-sp-2);
border-radius: 6px;
background: var(--rst-text);
color: var(--rst-surface);
@@ -275,7 +280,7 @@ kbd[mapa-kbd] {
}
}
@media (min-width: 800px) and (max-width: 79.99rem) {
- [mapa-app]:not([data-side]) [mapa-side] { padding-inline: 8px; align-items: center; }
+ [mapa-app]:not([data-side]) [mapa-side] { padding-inline: var(--rst-sp-2); align-items: center; }
[mapa-app]:not([data-side]) [mapa-side-item] {
grid-template-columns: 18px;
justify-content: center;
@@ -304,11 +309,12 @@ kbd[mapa-kbd] {
}
[mapa-app]:not([data-side]) [mapa-side-label] {
position: fixed;
+ /* spacing-allow: the tooltip's place where the engine cannot anchor: beside the 40px row, 10px clear, on its centre line */
margin-inline-start: 50px;
- margin-block-start: 19px;
+ margin-block-start: 19px; /* spacing-allow: the row's centre line, as above */
translate: 0 -50%;
z-index: 30;
- padding: 4px 8px;
+ padding: var(--rst-sp-1) var(--rst-sp-2);
border-radius: 6px;
background: var(--rst-text);
color: var(--rst-surface);
@@ -338,9 +344,9 @@ kbd[mapa-kbd] {
[mapa-day] a {
display: inline-flex;
align-items: center;
- gap: 6px;
+ gap: var(--rst-sp-1);
block-size: 100%;
- padding-inline: 8px;
+ padding-inline: var(--rst-sp-2);
border-radius: 999px;
color: var(--rst-text);
font-size: 13px;
@@ -357,7 +363,7 @@ kbd[mapa-kbd] {
/* ── The shortcuts dialog. ── */
dialog[mapa-dialog] {
inline-size: min(28rem, calc(100vw - 32px));
- padding: 16px 20px 20px;
+ padding: var(--rst-sp-4) var(--rst-sp-5) var(--rst-sp-5);
border: 1px solid var(--rst-line);
border-radius: 14px;
background: var(--rst-surface);
@@ -365,29 +371,31 @@ dialog[mapa-dialog] {
box-shadow: 0 28px 56px -20px rgb(23 32 60 / 0.35);
}
dialog[mapa-dialog]::backdrop { background: rgb(15 18 25 / 0.35); }
-[mapa-dialog-head] { display: flex; align-items: center; justify-content: space-between; margin-block-end: 8px; }
+[mapa-dialog-head] { display: flex; align-items: center; justify-content: space-between; margin-block-end: var(--rst-sp-2); }
[mapa-dialog-head] h2 { margin: 0; font-size: 1rem; }
-dl[mapa-keys] { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
+dl[mapa-keys] { display: grid; grid-template-columns: max-content 1fr; gap: var(--rst-sp-3) var(--rst-sp-4); margin: 0; }
dl[mapa-keys] dd { margin: 0; color: var(--rst-text-muted); }
/* ── The page (§4.1): the window is the page. A quiet kicker, a large
- title, then the writing; no card, no label. ── */
-[mapa-page-head] { display: block; margin: 0 0 24px; }
+ title, then the writing; no card, no label. The head is the page's
+ header (rst-page-header, so the stack opens the page under it), drawn
+ as Mapa's: no rule, no row. ── */
+[mapa-page-head] { display: block; border-block-end: 0; padding-block-end: 0; }
[mapa-doc-kicker] {
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 6px 14px;
- margin: 0 0 14px;
+ gap: var(--rst-sp-1) var(--rst-sp-3);
+ margin: 0 0 var(--rst-sp-3);
color: var(--rst-text-muted);
font-size: 13px;
}
-[mapa-doc-kicker] > span { display: inline-flex; align-items: center; gap: 6px; }
+[mapa-doc-kicker] > span { display: inline-flex; align-items: center; gap: var(--rst-sp-1); }
[mapa-doc-kicker] svg { inline-size: 14px; block-size: 14px; }
[mapa-doc-edit] {
display: inline-flex;
align-items: center;
- gap: 5px;
+ gap: var(--rst-sp-1);
color: var(--rst-text-muted);
font-weight: 600;
text-decoration: none;
@@ -448,14 +456,10 @@ textarea[mapa-editor]:focus { outline: none; box-shadow: none; }
/* What links here, at the page's foot whenever the panel is not there
(§3.3): after a quiet break, like a reference list. */
[mapa-foot-refs] {
- display: grid;
- gap: 30px;
- margin-block-start: 72px;
- padding-block-start: 28px;
+ padding-block-start: var(--rst-sp-6);
border-block-start: 1px solid var(--rst-line);
}
[mapa-foot-refs] h2 {
- margin: 0 0 6px;
color: var(--rst-text-muted);
font-size: 12px;
font-weight: 650;
@@ -466,9 +470,8 @@ textarea[mapa-editor]:focus { outline: none; box-shadow: none; }
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 8px 12px;
- margin: 0 0 20px;
- padding: 10px 14px;
+ gap: var(--rst-sp-2) var(--rst-sp-3);
+ padding: var(--rst-sp-2) var(--rst-sp-3);
border: 1px solid var(--rst-line);
border-radius: 12px;
background: var(--rst-surface-2);
@@ -494,7 +497,7 @@ textarea[mapa-editor]:focus { outline: none; box-shadow: none; }
inset: auto;
inset-block-end: 12px;
inset-inline-start: calc(var(--mapa-side-w) + 10px);
- padding: 12px;
+ padding: var(--rst-sp-3);
overflow: visible;
border: 1px solid var(--rst-line);
border-radius: 12px;
@@ -503,7 +506,7 @@ textarea[mapa-editor]:focus { outline: none; box-shadow: none; }
box-shadow: 0 18px 40px -16px rgb(23 32 60 / 0.35);
font-size: 13px;
}
-form[mapa-new-page-form] { display: grid; gap: 8px; margin: 0; }
+form[mapa-new-page-form] { display: grid; gap: var(--rst-sp-2); margin: 0; }
form[mapa-new-page-form] label { font-size: 12px; font-weight: 650; color: var(--rst-text-muted); }
form[mapa-new-page-form] p { margin: 0; font-size: 12px; }
[mapa-new-page-error][hidden] { display: none; }
@@ -561,9 +564,9 @@ form[mapa-new-page-form] p { margin: 0; font-size: 12px; }
}
/* Help → Markdown in Mapa. */
-table[mapa-help-table] { inline-size: 100%; border-collapse: collapse; margin-block: 8px 20px; font-size: 14.5px; }
-table[mapa-help-table] th { text-align: start; color: var(--rst-text-muted); font-size: 12px; font-weight: 650; padding: 6px 12px 6px 0; border-block-end: 1px solid var(--rst-line); }
-table[mapa-help-table] td { padding: 8px 12px 8px 0; border-block-end: 1px solid var(--rst-line); vertical-align: top; }
+table[mapa-help-table] { inline-size: 100%; border-collapse: collapse; font-size: 14.5px; }
+table[mapa-help-table] th { text-align: start; color: var(--rst-text-muted); font-size: 12px; font-weight: 650; padding: var(--rst-sp-2) var(--rst-sp-3) var(--rst-sp-2) 0; border-block-end: 1px solid var(--rst-line); }
+table[mapa-help-table] td { padding: var(--rst-sp-2) var(--rst-sp-3) var(--rst-sp-2) 0; border-block-end: 1px solid var(--rst-line); vertical-align: top; }
table[mapa-help-table] td:first-child { white-space: nowrap; }
/* estilo's stacked bar hides the app's name with display: none, which
@@ -657,7 +660,7 @@ h1[mapa-title] > [mapa-icon] { margin-inline-end: var(--rst-sp-3); vertical-alig
gap: var(--rst-sp-2);
block-size: 1.5rem;
align-items: center;
- margin-block-end: var(--rst-sp-1);
+ margin-block-end: var(--rst-sp-2);
}
[mapa-look-act] {
color: var(--rst-text-muted);
@@ -673,9 +676,7 @@ h1[mapa-title] > [mapa-icon] { margin-inline-end: var(--rst-sp-3); vertical-alig
[mapa-look-act]:hover { color: var(--rst-text); }
/* The scriptless look page and the picker. */
-[mapa-look-section] { margin-block: var(--rst-sp-5) 0; }
-[mapa-look-section] > h2 { margin-block: 0 var(--rst-sp-2); font-size: var(--rst-fs-lg, 1.125rem); }
-[mapa-look-form] { margin-block: var(--rst-sp-3) 0; }
+[mapa-look-section] > h2 { font-size: var(--rst-fs-lg, 1.125rem); }
[mapa-look-form] fieldset { border: 0; padding: 0; margin: 0 0 var(--rst-sp-3); display: flex; gap: var(--rst-sp-3); flex-wrap: wrap; }
[mapa-look-now] { display: flex; align-items: center; gap: var(--rst-sp-2); }
[mapa-look-now] > [mapa-icon] { font-size: 1.75rem; inline-size: 1.75rem; block-size: 1.75rem; }
@@ -736,7 +737,7 @@ h1[mapa-title] > [mapa-icon] { margin-inline-end: var(--rst-sp-3); vertical-alig
display: grid;
grid-template-columns: 16px minmax(0, 1fr) auto;
align-items: center;
- padding-inline-start: calc(var(--rst-sp-4) * var(--mapa-depth, 0));
+ padding-inline-start: calc(var(--rst-sp-4) * var(--mapa-depth, 0)); /* spacing-allow: one step per level of nesting, up to four */
}
[mapa-side-row][data-depth="1"] { --mapa-depth: 1; }
[mapa-side-row][data-depth="2"] { --mapa-depth: 2; }
@@ -767,3 +768,10 @@ ul[mapa-side-inside] { list-style: none; margin: 0; padding: 0; }
color: var(--rst-text-muted);
font-size: 13px;
}
+
+/* Help → Colophon: estilo's credits section is a heading and its list,
+ not a stack, so the browser's own margins spaced them (18.8px under
+ the heading). The stack's step after a heading, until estilo's
+ template carries rst-stack itself. */
+[estilo-credits] > h1 { margin: 0 0 var(--rst-sp-2); }
+[estilo-credits] > ul { margin: 0; }
diff --git a/internal/mapa/static/history.css b/internal/mapa/static/history.css
index 0746565..420784a 100644
--- a/internal/mapa/static/history.css
+++ b/internal/mapa/static/history.css
@@ -30,7 +30,7 @@
display: flex;
align-items: center;
justify-content: space-between;
- padding: 16px 12px 6px 20px;
+ padding: var(--rst-sp-4) var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-5);
}
[mapa-history-head] h2 { margin: 0; font-size: 16px; font-weight: 680; }
[mapa-history-head] h2:focus { outline: none; }
@@ -46,14 +46,14 @@
[mapa-history-close]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; }
[mapa-history-close] svg { inline-size: 18px; block-size: 18px; }
[mapa-history-lede] {
- margin: 0 20px 10px;
+ margin: 0 var(--rst-sp-5) var(--rst-sp-3);
color: var(--rst-text-muted);
font-size: 12.5px;
line-height: 1.45;
}
-[mapa-history-list] { flex: 1; overflow: auto; padding: 0 10px 12px; }
+[mapa-history-list] { flex: 1; overflow: auto; padding: 0 var(--rst-sp-3) var(--rst-sp-3); }
[mapa-history-list] h3 {
- margin: 12px 10px 4px;
+ margin: var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-1);
color: var(--rst-text-faint, var(--rst-text-muted));
font-size: 11.5px;
font-weight: 600;
@@ -62,9 +62,9 @@
[mapa-ver] {
display: grid;
grid-template-columns: 28px minmax(0, 1fr) auto;
- column-gap: 10px;
+ column-gap: var(--rst-sp-2);
align-items: center;
- padding: 8px 10px;
+ padding: var(--rst-sp-2);
border-radius: 10px;
color: inherit;
font-size: 13px;
@@ -86,7 +86,7 @@
}
[mapa-ver] time {
align-self: start;
- padding-block-start: 2px;
+ padding-block-start: 2px; /* spacing-allow: the time's first line sits on the title's, a smaller face on a larger one */
color: var(--rst-text-muted);
font-size: 12px;
font-variant-numeric: tabular-nums;
@@ -101,14 +101,14 @@
color: var(--rst-text-muted);
font: 700 11px/1 var(--rst-font);
}
-[mapa-history-note] { margin: 14px 10px 4px; color: var(--rst-text-muted); font-size: 12.5px; }
-[mapa-history-more] { margin: 10px 10px 0; }
+[mapa-history-note] { margin: var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-1); color: var(--rst-text-muted); font-size: 12.5px; }
+[mapa-history-more] { margin: var(--rst-sp-2) var(--rst-sp-2) 0; }
[mapa-history-foot] {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
- gap: 8px;
- padding: 12px 16px;
+ gap: var(--rst-sp-2);
+ padding: var(--rst-sp-3) var(--rst-sp-4);
border-block-start: 1px solid var(--rst-line);
}
[mapa-history-foot] form { display: contents; }
@@ -135,9 +135,8 @@
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 10px 14px;
- margin: 0 0 28px;
- padding: 10px 12px 10px 14px;
+ gap: var(--rst-sp-2) var(--rst-sp-3);
+ padding: var(--rst-sp-2) var(--rst-sp-3);
border: 1px solid var(--rst-line);
border-radius: 12px;
background: var(--rst-surface-2);
@@ -163,11 +162,11 @@ h1[mapa-title] del {
text-decoration-color: var(--rst-tone-negative-fg);
}
[mapa-diff] > ul, [mapa-diff] > ol { margin-block: 0; }
-[mapa-diff-level="1"] { margin-inline-start: 1.5em; }
-[mapa-diff-level="2"] { margin-inline-start: 3em; }
-[mapa-diff-level="3"] { margin-inline-start: 4.5em; }
+[mapa-diff-level="1"] { margin-inline-start: 1.5em; /* spacing-allow: a list level's indent in the document, as prose.css draws it */ }
+[mapa-diff-level="2"] { margin-inline-start: 3em; /* spacing-allow: two levels, as above */ }
+[mapa-diff-level="3"] { margin-inline-start: 4.5em; /* spacing-allow: three levels, as above */ }
[mapa-diff-link] {
- padding: 0 4px;
+ padding: 0 var(--rst-sp-1);
border: 1px solid var(--rst-line);
border-radius: 5px;
}
@@ -175,6 +174,6 @@ h1[mapa-title] del {
/* While History is open the Links panel is not, so the page column
makes no room for it: the history column already took its own. */
@media (min-width: 64rem) {
- [mapa-app][data-history][data-links="open"] [mapa-doc] { padding-inline-end: 48px; }
+ [mapa-app][data-history][data-links="open"] [mapa-doc] { padding-inline-end: 48px; /* spacing-allow: the measure's own 48px, as frame.css's */ }
[mapa-app][data-history][data-links="open"] [mapa-foot-refs] { display: grid; }
}
diff --git a/internal/mapa/static/links.css b/internal/mapa/static/links.css
index f9b85a3..740389d 100644
--- a/internal/mapa/static/links.css
+++ b/internal/mapa/static/links.css
@@ -33,13 +33,13 @@ aside[mapa-links] {
font-size: 13px;
}
aside[mapa-links][hidden] { display: none; }
-[mapa-links-body] { display: grid; gap: 18px; padding: 14px 14px 16px; }
-[mapa-links-body] > section + section { padding-block-start: 16px; border-block-start: 1px solid var(--rst-line); }
+[mapa-links-body] { display: grid; gap: var(--rst-sp-4); padding: var(--rst-sp-3) var(--rst-sp-3) var(--rst-sp-4); }
+[mapa-links-body] > section + section { padding-block-start: var(--rst-sp-4); border-block-start: 1px solid var(--rst-line); }
aside[mapa-links] h2 {
display: flex;
align-items: baseline;
- gap: 6px;
- margin: 0 0 8px;
+ gap: var(--rst-sp-1);
+ margin: 0 0 var(--rst-sp-2);
color: var(--rst-text-muted);
font: 650 11px/14px var(--rst-font);
}
@@ -62,6 +62,7 @@ aside[mapa-links] h2 small,
--mapa-box: max(calc(36rem + 96px),
min(calc(42rem + 96px), calc(100% - 340px)));
max-inline-size: var(--mapa-box);
+ /* spacing-allow: the column's place, centred until the panel needs the room (the arithmetic above) */
margin-inline-start: max(0px, min(calc((100% - var(--mapa-box)) / 2),
calc(100% - var(--mapa-box) - 340px)));
margin-inline-end: auto;
@@ -84,13 +85,13 @@ aside[mapa-links] h2 small,
}
/* ── References: Linked from, Mentioned. ── */
-ul[mapa-refs] { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
-ul[mapa-refs] > li { padding: 7px 8px; margin-inline: -8px; border-radius: 10px; }
+ul[mapa-refs] { display: grid; gap: var(--rst-sp-1); margin: 0; padding: 0; list-style: none; }
+ul[mapa-refs] > li { padding: var(--rst-sp-2); margin-inline: calc(-1 * var(--rst-sp-2)); border-radius: 10px; }
ul[mapa-refs] > li:hover { background: var(--rst-surface-2); }
[mapa-ref-src] {
display: flex;
align-items: center;
- gap: 8px;
+ gap: var(--rst-sp-2);
color: var(--rst-text);
font-size: 13px;
font-weight: 650;
@@ -101,7 +102,7 @@ ul[mapa-refs] > li:hover { background: var(--rst-surface-2); }
[mapa-only-you] {
display: inline-flex;
align-items: center;
- gap: 4px;
+ gap: var(--rst-sp-1);
margin-inline-start: auto;
color: var(--rst-text-muted);
font-size: 11.5px;
@@ -109,22 +110,23 @@ ul[mapa-refs] > li:hover { background: var(--rst-surface-2); }
}
[mapa-only-you] > svg { inline-size: 12px; block-size: 12px; }
[mapa-ref-ctx] {
- margin-block-start: 3px;
+ margin-block-start: var(--rst-sp-1);
+ /* spacing-allow: the context lines up with the source's title, past its 14px icon and the 8px gap */
padding-inline-start: 22px;
color: var(--rst-text-muted);
font-size: 12.5px;
line-height: 1.5;
}
[mapa-ref-ctx] > :is(p, ul, ol, blockquote, h2, h3, h4, h5, h6, pre) { margin: 0; font-size: inherit; }
-[mapa-ref-ctx] form { margin-block-start: 6px; }
+[mapa-ref-ctx] form { margin-block-start: var(--rst-sp-2); }
/* ── Chips in Links out. ── */
-p[mapa-chips] { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
+p[mapa-chips] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); margin: 0; }
a[mapa-chip] {
display: inline-flex;
align-items: center;
- gap: 4px;
- padding: 1px 7px;
+ gap: var(--rst-sp-1);
+ padding: 1px var(--rst-sp-2); /* spacing-allow: the chip's pill hugs its line of text, 1px above and below */
border-radius: 6px;
background: var(--rst-surface-2);
color: var(--rst-text);
@@ -161,21 +163,21 @@ svg[mapa-map] text {
svg[mapa-map] text[mapa-map-here] { fill: var(--rst-text); font-weight: 700; font-size: 12px; }
svg[mapa-map] a { text-decoration: none; }
svg[mapa-map] a:hover text { fill: var(--rst-text); }
-p[mapa-map-key] { display: flex; gap: 14px; margin: 4px 0 0; color: var(--rst-text-muted); font-size: 11px; }
-p[mapa-map-key] span { display: inline-flex; align-items: center; gap: 6px; }
+p[mapa-map-key] { display: flex; gap: var(--rst-sp-3); margin: var(--rst-sp-1) 0 0; color: var(--rst-text-muted); font-size: 11px; }
+p[mapa-map-key] span { display: inline-flex; align-items: center; gap: var(--rst-sp-1); }
p[mapa-map-key] span::before { content: ""; inline-size: 14px; border-block-start: 1.5px solid var(--rst-line-strong); }
[mapa-k="pending"]::before { border-block-start-style: dashed !important; }
[mapa-k="mentioned"]::before { border-block-start-style: dotted !important; border-block-start-width: 2px !important; }
/* ── The week strip. ── */
-[mapa-week] { display: flex; align-items: center; gap: 4px; }
-ol[mapa-week-days] { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; gap: 2px; margin: 0; padding: 0; list-style: none; }
+[mapa-week] { display: flex; align-items: center; gap: var(--rst-sp-1); }
+ol[mapa-week-days] { display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; gap: 2px; /* spacing-allow: seven days across a 284px panel, 2px apart */ margin: 0; padding: 0; list-style: none; }
ol[mapa-week-days] a {
position: relative;
display: grid;
justify-items: center;
- gap: 2px;
- padding: 5px 0 8px;
+ gap: 2px; /* spacing-allow: the weekday's letter sits on its date as one glyph pair */
+ padding: var(--rst-sp-1) 0 var(--rst-sp-2);
border-radius: 9px;
color: var(--rst-text);
font-weight: 650;
@@ -200,12 +202,12 @@ ol[mapa-week-days] a:hover { background: var(--rst-surface-2); }
:is(ol[mapa-week-days], table[mapa-month-grid]) a[aria-current]::after { background: var(--rst-on-accent, #fff); }
/* The strip's key: what the fill, the ring and the dot mean, quiet
as the month's foot. Each mark is drawn as on a day. */
-p[mapa-week-key] { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; color: var(--rst-text-muted); font-size: 11px; line-height: 16px; }
-p[mapa-week-key] > span { display: inline-flex; align-items: center; gap: 5px; }
+p[mapa-week-key] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-1) var(--rst-sp-3); margin: var(--rst-sp-2) 0 0; color: var(--rst-text-muted); font-size: 11px; line-height: 16px; }
+p[mapa-week-key] > span { display: inline-flex; align-items: center; gap: var(--rst-sp-1); }
p[mapa-week-key] > span::before { content: ""; flex: none; inline-size: 10px; block-size: 10px; border-radius: 3px; }
p[mapa-week-key] > [mapa-k="shown"]::before { background: var(--rst-accent); }
p[mapa-week-key] > [mapa-k="today"]::before { box-shadow: inset 0 0 0 1.5px var(--rst-accent); }
-p[mapa-week-key] > [mapa-k="wrote"]::before { inline-size: 4px; block-size: 4px; margin-inline: 3px; border-radius: 50%; background: var(--rst-text-muted); }
+p[mapa-week-key] > [mapa-k="wrote"]::before { inline-size: 4px; block-size: 4px; margin-inline: 3px; /* spacing-allow: the 4px dot centred in the 10px mark the others take */ border-radius: 50%; background: var(--rst-text-muted); }
[mapa-icon-link] {
display: inline-grid;
place-items: center;
@@ -224,9 +226,9 @@ details[mapa-calendar] > summary::-webkit-details-marker { display: none; }
[mapa-day-now] {
display: inline-flex;
align-items: center;
- gap: 6px;
+ gap: var(--rst-sp-1);
block-size: 26px;
- padding-inline: 8px;
+ padding-inline: var(--rst-sp-2);
border-radius: 999px;
color: var(--rst-text);
font-size: 13px;
@@ -240,18 +242,18 @@ details[mapa-calendar] > summary::-webkit-details-marker { display: none; }
inset-block-start: calc(100% + 8px);
inset-inline-end: -40px;
inline-size: 256px;
- padding: 10px;
+ padding: var(--rst-sp-3);
border: 1px solid var(--rst-line);
border-radius: 12px;
background: var(--rst-surface);
box-shadow: 0 18px 40px -16px rgb(23 32 60 / 0.35);
font-size: 12.5px;
}
-[mapa-month-head] { display: flex; align-items: center; gap: 2px; padding: 2px 2px 8px 6px; }
+[mapa-month-head] { display: flex; align-items: center; gap: var(--rst-sp-1); padding: 0 0 var(--rst-sp-2) var(--rst-sp-2); }
[mapa-month-head] strong { flex: 1; font-size: 13.5px; font-weight: 650; }
table[mapa-month-grid] { inline-size: 100%; border-collapse: collapse; text-align: center; }
-table[mapa-month-grid] th { padding-block: 4px; color: var(--rst-text-muted); font-size: 11px; font-weight: 600; }
-table[mapa-month-grid] td { padding: 1px; }
+table[mapa-month-grid] th { padding-block: var(--rst-sp-1); color: var(--rst-text-muted); font-size: 11px; font-weight: 600; }
+table[mapa-month-grid] td { padding: 1px; /* spacing-allow: a hairline between days, as the week strip's */ }
table[mapa-month-grid] a {
position: relative;
display: grid;
@@ -264,8 +266,8 @@ table[mapa-month-grid] a {
}
table[mapa-month-grid] a:hover { background: var(--rst-surface-2); }
table[mapa-month-grid] a[mapa-outside] { color: var(--rst-text-muted); opacity: 0.7; }
-[mapa-month-foot] { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 2px 0 6px; color: var(--rst-text-muted); font-size: 12px; }
-[mapa-dot] { display: inline-block; inline-size: 4px; block-size: 4px; margin-inline-end: 4px; border-radius: 50%; background: var(--rst-text-muted); vertical-align: middle; }
+[mapa-month-foot] { display: flex; align-items: center; justify-content: space-between; gap: var(--rst-sp-2); padding: var(--rst-sp-2) 0 0 var(--rst-sp-2); color: var(--rst-text-muted); font-size: 12px; }
+[mapa-dot] { display: inline-block; inline-size: 4px; block-size: 4px; margin-inline-end: var(--rst-sp-1); border-radius: 50%; background: var(--rst-text-muted); vertical-align: middle; }
[mapa-month-foot] [rst-btn] { min-block-size: 26px; padding-block: 0; font-size: 12px; }
/* ── The phone: the panel is a sheet at the foot with a peek line;
@@ -286,19 +288,19 @@ table[mapa-month-grid] a[mapa-outside] { color: var(--rst-text-muted); opacity:
[mapa-peek] {
display: grid;
justify-items: center;
- gap: 6px;
+ gap: var(--rst-sp-2);
inline-size: 100%;
- padding: 8px 16px 12px;
+ padding: var(--rst-sp-2) var(--rst-sp-4) var(--rst-sp-3);
border: 0;
background: none;
color: var(--rst-text);
font: 600 14px var(--rst-font);
cursor: pointer;
}
- [mapa-peek] > span:last-child { display: inline-flex; align-items: center; gap: 8px; }
+ [mapa-peek] > span:last-child { display: inline-flex; align-items: center; gap: var(--rst-sp-2); }
[mapa-peek] svg { inline-size: 16px; block-size: 16px; color: var(--rst-accent); }
[mapa-grabber] { inline-size: 36px; block-size: 4px; border-radius: 4px; background: var(--rst-line-strong); opacity: 0.6; }
- [mapa-doc] { padding-block-end: 140px; }
+ [mapa-doc] { padding-block-end: 140px; /* spacing-allow: the page's foot room, and clear of the sheet's 62px peek */ }
[mapa-month] { position: fixed; inset-inline: 12px; inset-block-start: calc(var(--mapa-bar-h) + 8px); inline-size: auto; }
}
@media (prefers-reduced-motion: reduce) {
diff --git a/internal/mapa/static/mapa.css b/internal/mapa/static/mapa.css
index 3f5b40f..2a6553e 100644
--- a/internal/mapa/static/mapa.css
+++ b/internal/mapa/static/mapa.css
@@ -24,115 +24,6 @@
margin: 0;
}
-/* ---- The page's vertical rhythm: Fiesta's rst-stack, rst-section and
- rst-actions (rastrillo/fiesta feat/stack-rhythm), copied ahead of
- their release. When Fiesta ships them, the swap is a rename:
- mapa-stack to rst-stack, mapa-section to rst-section, mapa-action-row
- to rst-actions, and this block goes.
-
- A stack is a flex column, so no margin collapses; every child's own
- block margins are zeroed, and the space before each child comes from
- one table, by what it is and what it follows. Higher wins:
-
- before an actions row or a button --rst-sp-4
- (rst-form-actions, the confirm form,
- is one too: Mapa's addition)
- after a heading --rst-sp-2
- a label or hint, then its input --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
-
- Each relation sets its own custom property and the one margin rule
- reads them in that order, so the precedence is written here rather
- than left to specificity; every child resets all five first, so a
- nested stack's child never inherits its parent's answer. A section
- is a stack, and a new section where it sits. An actions row holds
- buttons and one-button forms side by side, wrapping on a phone. */
-[mapa-stack],
-[mapa-section] { display: flex; flex-direction: column; }
-[mapa-stack] > :not([hidden]),
-[mapa-section] > :not([hidden]) {
- --mapa-stack-actions: initial;
- --mapa-stack-heading: initial;
- --mapa-stack-control: initial;
- --mapa-stack-section: initial;
- --mapa-stack-sub: initial;
- margin-block: 0;
-}
-[mapa-stack] > :not([hidden]) + :not([hidden]),
-[mapa-section] > :not([hidden]) + :not([hidden]) {
- margin-block-start: var(--mapa-stack-actions, var(--mapa-stack-heading, var(--mapa-stack-control, var(--mapa-stack-section, var(--mapa-stack-sub, var(--rst-sp-3))))));
-}
-[mapa-stack] > button,
-[mapa-section] > button,
-[mapa-stack] > [rst-btn],
-[mapa-section] > [rst-btn],
-[mapa-stack] > img,
-[mapa-section] > img { align-self: flex-start; }
-[mapa-stack] > :not([hidden]) + h3,
-[mapa-section] > :not([hidden]) + h3,
-[mapa-stack] > :not([hidden]) + h4,
-[mapa-section] > :not([hidden]) + h4,
-[mapa-stack] > :not([hidden]) + h5,
-[mapa-section] > :not([hidden]) + h5,
-[mapa-stack] > :not([hidden]) + h6,
-[mapa-section] > :not([hidden]) + h6 { --mapa-stack-sub: var(--rst-sp-4); }
-[mapa-stack] > :not([hidden]) + h1,
-[mapa-section] > :not([hidden]) + h1,
-[mapa-stack] > :not([hidden]) + h2,
-[mapa-section] > :not([hidden]) + h2,
-[mapa-stack] > :not([hidden]) + [mapa-section],
-[mapa-section] > :not([hidden]) + [mapa-section],
-[mapa-stack] > [rst-page-header] + :not([hidden]),
-[mapa-section] > [rst-page-header] + :not([hidden]) { --mapa-stack-section: var(--rst-sp-5); }
-[mapa-stack] > label + input:not([hidden]),
-[mapa-section] > label + input:not([hidden]),
-[mapa-stack] > label + select:not([hidden]),
-[mapa-section] > label + select:not([hidden]),
-[mapa-stack] > label + textarea:not([hidden]),
-[mapa-section] > label + textarea:not([hidden]),
-[mapa-stack] > [rst-field-help] + input:not([hidden]),
-[mapa-section] > [rst-field-help] + input:not([hidden]),
-[mapa-stack] > [rst-field-help] + select:not([hidden]),
-[mapa-section] > [rst-field-help] + select:not([hidden]),
-[mapa-stack] > [rst-field-help] + textarea:not([hidden]),
-[mapa-section] > [rst-field-help] + textarea:not([hidden]) { --mapa-stack-control: var(--rst-sp-2); }
-[mapa-stack] > h1 + :not([hidden]),
-[mapa-section] > h1 + :not([hidden]),
-[mapa-stack] > h2 + :not([hidden]),
-[mapa-section] > h2 + :not([hidden]),
-[mapa-stack] > h3 + :not([hidden]),
-[mapa-section] > h3 + :not([hidden]),
-[mapa-stack] > h4 + :not([hidden]),
-[mapa-section] > h4 + :not([hidden]),
-[mapa-stack] > h5 + :not([hidden]),
-[mapa-section] > h5 + :not([hidden]),
-[mapa-stack] > h6 + :not([hidden]),
-[mapa-section] > h6 + :not([hidden]) { --mapa-stack-heading: var(--rst-sp-2); }
-[mapa-stack] > :not([hidden]) + [mapa-action-row],
-[mapa-section] > :not([hidden]) + [mapa-action-row],
-[mapa-stack] > :not([hidden]) + [rst-form-foot],
-[mapa-section] > :not([hidden]) + [rst-form-foot],
-[mapa-stack] > :not([hidden]) + [rst-form-actions],
-[mapa-section] > :not([hidden]) + [rst-form-actions],
-[mapa-stack] > :not([hidden]) + button,
-[mapa-section] > :not([hidden]) + button,
-[mapa-stack] > :not([hidden]) + [rst-btn],
-[mapa-section] > :not([hidden]) + [rst-btn] { --mapa-stack-actions: var(--rst-sp-4); }
-[mapa-action-row] { align-items: center; display: flex; flex-wrap: wrap; gap: var(--rst-sp-2); }
-
-/* ---- A page: its title and actions on one row, the body on a card. */
-[mapa-page-head] {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- justify-content: space-between;
- gap: var(--rst-sp-3);
- margin-block-end: var(--rst-sp-4);
-}
-[mapa-page-head] h1 { margin: 0; }
[mapa-actions] {
display: flex;
flex-wrap: wrap;
@@ -175,8 +66,7 @@ a[mapa-link="pending"] {
[mapa-note], [mapa-embed] { color: var(--rst-text-muted); }
/* ---- Backlinks and mentions: each linking page with its blocks. */
-[mapa-linked] { margin-block-start: var(--rst-sp-5); }
-[mapa-linked] h2 { font-size: var(--rst-fs-lg); margin-block: 0 var(--rst-sp-2); }
+[mapa-linked] h2 { font-size: var(--rst-fs-lg); }
[mapa-sources] {
list-style: none;
margin: 0;
@@ -199,7 +89,7 @@ a[mapa-link="pending"] {
color: var(--rst-text-muted);
}
[mapa-context] > :first-child { margin-block: var(--rst-sp-1) 0; }
-[mapa-context] ul, [mapa-context] ol { padding-inline-start: 1.25rem; }
+[mapa-context] ul, [mapa-context] ol { padding-inline-start: var(--rst-sp-5); }
[mapa-link-it] { flex: none; }
/* ---- A plain list of pages: a title over a muted line, no bullets. */
@@ -257,14 +147,13 @@ a[mapa-link="pending"] {
[mapa-choice-body] > :first-child { margin-block: 0; }
/* ---- Search: the box and its button on one row. */
-[mapa-search] { margin-block-end: var(--rst-sp-4); }
[mapa-search-row] {
display: flex;
gap: var(--rst-sp-2);
align-items: center;
}
[mapa-search-row] input { flex: 1; min-inline-size: 0; }
-[mapa-create] { margin-block: 0 var(--rst-sp-3); }
+
[mapa-results] > li { display: block; }
[mapa-result] p { margin-block-start: var(--rst-sp-1); }
@@ -345,7 +234,7 @@ a[mapa-link="pending"] {
[mapa-palette-results]:empty { display: none; }
[mapa-palette] {
inline-size: min(36rem, calc(100vw - 2rem));
- margin-block-start: 12vh;
+ margin-block-start: 12vh; /* spacing-allow: the dialog sits a share of the window down, as a palette does */
padding: var(--rst-sp-3);
border: 1px solid var(--rst-line);
border-radius: var(--rst-radius);
@@ -464,7 +353,7 @@ img.ProseMirror-separator {
z-index: 40;
box-sizing: border-box;
inline-size: min(264px, calc(100vw - 8px));
- padding: 10px;
+ padding: var(--rst-sp-3);
background: var(--rst-surface);
border: 1px solid var(--rst-line);
border-radius: 12px;
@@ -476,15 +365,15 @@ img.ProseMirror-separator {
box-sizing: border-box;
inline-size: 100%;
min-block-size: 30px;
- margin-block-end: 6px;
- padding: 4px 8px;
+ margin-block-end: var(--rst-sp-2);
+ padding: var(--rst-sp-1) var(--rst-sp-2);
border: 1px solid var(--rst-line-strong);
border-radius: 8px;
background: var(--rst-surface);
color: var(--rst-text);
font: inherit;
}
-[mapa-datepick-head] { display: flex; align-items: center; gap: 2px; padding: 2px 2px 6px 6px; }
+[mapa-datepick-head] { display: flex; align-items: center; gap: var(--rst-sp-1); padding: 0 0 var(--rst-sp-2) var(--rst-sp-2); }
[mapa-datepick-head] strong { flex: 1; font-size: 13.5px; font-weight: 650; }
[mapa-datepick-head] button {
display: inline-grid;
@@ -501,7 +390,7 @@ img.ProseMirror-separator {
[mapa-datepick-head] button:hover { background: var(--rst-surface-2); color: var(--rst-text); }
[mapa-datepick-head] svg { inline-size: 15px; block-size: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[mapa-datepick] table { inline-size: 100%; border-collapse: collapse; text-align: center; }
-[mapa-datepick] th { padding-block: 4px; color: var(--rst-text-muted); font-size: 11px; font-weight: 600; }
+[mapa-datepick] th { padding-block: var(--rst-sp-1); color: var(--rst-text-muted); font-size: 11px; font-weight: 600; }
[mapa-datepick] td {
block-size: 30px;
padding: 0;
@@ -519,7 +408,7 @@ img.ProseMirror-separator {
z-index: 40;
max-inline-size: min(22rem, calc(100vw - 8px));
margin: 0;
- padding: 6px 10px;
+ padding: var(--rst-sp-2) var(--rst-sp-3);
background: var(--rst-surface);
border: 1px solid var(--rst-line);
border-radius: 8px;
@@ -527,7 +416,7 @@ img.ProseMirror-separator {
color: var(--rst-text);
font-size: 12.5px;
}
-[mapa-datepick-said] { min-block-size: 16px; margin: 6px 6px 0; color: var(--rst-text-muted); font-size: 12px; }
+[mapa-datepick-said] { min-block-size: 16px; margin: var(--rst-sp-2) var(--rst-sp-2) 0; color: var(--rst-text-muted); font-size: 12px; }
@media (pointer: coarse) {
[mapa-datepick] td { block-size: 36px; }
[mapa-datepick-field] { font-size: 16px; }
@@ -540,8 +429,8 @@ img.ProseMirror-separator {
position: fixed;
z-index: 40;
display: flex;
- gap: 2px;
- padding: 3px;
+ gap: var(--rst-sp-1);
+ padding: var(--rst-sp-1);
background: var(--rst-surface);
border: 1px solid var(--rst-line);
border-radius: var(--rst-radius-sm);
@@ -582,7 +471,7 @@ img.ProseMirror-separator {
flex-basis: 100%;
max-inline-size: 22rem;
margin: 0;
- padding: 2px var(--rst-sp-2) 4px;
+ padding: 0 var(--rst-sp-2) var(--rst-sp-1);
color: var(--rst-text-muted);
font-size: var(--rst-fs-sm);
}
@@ -600,7 +489,7 @@ img.ProseMirror-separator {
/* A block's ¶ (§6.3): out of the text's flow, so it moves nothing. */
[mapa-anchor] {
position: absolute;
- margin-inline-start: -28px;
+ margin-inline-start: -28px; /* spacing-allow: the ¶ hangs in the margin, its 24px box 4px clear of the text */
inline-size: 24px;
block-size: 24px;
padding: 0;
@@ -651,8 +540,9 @@ img.ProseMirror-separator {
position: absolute;
inline-size: 24px;
block-size: 24px;
+ /* spacing-allow: the button is centred on the box the server draws in the list item's marker area (prose.css) */
margin-inline-start: calc(-1.35em - 4.5px);
- margin-block-start: -1px;
+ margin-block-start: -1px; /* spacing-allow: centred on the drawn box, as above */
padding: 0;
border: 0;
border-radius: 6px;
@@ -664,8 +554,9 @@ img.ProseMirror-separator {
[mapa-task-box] {
inline-size: 32px;
block-size: 32px;
+ /* spacing-allow: the 32px target centred on the drawn box, as above */
margin-inline-start: calc(-1.35em - 8.5px);
- margin-block-start: -5px;
+ margin-block-start: -5px; /* spacing-allow: centred on the drawn box, as above */
}
}
@@ -676,9 +567,9 @@ img.ProseMirror-separator {
bottom: 0;
z-index: 45;
display: flex;
- gap: 2px;
+ gap: var(--rst-sp-1);
overflow-x: auto;
- padding: 4px max(4px, env(safe-area-inset-left));
+ padding: var(--rst-sp-1) max(var(--rst-sp-1), env(safe-area-inset-left));
background: var(--rst-surface);
border-block-start: 1px solid var(--rst-line);
}
@@ -724,12 +615,12 @@ h1[mapa-rename] [mapa-title-text][aria-busy="true"] { cursor: progress; }
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 8px 12px;
- margin-block-start: 14px;
+ gap: var(--rst-sp-2) var(--rst-sp-3);
+ margin-block-start: var(--rst-sp-3);
font-size: 14px;
}
[mapa-title-note] p { margin: 0; flex: 1 1 16rem; }
-[mapa-title-note] p:has(> [rst-spin]) { display: inline-flex; align-items: center; gap: 8px; color: var(--rst-text-muted); }
+[mapa-title-note] p:has(> [rst-spin]) { display: inline-flex; align-items: center; gap: var(--rst-sp-2); color: var(--rst-text-muted); }
[mapa-title-note] [role="alert"] { color: var(--rst-danger, var(--rst-text)); }
/* An upload's place (images §4.2): a box at a fixed height with its
@@ -767,7 +658,7 @@ h1[mapa-rename] [mapa-title-text][aria-busy="true"] { cursor: progress; }
z-index: 1;
min-inline-size: 36px;
min-block-size: 24px;
- padding: 0 8px;
+ padding: 0 var(--rst-sp-2);
border: 1.5px solid transparent;
border-radius: 999px;
background: rgb(255 255 255 / 0.92);
@@ -802,7 +693,7 @@ h1[mapa-rename] [mapa-title-text][aria-busy="true"] { cursor: progress; }
}
[mapa-alt] {
display: grid;
- gap: 4px;
+ gap: var(--rst-sp-1);
font-size: var(--rst-fs-sm);
font-weight: 400;
font-style: normal;
@@ -818,7 +709,7 @@ h1[mapa-rename] [mapa-title-text][aria-busy="true"] { cursor: progress; }
inset-inline: 0;
inset-block-end: 0;
z-index: 2;
- padding: 8px;
+ padding: var(--rst-sp-2);
background: rgb(17 17 17 / 0.84);
color: #fff;
border-end-start-radius: var(--rst-radius-sm);
@@ -842,9 +733,9 @@ h1[mapa-rename] [mapa-title-text][aria-busy="true"] { cursor: progress; }
box-sizing: border-box;
inline-size: 100%;
min-block-size: 36px;
- max-block-size: calc(4 * 1.35 * 16px + 14px);
- max-block-size: calc(4lh + 14px);
- padding: 6px 8px;
+ max-block-size: calc(4 * 1.35 * 16px + 10px);
+ max-block-size: calc(4lh + 10px);
+ padding: var(--rst-sp-1) var(--rst-sp-2);
border: 1px solid var(--rst-line);
border-radius: 6px;
background: var(--rst-surface);
@@ -876,6 +767,6 @@ h1[mapa-rename] [mapa-title-text][aria-busy="true"] { cursor: progress; }
[mapa-upload-field] [rst-input] { flex: 1 1 14rem; min-inline-size: 0; }
[mapa-upload-field] [rst-field-hint] { flex-basis: 100%; margin: 0; }
[mapa-page-images] { margin-block-start: var(--rst-sp-5); }
-[mapa-page-images] ul { padding-inline-start: 1.2em; }
-[mapa-page-images] li { margin-block: 4px; }
+[mapa-page-images] ul { padding-inline-start: var(--rst-sp-5); }
+[mapa-page-images] li { margin-block: var(--rst-sp-1); }
[mapa-page-images] a { margin-inline-start: var(--rst-sp-2); }
diff --git a/internal/mapa/static/palette.css b/internal/mapa/static/palette.css
index a87cf07..678a7fa 100644
--- a/internal/mapa/static/palette.css
+++ b/internal/mapa/static/palette.css
@@ -8,7 +8,7 @@ dialog[mapa-palette] {
box-sizing: border-box;
inline-size: min(640px, calc(100vw - 24px));
max-block-size: calc(100dvh - 24px);
- margin: min(14vh, 120px) auto auto;
+ margin: min(14vh, 120px) auto auto; /* spacing-allow: the palette sits a share of the window down, never more than 120px */
padding: 0;
border: 1px solid var(--rst-line);
border-radius: 16px;
@@ -29,9 +29,9 @@ dialog[mapa-palette]::backdrop {
[mapa-palette-box] {
display: flex;
align-items: center;
- gap: 12px;
+ gap: var(--rst-sp-3);
flex: none;
- padding: 0 16px;
+ padding: 0 var(--rst-sp-4);
block-size: 56px;
border-block-end: 1px solid var(--rst-line);
}
@@ -71,7 +71,7 @@ button[mapa-palette-esc] {
place-items: center;
min-inline-size: 32px;
min-block-size: 24px;
- padding: 1px 6px;
+ padding: 0 var(--rst-sp-1);
border: 1px solid var(--rst-line);
border-block-end-width: 2px;
border-radius: 5px;
@@ -91,7 +91,7 @@ dialog[mapa-palette] [mapa-palette-results] {
min-block-size: 0;
max-block-size: min(56vh, 440px);
margin: 0;
- padding: 6px;
+ padding: var(--rst-sp-2);
overflow: auto;
overscroll-behavior: contain;
border: 0;
@@ -100,16 +100,16 @@ dialog[mapa-palette] [mapa-palette-results] {
background: none;
}
[mapa-palette-group] + [mapa-palette-group]:has(a[href^="/new?"]) {
- margin-block-start: 4px;
- padding-block-start: 4px;
+ margin-block-start: var(--rst-sp-1);
+ padding-block-start: var(--rst-sp-1);
border-block-start: 1px solid var(--rst-line);
}
[mapa-palette-head] {
display: flex;
align-items: center;
justify-content: space-between;
- gap: 8px;
- padding: 10px 10px 4px;
+ gap: var(--rst-sp-2);
+ padding: var(--rst-sp-2) var(--rst-sp-2) var(--rst-sp-1);
color: var(--rst-text-muted);
font-size: 11.5px;
font-weight: 600;
@@ -120,9 +120,9 @@ a[mapa-palette-option] {
display: grid;
grid-template-columns: 28px minmax(0, 1fr);
align-items: center;
- column-gap: 10px;
+ column-gap: var(--rst-sp-2);
min-block-size: 44px;
- padding: 3px 10px 3px 4px;
+ padding: var(--rst-sp-1) var(--rst-sp-2) var(--rst-sp-1) var(--rst-sp-1);
border-radius: 8px;
color: var(--rst-text);
font-weight: 400;
@@ -174,20 +174,20 @@ a[mapa-palette-option][aria-selected="true"] [mapa-palette-ic] {
[mapa-palette-foot] {
display: flex;
flex-wrap: wrap;
- gap: 6px 16px;
+ gap: var(--rst-sp-1) var(--rst-sp-4);
align-items: center;
flex: none;
- padding: 9px 16px;
+ padding: var(--rst-sp-2) var(--rst-sp-4);
border-block-start: 1px solid var(--rst-line);
background: color-mix(in oklab, var(--rst-surface-2) 40%, var(--rst-surface));
color: var(--rst-text-muted);
font-size: 12px;
}
-[mapa-palette-foot] span { display: inline-flex; align-items: center; gap: 5px; }
+[mapa-palette-foot] span { display: inline-flex; align-items: center; gap: var(--rst-sp-1); }
[mapa-palette-foot] span:last-child { margin-inline-start: auto; }
@media (max-width: 799.98px) {
- dialog[mapa-palette] { margin-block-start: 12px; }
+ dialog[mapa-palette] { margin-block-start: var(--rst-sp-3); }
[mapa-palette-foot] { display: none; }
dialog[mapa-palette] [mapa-palette-results] {
max-block-size: calc(100dvh - 24px - 58px);
diff --git a/internal/mapa/static/prose.css b/internal/mapa/static/prose.css
index 6a5c064..12143bc 100644
--- a/internal/mapa/static/prose.css
+++ b/internal/mapa/static/prose.css
@@ -23,38 +23,38 @@
white-space: pre-wrap;
}
-:is([mapa-body], [mapa-prose]) p { margin: 0 0 0.85em; }
+:is([mapa-body], [mapa-prose]) p { margin: 0 0 0.85em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */ }
:is([mapa-body], [mapa-prose]) > :first-child { margin-block-start: 0; }
:is([mapa-body], [mapa-prose]) h2 {
- margin: 1.9em 0 0.45em;
+ margin: 1.9em 0 0.45em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
font-size: 1.375rem;
line-height: 1.25;
font-weight: 680;
letter-spacing: -0.012em;
}
:is([mapa-body], [mapa-prose]) h3 {
- margin: 1.6em 0 0.35em;
+ margin: 1.6em 0 0.35em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
font-size: 1.0625rem;
line-height: 1.3;
font-weight: 680;
}
:is([mapa-body], [mapa-prose]) :is(h4, h5, h6) {
- margin: 1.4em 0 0.3em;
+ margin: 1.4em 0 0.3em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
font-size: 1rem;
line-height: 1.35;
font-weight: 650;
}
:is([mapa-body], [mapa-prose]) :is(ul, ol) {
- margin: 0 0 0.9em;
- padding-inline-start: 1.5em;
+ margin: 0 0 0.9em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
+ padding-inline-start: 1.5em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
}
:is([mapa-body], [mapa-prose]) li {
- margin: 0.2em 0;
- padding-inline-start: 0.15em;
+ margin: 0.2em 0; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
+ padding-inline-start: 0.15em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
}
/* An item's paragraph sits tight in its item; a nested list follows it. */
:is([mapa-body], [mapa-prose]) li > p { margin: 0; }
-:is([mapa-body], [mapa-prose]) li > :is(ul, ol) { margin: 0.2em 0 0; }
+:is([mapa-body], [mapa-prose]) li > :is(ul, ol) { margin: 0.2em 0 0; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */ }
:is([mapa-body], [mapa-prose]) li::marker { color: var(--rst-text-faint); }
/* A task item: the box is drawn from mapa-task, and named for assistive
@@ -67,7 +67,7 @@
box-sizing: border-box;
inline-size: 15px;
block-size: 15px;
- margin-inline: -1.35em calc(1.35em - 15px);
+ margin-inline: -1.35em calc(1.35em - 15px); /* spacing-allow: the task's box drawn in the list marker's place, 1.35em before the text */
vertical-align: -2px;
border: 1.5px solid var(--rst-line-strong);
border-radius: 4px;
@@ -88,21 +88,21 @@
}
:is([mapa-body], [mapa-prose]) blockquote {
- margin: 1.1em 0;
- padding: 2px 0 2px 18px;
+ margin: 1.1em 0; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
+ padding: 0 0 0 var(--rst-sp-4);
border-inline-start: 3px solid var(--rst-line);
color: var(--rst-text-muted);
}
-:is([mapa-body], [mapa-prose]) blockquote p { margin: 0 0 0.3em; }
+:is([mapa-body], [mapa-prose]) blockquote p { margin: 0 0 0.3em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */ }
:is([mapa-body], [mapa-prose]) code {
- padding: 1px 5px;
+ padding: 0 var(--rst-sp-1);
border-radius: 5px;
background: var(--rst-surface-2);
font: 0.88em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:is([mapa-body], [mapa-prose]) pre {
- margin: 1em 0 1.1em;
- padding: 14px 16px;
+ margin: 1em 0 1.1em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
+ padding: var(--rst-sp-3) var(--rst-sp-4);
border-radius: 10px;
background: var(--rst-surface-2);
overflow-x: auto;
@@ -115,7 +115,7 @@
font: inherit;
}
:is([mapa-body], [mapa-prose]) hr {
- margin: 2em 0;
+ margin: 2em 0; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
border: 0;
border-block-start: 1px solid var(--rst-line);
}
@@ -152,7 +152,7 @@ svg[mapa-i] {
/* A page link: a pill, the page glyph in the accent, ink text. */
a[mapa-chip] {
display: inline;
- padding: 1px 6px 1px 4px;
+ padding: 0 var(--rst-sp-2) 0 var(--rst-sp-1);
border-radius: 6px;
background: color-mix(in oklab, var(--rst-surface-2) 85%, transparent);
box-shadow: inset 0 0 0 1px
@@ -169,7 +169,7 @@ span[mapa-chip="embed"] > svg[mapa-i] {
inline-size: 0.9em;
block-size: 0.9em;
vertical-align: -0.1em;
- margin-inline-end: 4px;
+ margin-inline-end: var(--rst-sp-1);
color: var(--rst-accent);
stroke-width: 2;
}
@@ -200,7 +200,7 @@ a[mapa-chip~="pending"]:hover {
/* A block whose block has gone: the page still opens, with the note. */
a[mapa-chip~="gone"] > [mapa-chip-note] {
- margin-inline-start: 6px;
+ margin-inline-start: var(--rst-sp-1);
color: var(--rst-text-muted);
font-size: 0.85em;
font-weight: 400;
@@ -211,7 +211,7 @@ a[mapa-chip~="gone"] > [mapa-chip-note] {
/* An embed, before slice 2 draws its card: a quiet chip. */
span[mapa-chip="embed"] {
- padding: 1px 6px 1px 4px;
+ padding: 0 var(--rst-sp-2) 0 var(--rst-sp-1);
border-radius: 6px;
box-shadow: inset 0 0 0 1px var(--rst-line);
color: var(--rst-text-muted);
@@ -338,7 +338,7 @@ a[mapa-chip] > [mapa-icon] {
column-gap: var(--rst-sp-5);
align-items: start;
/* The layout sits in the body's rhythm as a paragraph does. */
- margin: 0 0 0.85em;
+ margin: 0 0 0.85em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */
}
[mapa-columns="3"] { --mapa-columns: 3; }
[mapa-columns="4"] { --mapa-columns: 4; }
@@ -348,7 +348,7 @@ a[mapa-chip] > [mapa-icon] {
@container mapa-doc (max-width: 36rem) {
/* Stacked, the columns read as consecutive blocks: the body's own
gap between them. */
- [mapa-columns] { grid-template-columns: minmax(0, 1fr); row-gap: 0.85em; }
+ [mapa-columns] { grid-template-columns: minmax(0, 1fr); row-gap: 0.85em; /* spacing-allow: the document's own typographic rhythm, in em of its text (the server's HTML and the editor's DOM share it; gates L1 to L5) */ }
}
/* While editing, the layout the caret is in shows where its columns are,
as an outline, which moves nothing. */
diff --git a/internal/mapa/templates/day.html b/internal/mapa/templates/day.html
index 36d8b4e..8288af2 100644
--- a/internal/mapa/templates/day.html
+++ b/internal/mapa/templates/day.html
@@ -14,9 +14,9 @@
</form>
{{template "mapa-page-images" dict "Images" $d.Images "Back" (printf "/d/%s/edit" $page.Date)}}
{{else}}
-{{template "mapa-island" $d.Island}}<article mapa-body>{{$page.HTML}}</article>
+{{template "mapa-island" $d.Island}}<article mapa-body rst-section>{{$page.HTML}}</article>
{{end}}
-<footer mapa-foot-refs>
+<footer mapa-foot-refs rst-stack rst-section>
{{template "mapa-linked" dict "ID" "backlinks" "Heading" "Linked from" "Items" $page.Backlinks "Empty" "Nothing links to this day yet." "Target" 0}}
{{if $d.Written}}{{template "mapa-links-out" $page}}{{end}}
</footer>
diff --git a/internal/mapa/templates/frame.html b/internal/mapa/templates/frame.html
index 5c7e684..a374dd7 100644
--- a/internal/mapa/templates/frame.html
+++ b/internal/mapa/templates/frame.html
@@ -83,7 +83,7 @@
</aside>{{end}}
{{define "mapa-peek-line"}}{{if .Week}}This week, and links out{{else}}Linked from {{number L (len .Page.Backlinks)}}{{if eq .Page.Kind "page"}}, mentioned in {{number L (len .Page.Mentions)}}{{end}}{{end}}{{end}}
-{{define "mapa-links-out"}}<section aria-labelledby="mapa-out-h"><h2 id="mapa-out-h">Links out {{with .Around}}<small>{{number L (len .Out)}}</small>{{end}}</h2>
+{{define "mapa-links-out"}}<section rst-stack rst-section aria-labelledby="mapa-out-h"><h2 id="mapa-out-h">Links out {{with .Around}}<small>{{number L (len .Out)}}</small>{{end}}</h2>
{{with .Around}}{{with .Out}}<p mapa-chips>{{range .}}<a mapa-chip="{{.Kind}}" href="{{.Href}}">{{if eq .Kind "date"}}{{icon "calendar"}}{{else if eq .Kind "pending"}}{{icon "file-plus"}}{{else}}{{pageIcon .Look "file"}}{{end}}<span>{{.Label}}</span>{{if eq .Kind "pending"}}<span mapa-sr>, page not written yet</span>{{end}}</a>{{end}}</p>
{{else}}<p mapa-meta>{{if eq $.Kind "daily"}}No links out yet.{{else}}This page links nowhere yet.{{end}}</p>{{end}}{{end}}
</section>{{end}}
diff --git a/internal/mapa/templates/help_markdown.html b/internal/mapa/templates/help_markdown.html
index e0a42db..36ae1b1 100644
--- a/internal/mapa/templates/help_markdown.html
+++ b/internal/mapa/templates/help_markdown.html
@@ -1,5 +1,5 @@
{{define "content"}}
-<header mapa-page-head>
+<header mapa-page-head rst-page-header>
<div mapa-doc-kicker><span>{{icon "help-circle"}}Help</span></div>
<h1 mapa-title>Markdown in Mapa</h1>
</header>
diff --git a/internal/mapa/templates/import.html b/internal/mapa/templates/import.html
index 9dad0c6..43c9ba3 100644
--- a/internal/mapa/templates/import.html
+++ b/internal/mapa/templates/import.html
@@ -1,11 +1,10 @@
{{define "head"}}{{with .Data.Run}}{{if .Refresh}}<meta http-equiv="refresh" content="5">{{end}}{{end}}{{end}}
{{define "content"}}{{$d := .Data}}
-<div mapa-stack>
{{template "page-header" dict "Title" "Import from Notion" "Sub" "Copy pages from a Notion workspace into this team's Mapa."}}
{{template "notice" $d.Notice}}
{{template "form-error" $d.Error}}
-{{with $d.Run}}<section mapa-section mapa-import-run aria-labelledby="import-run">
-<div mapa-stack role="status">
+{{with $d.Run}}<section rst-stack rst-section mapa-import-run aria-labelledby="import-run">
+<div rst-stack role="status">
<h2 id="import-run">{{if eq .State "surveying"}}Reading Notion{{else if eq .State "writing"}}Writing pages{{else if eq .State "done"}}Run complete{{else if eq .State "interrupted"}}Interrupted{{else if eq .State "stopped"}}Stopped{{else}}The import failed{{end}}</h2>
{{if eq .State "surveying"}}<p>Pages read so far: {{number L .Surveyed}}. The total isn't known until every shared page has been read.</p>
{{else if eq .State "writing"}}<p>{{number L .Written}} of {{number L .Total}} so far.</p>
@@ -18,22 +17,21 @@
</section>{{else}}{{template "import-start" $d}}{{end}}
{{with $d.Report}}{{template "import-report" .}}{{end}}
{{if not $d.CanStop}}{{template "import-connection" $d}}{{end}}
-</div>
{{end}}
{{define "import-start"}}{{if and .NoImages .CanStart}}<p mapa-meta>Images aren't set up in Mapa yet, so each image from Notion comes in as a line saying it wasn't imported. Run the import again once images are set up, and the pages nobody has edited get their pictures.</p>{{end}}
{{with .Images}}{{if $.CanStart}}<p mapa-meta>Imported images count against the team's image allowance, now {{.Team}} used, and, until each page is written, against yours, now {{.Own}}. If either fills, the run stops fetching images and says so; raise it, or free some, and run again.</p>{{end}}{{end}}
-{{if or .CanStop .CanResume .CanStart .CanStartOver}}<div mapa-action-row mapa-import-actions>
+{{if or .CanStop .CanResume .CanStart .CanStartOver}}<div rst-actions mapa-import-actions>
{{if .CanStop}}<form method="post" action="/import/notion/stop"><button rst-btn type="submit">Stop</button></form>{{end}}
{{if .CanResume}}<form method="post" action="/import/notion/resume"><button rst-btn="primary" type="submit">Resume</button></form>{{end}}
{{if .CanStartOver}}<form method="post" action="/import/notion/startover"><button rst-btn type="submit">Start over</button></form>{{end}}
{{if .CanStart}}<form method="post" action="/import/notion/start"><button rst-btn="primary" type="submit">{{if .Run}}Run the import again{{else}}Start the import{{end}}</button></form>{{end}}
</div>{{end}}{{end}}
-{{define "import-connection"}}<section mapa-section mapa-import-connection aria-labelledby="import-connection">
+{{define "import-connection"}}<section rst-stack rst-section mapa-import-connection aria-labelledby="import-connection">
<h2 id="import-connection">Connection</h2>
{{if .Connected}}<p>Connected to {{if .Workspace}}the Notion workspace “{{.Workspace}}”{{else}}a Notion workspace{{end}}. Mapa holds its secret, sealed, and never shows it.</p>
-<div mapa-action-row><a rst-btn href="/import/notion/finish">Finish import…</a><a rst-btn href="/import/notion/disconnect">Disconnect…</a></div>
+<div rst-actions><a rst-btn href="/import/notion/finish">Finish import…</a><a rst-btn href="/import/notion/disconnect">Disconnect…</a></div>
<details><summary>Replace the secret</summary>{{template "import-token-form" .}}</details>
{{else}}{{if .Finished}}<p><strong>The previous import was ended.</strong> Connecting again starts a new import. It has no record of what the last one wrote, so it would create a second copy of every page it finds.</p>{{end}}
<p><strong>Everything you share with this integration becomes a team page that every member of this team can read.</strong> Share only what the whole team should have.</p>
@@ -52,7 +50,7 @@
{{template "form-foot" dict "Submit" "Connect"}}
</form>{{end}}
-{{define "import-report"}}<section mapa-section mapa-import-report aria-labelledby="import-report">
+{{define "import-report"}}<section rst-stack rst-section mapa-import-report aria-labelledby="import-report">
<h2 id="import-report">Report</h2>
{{range .ImageFailures}}{{if eq .Label "images aren't set up in Mapa yet"}}<p mapa-notice role="status"><strong>No images were imported: images aren't set up in Mapa yet.</strong> Each one is a line in its page. Run the import again once images are set up.</p>{{end}}{{if hasSuffix .Label "allowance is full"}}<p mapa-notice role="status"><strong>Images stopped: {{.Label}}.</strong> Raise that allowance, or free some, and run the import again: the pages waiting for images are filled in.</p>{{end}}{{end}}
{{with .Roots}}<p>Started from: {{range $i, $r := .}}{{if $i}}, {{end}}“{{$r}}”{{end}}.</p>{{end}}
diff --git a/internal/mapa/templates/import_confirm.html b/internal/mapa/templates/import_confirm.html
index 1c12f26..4de3b9a 100644
--- a/internal/mapa/templates/import_confirm.html
+++ b/internal/mapa/templates/import_confirm.html
@@ -1,5 +1,4 @@
{{define "content"}}{{$d := .Data}}
-<div mapa-stack>
{{template "back-nav" dict "Href" "/import/notion" "Label" "Import from Notion"}}
{{if eq $d.Act "disconnect"}}{{template "page-header" dict "Title" "Disconnect from Notion?"}}
<p>Mapa deletes the integration's secret. The pages already imported stay, and so does Mapa's record of which Notion page each came from, so connecting again later carries on from there. An interrupted run can't be resumed.</p>
@@ -11,7 +10,6 @@
{{end}}
<p>Then remove the integration from Notion's connection settings.</p>
{{if $d.Active}}{{template "form-error" "An import is running. Stop the run first."}}
-<div mapa-action-row><a rst-btn href="/import/notion">Back</a></div>
+<div rst-actions><a rst-btn href="/import/notion">Back</a></div>
{{else}}{{template "confirm-form" dict "Action" $d.Action "Label" (index (dict "disconnect" "Disconnect" "finish" "Finish import" "forget" "Forget the import") $d.Act) "Danger" true "CancelHref" "/import/notion" "CancelLabel" "Cancel"}}{{end}}
-</div>
{{end}}
diff --git a/internal/mapa/templates/look.html b/internal/mapa/templates/look.html
index fc8fd7f..eae1f71 100644
--- a/internal/mapa/templates/look.html
+++ b/internal/mapa/templates/look.html
@@ -7,7 +7,7 @@
{{template "page-header" dict "Title" "Icon and banner" "Sub" "Everyone in the team sees the icon and banner wherever this page's title appears."}}
{{template "notice" $d.Notice}}
{{with $d.Error}}<p rst-field-error role="alert" mapa-look-error>{{.}}</p>{{end}}
-<section mapa-look-section aria-labelledby="look-icon" id="icon">
+<section mapa-look-section rst-stack rst-section aria-labelledby="look-icon" id="icon">
<h2 id="look-icon">Icon</h2>
{{with $page.Look}}<p mapa-look-now>{{pageIcon . ""}} Current icon</p>{{end}}
<form rst-form method="post" action="{{$action}}" mapa-look-form>
@@ -25,7 +25,7 @@
</form>
{{if $page.Look}}<form method="post" action="{{$action}}" mapa-look-form><input type="hidden" name="do" value="remove-icon"><button rst-btn type="submit">Remove icon</button></form>{{end}}
</section>
-<section mapa-look-section aria-labelledby="look-banner" id="banner">
+<section mapa-look-section rst-stack rst-section aria-labelledby="look-banner" id="banner">
<h2 id="look-banner">Banner</h2>
<form rst-form method="post" action="{{$action}}?upload=1&amp;for=banner" enctype="multipart/form-data" mapa-look-form>
<input type="hidden" name="y" value="50">
diff --git a/internal/mapa/templates/page.html b/internal/mapa/templates/page.html
index 54635ed..b617348 100644
--- a/internal/mapa/templates/page.html
+++ b/internal/mapa/templates/page.html
@@ -3,10 +3,10 @@
{{template "mapa-doc-head" dict "Page" $page "Last" $d.Last "Edit" (printf "%s/edit" $page.Href) "Rename" $d.Rename "Look" (and (eq $page.Kind "page") (printf "%s/look" $page.Href)) "Banner" $d.Banner}}
{{template "notice" $d.Notice}}
{{with $d.Draft}}{{template "mapa-unsaved" dict "Draft" . "Save" (printf "/p/%s/draft/save" $page.Public) "Discard" (printf "/p/%s/draft/discard" $page.Public) "Href" $page.Href "Saved" $d.Saved}}{{end}}
-{{template "mapa-island" $d.Island}}<article mapa-body>
+{{template "mapa-island" $d.Island}}<article mapa-body rst-section>
{{if or $page.Body $d.Island}}{{$page.HTML}}{{else}}<p mapa-empty>This page is empty. <a href="{{$page.Href}}/edit">Write something</a>.</p>{{end}}
</article>
-<footer mapa-foot-refs>
+<footer mapa-foot-refs rst-stack rst-section>
{{template "mapa-linked" dict "ID" "backlinks" "Heading" "Linked from" "Items" $page.Backlinks "Empty" "Nothing links here yet." "Target" 0}}
{{if eq $page.Kind "page"}}
{{template "mapa-linked" dict "ID" "mentions" "Heading" "Mentioned without a link" "Items" $page.Mentions "Empty" "No unlinked mentions." "Target" $page.Public}}
diff --git a/internal/mapa/templates/partials.html b/internal/mapa/templates/partials.html
index 0c62a67..6eca234 100644
--- a/internal/mapa/templates/partials.html
+++ b/internal/mapa/templates/partials.html
@@ -4,7 +4,7 @@
{{/* mapa-linked: a backlink or mention group. Keys: Items ([]Linked),
Heading, Empty, Target (the page's id, for "Link it"; 0 for none). */}}
{{define "mapa-linked"}}
-<section mapa-linked aria-labelledby="{{.ID}}">
+<section mapa-linked rst-stack rst-section aria-labelledby="{{.ID}}">
<h2 id="{{.ID}}">{{.Heading}}</h2>
{{if .Items}}{{$target := .Target}}
<ul mapa-sources>
@@ -41,7 +41,7 @@
{{/* mapa-page-images: "Images on this page" (images §3.3, §4.4), each
with Open and Remove. Keys: Images ([]ListedImage), Back (where
Remove returns). */}}
-{{define "mapa-page-images"}}{{if .Images}}<section mapa-page-images aria-labelledby="page-images-title">
+{{define "mapa-page-images"}}{{if .Images}}<section mapa-page-images rst-stack rst-section aria-labelledby="page-images-title">
<h2 id="page-images-title">Images on this page</h2>
<ul>{{range .Images}}<li><span>{{.Label}}</span> <a href="/i/{{.ID}}">Open</a> <a href="/i/{{.ID}}/remove?back={{$.Back}}">Remove from Mapa</a></li>{{end}}</ul>
<p mapa-meta>Removing an image takes it out of Mapa everywhere, History included. A browser that has already shown it may keep its own copy for up to an hour.</p>
@@ -64,7 +64,7 @@
{{/* mapa-island: the editor's data (level-up §6.8), JSON written by
encoding/json, which escapes <, >, & and U+2028/9, and the editor's
bundle, a module, so deferred (§6.2). The editor mounts on the
- <article mapa-body> that follows. */}}
+ <article mapa-body rst-section> that follows. */}}
{{define "mapa-island"}}{{with .}}<script type="application/json" id="mapa-editor">{{.}}</script>
<script type="module" src="{{editor}}"></script>
{{end}}{{end}}
@@ -82,7 +82,7 @@
With Rename, the editor's script makes the title's text editable
in place (editor/title.mjs, build note 78); without script it is
the plain heading it always was. */}}
-{{define "mapa-doc-head"}}{{$page := .Page}}<header mapa-page-head>
+{{define "mapa-doc-head"}}{{$page := .Page}}<header mapa-page-head rst-page-header>
<div mapa-doc-kicker>
{{- if eq $page.Kind "page"}}<span>{{icon "users"}}Team page</span>
{{- else if eq $page.Kind "daily"}}<span>{{icon "lock"}}Your note. Only you can open it.</span>
diff --git a/internal/mapa/templates/revision.html b/internal/mapa/templates/revision.html
index 73c489d..9fc8232 100644
--- a/internal/mapa/templates/revision.html
+++ b/internal/mapa/templates/revision.html
@@ -4,7 +4,7 @@
<span><b>{{$d.Banner}}</b> {{$d.Note}}</span>
<a rst-btn href="{{$d.Page.Href}}">Back to current</a>
</div>
-<header mapa-page-head><h1 mapa-title>{{with $d.Look}}{{pageIcon . ""}}{{end}}{{$d.Title}}</h1></header>
+<header mapa-page-head rst-page-header><h1 mapa-title>{{with $d.Look}}{{pageIcon . ""}}{{end}}{{$d.Title}}</h1></header>
<article mapa-body mapa-version>
{{if $d.HTML}}{{$d.HTML}}{{else}}<p mapa-empty>This version is empty.</p>{{end}}
</article>
diff --git a/internal/mapa/templates/scratch_new.html b/internal/mapa/templates/scratch_new.html
index fae5c98..cceef74 100644
--- a/internal/mapa/templates/scratch_new.html
+++ b/internal/mapa/templates/scratch_new.html
@@ -1,7 +1,7 @@
{{define "content"}}{{$d := .Data}}
{{if $d.Island}}
{{template "mapa-doc-head" dict "Page" $d.Page "Edit" "/scratch/new?markdown=1"}}
-{{template "mapa-island" $d.Island}}<article mapa-body>{{$d.Page.HTML}}</article>
+{{template "mapa-island" $d.Island}}<article mapa-body rst-section>{{$d.Page.HTML}}</article>
{{else}}
{{template "back-nav" dict "Href" "/scratch" "Label" "Scratch"}}
{{template "page-header" dict "Title" "New scratch page" "Sub" "Only you can open it. It is saved when you save it, and not before."}}
diff --git a/internal/mapa/templates/search.html b/internal/mapa/templates/search.html
index 43a2d02..d5a5f41 100644
--- a/internal/mapa/templates/search.html
+++ b/internal/mapa/templates/search.html
@@ -1,11 +1,13 @@
{{define "content"}}{{$r := .Data}}
{{template "page-header" dict "Title" "Search" "Sub" "Team pages, and your own notes."}}
-<form method="get" action="/search" role="search" mapa-search>
+<form method="get" action="/search" role="search" mapa-search rst-stack>
+<div rst-field>
<label rst-field-label for="q">Search for</label>
<div mapa-search-row>
<input rst-input type="search" id="q" name="q" value="{{$r.Query}}" autocomplete="off" autofocus mapa-search-box>
<button rst-btn="primary" type="submit">{{icon "search"}} Search</button>
</div>
+</div>
<p mapa-meta mapa-search-hint>Type a date, like “friday”, to open that day.</p>
</form>
{{if $r.Query}}
diff --git a/internal/mapa/templates/shell.html b/internal/mapa/templates/shell.html
index 4ecf4b8..7ca15b1 100644
--- a/internal/mapa/templates/shell.html
+++ b/internal/mapa/templates/shell.html
@@ -39,7 +39,7 @@
{{template "mapa-side" .Frame.Side}}
<main mapa-main id="main">
{{block "banner" .}}{{end}}
-<div mapa-doc rst-page>
+<div mapa-doc rst-page rst-stack>
{{template "content" .}}
</div>
</main>
diff --git a/internal/mapatest/import_rhythm_browser_test.go b/internal/mapatest/import_rhythm_browser_test.go
index 21c6ac9..b6f0baf 100644
--- a/internal/mapatest/import_rhythm_browser_test.go
+++ b/internal/mapatest/import_rhythm_browser_test.go
@@ -3,15 +3,9 @@
package mapatest
import (
- "context"
- _ "embed"
- "encoding/json"
- "fmt"
- "strings"
"testing"
"time"
- "amadan.net/rastrillo/rastrillo/harness"
"github.com/chromedp/chromedp"
)
@@ -23,31 +17,18 @@ import (
// sits closer than --rst-sp-2 to a control, and every heading is closer
// to its own content than to the block before it.
-// rhythmScript is Fiesta's check/rhythm audit, vendored ahead of its
-// release (testdata/rhythm/README).
-//
-//go:embed testdata/rhythm/rhythm.js
-var rhythmScript string
-
-// rhythmFinding is one thing the audit saw, as check/rhythm's Finding.
-type rhythmFinding struct {
- Kind string `json:"kind"`
- Gap float64 `json:"gap"`
- Before string `json:"before"`
- After string `json:"after"`
- Message string `json:"message"`
-}
-
-// rhythmSkip is what the audit leaves alone on the import page:
+// importRhythmSkip is what the audit leaves alone on the import page:
// rst-form is Fiesta's form, whose rhythm (and the extra air above its
// closing row) is Fiesta's to set and its own gates' to check.
-var rhythmSkip = []string{"[rst-form]"}
+var importRhythmSkip = []string{"[rst-form]"}
func TestImportPageRhythm(t *testing.T) {
rig, server, database := importRig(t)
rig.Run(scripts(false))
page := rig.Origin + "/import/notion"
- audit := func(stage string) { auditRhythm(t, rig, stage) }
+ audit := func(stage string) {
+ auditRhythm(t, rig, stage, importRhythmSkip)
+ }
drive(t, rig, chromedp.Navigate(page))
audit("connect")
drive(t, rig, chromedp.SendKeys(`input[name="token"]`, "secret_test"),
@@ -81,45 +62,3 @@ func TestImportPageRhythm(t *testing.T) {
audit("confirm " + act)
}
}
-
-// auditRhythm runs the audit over the page's content and fails the
-// test on each finding, naming the stage. A read that lands while the
-// page's own refresh replaces it is tried again.
-func auditRhythm(t *testing.T, rig *harness.Rig, stage string) {
- t.Helper()
- options, err := json.Marshal(map[string]any{"skip": rhythmSkip})
- if err != nil {
- t.Fatal(err)
- }
- expression := "JSON.stringify((" + rhythmScript + ")(\"[mapa-doc]\", " +
- string(options) + "))"
- var answer string
- for try := 0; ; try++ {
- ctx, cancel := context.WithTimeout(rig.Context(), 10*time.Second)
- answer, err = chromedp.Run(ctx, chromedp.Evaluate[string](expression))
- cancel()
- if err == nil || try == 2 {
- break
- }
- }
- if err != nil {
- t.Fatalf("%s: the rhythm audit did not run: %v", stage, err)
- }
- var found []rhythmFinding
- if err := json.Unmarshal([]byte(answer), &found); err != nil {
- t.Fatalf("%s: the rhythm audit answered %q: %v", stage, answer, err)
- }
- if len(found) > 0 {
- t.Errorf("%s: the import page's rhythm:\n%s", stage,
- rhythmReport(found))
- }
-}
-
-func rhythmReport(found []rhythmFinding) string {
- lines := make([]string, len(found))
- for at, finding := range found {
- lines[at] = fmt.Sprintf("%s: %s\n\tabove: %s\n\tbelow: %s",
- finding.Kind, finding.Message, finding.Before, finding.After)
- }
- return strings.Join(lines, "\n")
-}
diff --git a/internal/mapatest/island_test.go b/internal/mapatest/island_test.go
index f634e5d..ead07ab 100644
--- a/internal/mapatest/island_test.go
+++ b/internal/mapatest/island_test.go
@@ -46,14 +46,14 @@ func TestTheIslandCarriesTheDraftAndThePageShowsIt(t *testing.T) {
data.Links["2026-11-12"].Kind != "date" || len(data.Links) != 2 {
t.Fatalf("the island's chips: %+v", data.Links)
}
- article := between(page, "<article mapa-body>", "</article>")
+ article := between(page, "<article mapa-body rst-section>", "</article>")
if !strings.Contains(article, "Unsaved text.") ||
!strings.Contains(page, "You're seeing your unsaved version.") ||
!strings.Contains(page, `href="`+acme+`?saved=1"`) {
t.Fatal("the page does not show Ana her draft, with the bar")
}
saved := rig.page(t, Ana, acme+"?saved=1")
- if !strings.Contains(between(saved, "<article mapa-body>",
+ if !strings.Contains(between(saved, "<article mapa-body rst-section>",
"</article>"), "Saved text.") ||
strings.Contains(saved, `id="mapa-editor"`) ||
!strings.Contains(saved, "You're seeing the saved version.") {
diff --git a/internal/mapatest/locale_test.go b/internal/mapatest/locale_test.go
index 56183c9..4fc4296 100644
--- a/internal/mapatest/locale_test.go
+++ b/internal/mapatest/locale_test.go
@@ -143,7 +143,7 @@ func TestHistoryTimesAndCountsAreInTheReadersLocale(t *testing.T) {
">9:00 AM</time>", "Added 1,234 blocks"},
"de": {"Donnerstag, 12. November", ">21:09</time>",
"Added 1.234 blocks", `title="12. November 2026 um 21:09"`},
- "fr": {"jeudi 12 novembre", "Added 1 234 blocks"},
+ "fr": {"jeudi 12 novembre", "Added 1\u202f234 blocks"},
} {
history := rig.getIn(t, Ana, acme+"/history", language)
wantIn(t, "History", language, history, wants...)
diff --git a/internal/mapatest/rhythm_browser_test.go b/internal/mapatest/rhythm_browser_test.go
new file mode 100644
index 0000000..b013b91
--- /dev/null
+++ b/internal/mapatest/rhythm_browser_test.go
@@ -0,0 +1,101 @@
+//go:build browser
+
+package mapatest
+
+import (
+ "context"
+ "encoding/json"
+ "testing"
+ "time"
+
+ "amadan.net/rastrillo/fiesta/check/rhythm"
+ "amadan.net/rastrillo/rastrillo/harness"
+ "github.com/chromedp/chromedp"
+
+ "amadan.net/oficina/mapa/internal/mapa"
+)
+
+// Every screen keeps the spacing scale's rhythm (level-up build note
+// 89): Fiesta's audit over the page column of each signed-in screen, at
+// a desktop and a phone width, scripts off and on. Between two blocks
+// every gap is a step of the scale, no text sits closer than --rst-sp-2
+// to a control, and every heading is closer to its own content than to
+// the block before it.
+
+// rhythmSkip is what the audit neither measures nor walks into, each a
+// component whose insides are not the page's rhythm:
+// - the page's body, the editor's document: its own typographic
+// rhythm in em (prose.css), held by gates L1 to L5;
+// - rst-form, Fiesta's form, whose rhythm (and the extra air above its
+// closing row) is Fiesta's to set and its own gates' to check;
+// - the Links panel, fixed over the page and not in its flow (below
+// 64rem its lists are the page's foot, which is audited).
+var rhythmSkip = []string{"[mapa-body]", "aside[mapa-links]"}
+
+func TestEveryScreenKeepsTheRhythm(t *testing.T) {
+ rig, store := browserRig(t, 0)
+ page, err := store.CreateTeamPage(context.Background(), Bo, "Short",
+ "One line, linking [[Acme]].")
+ if err != nil {
+ t.Fatal(err)
+ }
+ path := mapa.PagePath(page)
+ screens := []string{"/", "/d/2026-11-10", "/d/2026-11-10/edit", path,
+ path + "/edit", path + "/history", path + "/rename",
+ path + "/delete", path + "/look", path + "/links",
+ path + "/inside", "/new", "/new?title=Acme", "/pages", "/scratch",
+ "/scratch/new", "/search", "/search?q=line", "/search?q=nothing",
+ "/settings", "/deleted", "/help/markdown", "/help/open-source"}
+ for _, live := range []bool{false, true} {
+ for _, width := range []int64{1280, 390} {
+ for _, screen := range screens {
+ drive(t, rig, scripts(live), chromedp.EmulateViewport(width,
+ 800), chromedp.Navigate(rig.Origin+screen),
+ chromedp.WaitReady("[mapa-doc]"))
+ stage := screen + " at " + itoa(int(width)) + "px, scripts "
+ if live {
+ stage += "on"
+ } else {
+ stage += "off"
+ }
+ auditRhythm(t, rig, stage, rhythmSkip)
+ }
+ }
+ }
+}
+
+// auditRhythm runs Fiesta's audit over the page column and fails the
+// test on each finding, naming the stage. A read that lands while the
+// page's own refresh replaces it is tried again.
+func auditRhythm(t *testing.T, rig *harness.Rig, stage string,
+ skip []string) {
+ t.Helper()
+ expression := "JSON.stringify(" + rhythm.Expression("[mapa-doc]",
+ rhythm.Options{Skip: skip}) + ")"
+ var answer string
+ var err error
+ for try := 0; ; try++ {
+ ctx, cancel := context.WithTimeout(rig.Context(), 10*time.Second)
+ answer, err = chromedp.Run(ctx, chromedp.Evaluate[string](expression))
+ cancel()
+ if err == nil || try == 2 {
+ break
+ }
+ }
+ if err != nil {
+ t.Fatalf("%s: the rhythm audit did not run: %v", stage, err)
+ }
+ found := decodeFindings(t, stage, answer)
+ if len(found) > 0 {
+ t.Errorf("%s: %s", stage, rhythm.Report(found))
+ }
+}
+
+func decodeFindings(t *testing.T, stage, answer string) []rhythm.Finding {
+ t.Helper()
+ var found []rhythm.Finding
+ if err := json.Unmarshal([]byte(answer), &found); err != nil {
+ t.Fatalf("%s: the rhythm audit answered %q: %v", stage, answer, err)
+ }
+ return found
+}
diff --git a/internal/mapatest/testdata/rhythm/README b/internal/mapatest/testdata/rhythm/README
deleted file mode 100644
index bef7613..0000000
--- a/internal/mapatest/testdata/rhythm/README
+++ /dev/null
@@ -1,5 +0,0 @@
-rhythm.js is Fiesta's rhythm audit (rastrillo/fiesta, check/rhythm), copied
-ahead of its release from the branch feat/stack-rhythm. Its licence is
-Fiesta's, MPL-2.0. Test-only: it is not in the release build. When Fiesta
-releases check/rhythm, import amadan.net/rastrillo/fiesta/check/rhythm
-and delete this copy.
diff --git a/internal/mapatest/testdata/rhythm/rhythm.js b/internal/mapatest/testdata/rhythm/rhythm.js
deleted file mode 100644
index 2c0f228..0000000
--- a/internal/mapatest/testdata/rhythm/rhythm.js
+++ /dev/null
@@ -1,245 +0,0 @@
-// Fiesta's rhythm audit: the runtime half of the spacing rule
-// (DESIGN.md, "Spacing"). It walks a page's content as the browser laid
-// it out and reports three things a reader sees and a stylesheet check
-// cannot:
-//
-// off-scale two blocks, one under the other, whose gap is not a
-// step of the spacing scale (0, or --rst-sp-1 to 6);
-// touching text directly above or below a control (a button, a
-// field, a disclosure) with less than --rst-sp-2 between;
-// heading a heading further from its own content than it is from
-// what comes before it, so it reads as belonging to the
-// block above.
-//
-// It is one function expression, evaluated in the page: the Go package
-// beside it wraps it as rhythm.Expression for a chromedp drive, and
-// any other driver can evaluate the file and call it. It reads the
-// layout and changes nothing.
-//
-// It walks the content flow: the root, and every element in it that
-// holds blocks, except Fiesta's components (an element carrying an
-// rst- name other than the layout ones), whose insides are Fiesta's to
-// space and its own gates to check, text blocks (p, headings, lists,
-// tables, pre), controls, and whatever options.skip names.
-(function fiestaRhythm(root, options) {
- options = options || {};
- var tolerance = typeof options.tolerance === "number" ? options.tolerance : 1;
- var skip = options.skip || [];
- var start = typeof root === "string" ? document.querySelector(root) : root;
- if (!start) {
- return [{ kind: "missing", gap: 0, before: "", after: "", message: "no element matches " + root }];
- }
-
- var htmlStyle = getComputedStyle(document.documentElement);
- var rem = parseFloat(htmlStyle.fontSize) || 16;
- var defaults = [0.25, 0.5, 0.75, 1, 1.5, 2.5];
- var scale = [0];
- for (var step = 1; step <= 6; step++) {
- scale.push(length(htmlStyle.getPropertyValue("--rst-sp-" + step), defaults[step - 1] * rem));
- }
-
- // length reads a token's value: a rem, px or bare zero length.
- function length(value, fallback) {
- var m = /^\s*(-?[0-9.]+)(rem|px)?\s*$/.exec(value || "");
- if (!m) return fallback;
- var n = parseFloat(m[1]);
- return m[2] === "rem" ? n * rem : n;
- }
-
- var layoutNames = { "rst-page": 1, "rst-stack": 1, "rst-section": 1, "rst-form": 1, "rst-form-flow": 1 };
- var textTags = { P: 1, H1: 1, H2: 1, H3: 1, H4: 1, H5: 1, H6: 1, UL: 1, OL: 1, DL: 1, TABLE: 1, PRE: 1, BLOCKQUOTE: 1, FIGURE: 1, SVG: 1, IMG: 1, VIDEO: 1, CANVAS: 1, IFRAME: 1, svg: 1 };
- var headingTags = { H1: 1, H2: 1, H3: 1, H4: 1, H5: 1, H6: 1 };
-
- function skipped(el) {
- for (var i = 0; i < skip.length; i++) {
- if (el.matches(skip[i])) return true;
- }
- return false;
- }
-
- // rstNames is every rst- name an element carries, attribute or class.
- function rstNames(el) {
- var names = [];
- for (var i = 0; i < el.attributes.length; i++) {
- var name = el.attributes[i].name;
- if (name.indexOf("rst-") === 0) names.push(name);
- }
- el.classList.forEach(function (c) {
- if (c.indexOf("rst-") === 0) names.push(c.split("__")[0].split("--")[0]);
- });
- return names;
- }
-
- function isComponent(el) {
- var names = rstNames(el);
- for (var i = 0; i < names.length; i++) {
- if (!layoutNames[names[i]]) return true;
- }
- return false;
- }
-
- function isControl(el) {
- var tag = el.tagName;
- if (tag === "BUTTON" || tag === "SELECT" || tag === "TEXTAREA" || tag === "SUMMARY") return true;
- if (tag === "INPUT") return el.type !== "hidden";
- if (el.hasAttribute("rst-btn") || el.classList.contains("rst-btn")) return true;
- var role = el.getAttribute("role");
- return role === "button" || role === "switch" || role === "checkbox" || role === "radio" || role === "textbox" || role === "combobox";
- }
-
- function isHeading(el) {
- return !!headingTags[el.tagName] || el.getAttribute("role") === "heading";
- }
-
- function shown(el) {
- var style = getComputedStyle(el);
- if (style.display === "none" || style.visibility === "hidden") return false;
- if (style.position === "absolute" || style.position === "fixed" || style.float !== "none") return false;
- var box = el.getBoundingClientRect();
- return box.height > 0 && box.width > 0;
- }
-
- // flow is a container's block-level children in order, looking
- // through display: contents.
- function flow(container) {
- var out = [];
- for (var el = container.firstElementChild; el; el = el.nextElementSibling) {
- var style = getComputedStyle(el);
- if (style.display === "contents") {
- out.push.apply(out, flow(el));
- continue;
- }
- if (style.display.indexOf("inline") === 0 || el.tagName === "SCRIPT" || el.tagName === "TEMPLATE") continue;
- if (shown(el)) out.push(el);
- }
- return out;
- }
-
- // edge says whether an element begins (first) or ends (!first) with
- // text or with a control, looking through wrappers: "text",
- // "control" or "".
- function edge(el, first) {
- if (isControl(el)) return "control";
- var nodes = el.childNodes;
- for (var k = 0; k < nodes.length; k++) {
- var node = nodes[first ? k : nodes.length - 1 - k];
- if (node.nodeType === 3) {
- if (node.textContent.trim() !== "") return "text";
- continue;
- }
- if (node.nodeType !== 1) continue;
- var style = getComputedStyle(node);
- if (style.display === "none" || style.visibility === "hidden") continue;
- var found = edge(node, first);
- if (found) return found;
- }
- return "";
- }
-
- function describe(el) {
- var out = el.tagName.toLowerCase();
- if (el.id) out += "#" + el.id;
- for (var i = 0; i < el.attributes.length; i++) {
- var a = el.attributes[i].name;
- if (a !== "id" && a !== "class" && a !== "style" && a.indexOf("aria-") !== 0 && a.indexOf("-") > 0) {
- out += "[" + a + "]";
- break;
- }
- }
- var text = (el.textContent || "").replace(/\s+/g, " ").trim();
- if (text) out += " “" + (text.length > 40 ? text.slice(0, 39) + "…" : text) + "”";
- return out;
- }
-
- function onScale(gap) {
- for (var i = 0; i < scale.length; i++) {
- if (Math.abs(gap - scale[i]) <= tolerance) return true;
- }
- return false;
- }
-
- function round(n) {
- return Math.round(n * 10) / 10;
- }
-
- var findings = [];
- var gapBefore = new Map();
- var firstChildOf = new Map();
- var headings = [];
-
- function walk(container) {
- var kids = flow(container);
- if (kids.length) firstChildOf.set(kids[0], container);
- for (var i = 0; i < kids.length; i++) {
- var b = kids[i];
- if (isHeading(b)) headings.push(b);
- if (i > 0) measure(kids[i - 1], b);
- if (!skipped(b) && !isComponent(b) && !isControl(b) && !textTags[b.tagName]) walk(b);
- }
- }
-
- function measure(a, b) {
- var ra = a.getBoundingClientRect();
- var rb = b.getBoundingClientRect();
- var stacked = rb.top >= ra.bottom - tolerance && rb.left < ra.right && ra.left < rb.right;
- if (!stacked || skipped(a) || skipped(b)) return;
- var gap = rb.top - ra.bottom;
- gapBefore.set(b, { gap: gap, from: a });
- if (!onScale(gap)) {
- findings.push({
- kind: "off-scale", gap: round(gap), before: describe(a), after: describe(b),
- message: round(gap) + "px between blocks is not a step of the spacing scale"
- });
- }
- var touching = (edge(a, false) === "text" && edge(b, true) === "control") ||
- (edge(a, false) === "control" && edge(b, true) === "text");
- if (touching && gap < scale[2] - tolerance) {
- findings.push({
- kind: "touching", gap: round(gap), before: describe(a), after: describe(b),
- message: "text and a control are " + round(gap) + "px apart; they need --rst-sp-2 (" + round(scale[2]) + "px) or more"
- });
- }
- }
-
- // before is the gap that opens a heading: from its previous block,
- // or, for the first block of a container, the gap that opens the
- // container, and so on up to the root.
- function before(el) {
- for (var at = el; at && at !== start; at = firstChildOf.get(at)) {
- if (gapBefore.has(at)) return gapBefore.get(at).gap;
- if (!firstChildOf.has(at)) return undefined;
- }
- return undefined;
- }
-
- walk(start);
-
- // The space that opens a section is the gap before each heading of a
- // level; a heading with nothing before it on the page is held to the
- // smallest of those for its level.
- var opening = {};
- headings.forEach(function (h) {
- var gap = before(h);
- if (gap !== undefined) {
- opening[h.tagName] = Math.min(opening[h.tagName] === undefined ? Infinity : opening[h.tagName], gap);
- }
- });
- headings.forEach(function (h) {
- var next = null;
- gapBefore.forEach(function (v, k) {
- if (v.from === h) next = { el: k, gap: v.gap };
- });
- if (!next) return;
- var open = before(h);
- if (open === undefined) open = opening[h.tagName];
- if (open === undefined) return;
- if (next.gap >= open - tolerance) {
- findings.push({
- kind: "heading", gap: round(next.gap), before: describe(h), after: describe(next.el),
- message: "a heading is " + round(next.gap) + "px from its content and " + round(open) +
- "px from what comes before it; it should sit closer to its content"
- });
- }
- });
- return findings;
-})
diff --git a/internal/mapatest/title_test.go b/internal/mapatest/title_test.go
index e7da5f5..0e33b77 100644
--- a/internal/mapatest/title_test.go
+++ b/internal/mapatest/title_test.go
@@ -166,7 +166,8 @@ func TestOnlyATeamPagesTitleIsRenamableInPlace(t *testing.T) {
if !strings.Contains(page, `<h1 mapa-title mapa-rename="`+acme+
`/rename"><span mapa-title-text>Acme</span></h1>`) {
t.Fatalf("the team page's title is not renamable:\n%s",
- between(page, "<header mapa-page-head>", "</header>"))
+ between(page, "<header mapa-page-head rst-page-header>",
+ "</header>"))
}
rig.autosave(t, Ana, acme, revisionOf(t, rig, acme), "0", "Draft.")
for _, path := range []string{"/d/2026-11-12", "/", scratch,
diff --git a/internal/mapatest/week_strip_test.go b/internal/mapatest/week_strip_test.go
index df59bf9..eebc6db 100644
--- a/internal/mapatest/week_strip_test.go
+++ b/internal/mapatest/week_strip_test.go
@@ -70,7 +70,8 @@ func TestTheEmptyListsSaySoBriefly(t *testing.T) {
rig := newRig(t)
rig.post(t, Ana, "/d/2026-11-10", url.Values{"body": {"Written."}})
day := rig.getWith(Ana, "/d/2026-11-10")
- panel, foot := panelOf(day), between(day, `<footer mapa-foot-refs>`,
+ panel := panelOf(day)
+ foot := between(day, `<footer mapa-foot-refs rst-stack rst-section>`,
`</footer>`)
for _, where := range []struct{ name, html string }{
{"the panel", panel}, {"the page's foot", foot}} {