Phase 1: History no longer leaves room for the Links panel; spec status and build notes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Human
Prompt
Phase 1 of the Mapa level-up: finish, keep the gates green, record what departs from the spec.
From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.
Summary
While History is open the page column stops making room for the hidden Links panel. Spec §13 records Phase 1's 21 build notes (renderer and spike choices, the shell, Recently edited, pins, the rename confirm page, the phone sheet, the map, History and ⌘K choices, estilo's title fit in Chromium, the walk's race, the Colophon waiting for Phase 2), and the status line says Phase 1 is built for review.
2 files changed,
+40
−2
docs/superpowers/specs/2026-11-14-mapa-level-up.md+33 −2internal/mapa/static/history.css+7 −0
CI passed — run details
CI log
=== editor === cd editor && npm ci --no-audit --no-fund --loglevel=error added 16 packages in 346ms cd editor && node build-bundles.mjs wrote internal/mapa/static/editor.9c9edc5536b1d844.js (36245 bytes, 11.3KB gzipped; L12 budget 120KB) cd editor && node --test ✔ golden file has bodies (0.616601ms) ✔ markup.mjs parses every body into Go's blocks, byte offsets and all (10.585224ms) ✔ markup.mjs strips and spans every block as Go does (15.858248ms) ✔ the schema's toDOM draws every body as Go renders it (35.897921ms) ✔ emphasis draws the four pinned outputs (11.55066ms) ✔ a body ends in the editor's empty paragraph (0.227161ms) ℹ tests 6 ℹ suites 0 ℹ pass 6 ℹ fail 0 ℹ cancelled 0 ℹ skipped 0 ℹ todo 0 ℹ duration_ms 141.118323 === 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. === test === CGO_ENABLED=0 go test ./... ? amadan.net/oficina/mapa/cmd/mapa [no test files] ok amadan.net/oficina/mapa/internal/mapa 0.416s ? amadan.net/oficina/mapa/internal/mapa/icons [no test files] ok amadan.net/oficina/mapa/internal/mapa/markup (cached) ok amadan.net/oficina/mapa/internal/mapa/seal (cached) ok amadan.net/oficina/mapa/internal/mapatest 8.531s ? 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
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 cd0c334..09c5f57 100644 |
| --- a/docs/superpowers/specs/2026-11-14-mapa-level-up.md |
| +++ b/docs/superpowers/specs/2026-11-14-mapa-level-up.md |
| @@ -1,6 +1,6 @@ |
| # Mapa level-up: Contexto with Página's rail, and a page you write on |
| -**Status:** revision 3, 2026-11-14. Nothing is built. |
| +**Status:** revision 3, 2026-11-14. APPROVED (Fable approved revision 2 on N1–N5; revision 3 applies them). **Phase 1 is built** on `design/level-up`, for review: not merged, not deployed. §13 records its choices. Phase 2 has not started. |
| - **Round 1.** Claude Fable 5.2 reviewed revision 1 (`4027e10`) and found CHANGES REQUIRED: 4 high, 10 medium and 11 low findings. Revision 2 (`ad06a4e`) answered them. |
| - **Round 2.** Fable **approved revision 2 on condition** that N1–N5 and its lows go in. This revision makes those changes. |
| - §14 maps every finding from both rounds to what changed. |
| @@ -1035,7 +1035,38 @@ Each phase ends in review on its branch. Nothing is merged or deployed from here |
| ## 13. Build notes |
| -None yet. The build records its choices here, as base §15 does. |
| +Phase 1's choices where this spec was silent, or where the build chose differently. Each is the smallest reasonable choice. A reviewer who disagrees changes the code and this list together. |
| + |
| +1. **Step 0 came with the renderer.** The parity spike and §5's renderer changes landed together, because L4 is what says the HTML is final. 758 corpus bodies agree byte for byte across Go's `Render`, `markup.mjs` and `toDOM`. `make corpus-local DIR=…/oficina` checked 5,537 Markdown files from the Oficina repos in place, and all agree. The bundle is 11.3KB gzipped against L12's 120KB; no template loads it until Phase 2. |
| +2. **Emphasis is drawn the way the editor stores it.** Besides pinning `***x***`, Go now draws emphasis as marks turning on and off, so it nests as ProseMirror would. Every well-formed output in the corpus is unchanged. What changes are cases that came out mis-nested before: `*a **b***`, strong inside strong, and adjacent code spans or same-address links, which now merge. The golden file records every case. |
| +3. **The view's trailing break is drawn by the server.** ProseMirror adds `<br class="ProseMirror-trailingBreak">` to a textblock that is empty or ends in a chip, a hard break or a newline. The server does the same, so mounting adds nothing. |
| +4. **A list item may hold more than one nested list.** §6.3 says one, but a change of kind at a nested depth makes two. |
| +5. **Task boxes are an attribute**, `mapa-task="open|done"`, drawn by CSS, not an `<input>`. A `toDOM` content hole cannot sit beside an input. |
| +6. **`SafeURL` refuses bracketed IP hosts** (`http://[::1]/`), so the JavaScript port need not reimplement Go's IP parser. |
| +7. **Date chips carry the year when it is not this year**: "Wednesday 1 January 2025". |
| +8. **The chip markup** is `<a mapa-chip="team|pending|date|block|block gone" aria-label=…>`, with a glyph `<svg mapa-i aria-hidden>`. An alias adds `title="Now called …"`. A broken date is `<span mapa-chip="broken">` and an embed is `<span mapa-chip="embed" role="img">`. |
| +9. **The shell is estilo's bar plus Mapa's own sidebar,** not rastrillo's `rst-shell-sidebar`. Places are the bar's `Nav`, which estilo shows only in its Menu sheet below 800px; Mapa's CSS hides the bar's own copy from 800px. |
| +10. **The fold is two submit buttons,** one per state, and CSS shows the one that fits the screen. So it works with scripts off and with no cookie. `POST /view/sidebar` and `/view/links` set cookies, write no row and log no event; gate 8 drives them as view-only routes. Their `return` must be a local path. |
| +11. **Recently edited leaves out bulk edits by transaction:** any transaction whose events share one actor and one `at` and hold more than one `edited` (§3.2). It reads at most the person's last 200 qualifying events. |
| +12. **Pins** are a sealed JSON list of page ids in `members.sealed_pins` (migration 0003), at most 12, newest first. The event is `pins` on the member. |
| +13. **Rename still lands on the existing Update links confirm page** (`/p/{id}/links`), not an in-page notice. It was already a confirm page with the honest count, and gate 1 compares it as one. |
| +14. **The kicker's "Edited by"** reads the current revision's plaintext row, and names a teammate by their address's local part. History and presence do the same. |
| +15. **The Links panel's foot fallback stays on phones,** beside the sheet. The sheet is a script enhancement (`links.js`), not a modal `<dialog>`, so the lists are reachable with scripts off. |
| +16. **The map** is a 284×200 viewBox with the ring at 104×66, starting at −150°. Its labels are clamped inside the box. Edges between neighbours are drawn once per pair. |
| +17. **History** (§4.5): |
| + - The summary's verb is the first event row naming the revision, since delete and freed-alias rows name it too. |
| + - Restore's source is inferred: the newest earlier revision in the window with the same text. Otherwise the summary reads "Restored an earlier version". Restore stores no pointer. |
| + - The panel's foot appears once a version is chosen, and Restore is left off when that version is the current one. |
| + - Each run of unchanged blocks is drawn on its own, so a numbered list split by a change can restart at 1. Emphasis that spans a change shows its asterisks. |
| + - The panel is fetched as `?panel=1` (`Sec-Fetch-Dest: empty` only). Without script, `/p/{id}/history` is the page with the panel beside it. |
| +18. **⌘K** (§4.6): |
| + - `/search/suggest` answers `{query, date, pages, text, notes, create}`. Each group holds at most 5 in ⌘K and 50 on the search page, so title hits cannot push out the other groups. |
| + - Snippet marks are UTF-16 offsets, and the script builds `<mark>` from text nodes. |
| + - "next friday" is never today. Three-letter weekdays and "nov 12" are accepted too. |
| + - The date row comes first, and that day's note is not repeated in Your notes. |
| +19. **estilo's stacked title is measured short in Chromium:** the last letter or two of a long title is clipped. estilo's `chrome.js` sizes the field from a zero-width input's `scrollWidth`, which Chromium reports without the text's full width. WebKit, where it was measured, may be fine. This is estilo's to fix; Mapa does not override it. |
| +20. **The gate-7 walk had a race,** which the level-up's slower pages exposed: ⌘K could show the answer to "Acm" before "Acme". The walk now waits for the whole word's Create row, and so does the new palette test. |
| +21. **Help has no Colophon yet.** Paul's rule asks every app for one; it waits for Phase 2, when the bundle is loaded and its packages are what the page runs. |
| ## 14. Findings and what changed |
diff --git a/internal/mapa/static/history.css b/internal/mapa/static/history.css| index dd1fc09..0746565 100644 |
| --- a/internal/mapa/static/history.css |
| +++ b/internal/mapa/static/history.css |
| @@ -171,3 +171,10 @@ h1[mapa-title] del { |
| border: 1px solid var(--rst-line); |
| border-radius: 5px; |
| } |
| + |
| +/* 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-foot-refs] { display: grid; } |
| +} |