| index 46ef2c6..b25c495 100644 |
| --- a/docs/superpowers/specs/2026-11-14-mapa-level-up.md |
| +++ b/docs/superpowers/specs/2026-11-14-mapa-level-up.md |
| @@ -1049,7 +1049,7 @@ Phase 1's choices where this spec was silent, or where the build chose different |
| 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 sealed in `members.sealed_pins` (migration 0003): at most 12 page ids, newest first. The plaintext is always 12 eight-byte slots, empty ones zero (review L11), so the ciphertext's length does not say how many pages anyone pinned. 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. |
| +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. *Amended by note 77:* with script, the in-page notice; without it, still this confirm page. |
| 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. |
| @@ -1141,6 +1141,16 @@ Phase 1's choices where this spec was silent, or where the build chose different |
| 74. **A page deleted before the tab stored any draft on it** (M-B; corrects note 58). `mayDraft` refuses it (404): the person has no draft for the store to keep. The saver takes a 404 from the drafts route as that state: it sends nothing more there, the status says "Not saved", and the bar offers Save as a scratch page, which posts the text to the existing `POST /scratch`. Leaving inside Mapa shows the offer again beside Leave anyway; a close makes the scratch page with one keepalive `POST /scratch`, so what was typed is never only in a closed tab. |
| 75. **A bar's action does not go on a failed flush; a hung POST times out** (L2, L3). Save as a scratch page and Discard are not sent when the flush before them failed, and the bar says so; Show the saved version offers Leave anyway instead of going. `post.mjs` aborts a request after 10 seconds (never a keepalive one), and the saver retries. An aborted request may have landed; every draft write is version-checked, so the retry meets a 409 whose body is the text that request sent, and the saver takes that as its own: its version, and the typing since autosaved, never replaced. |
| 76. **The first scratch commit's tokens are held per person** (L4; amends notes 31 and 66): at most 256 each, refused past that, so one person's tabs never use up anyone else's. |
| +77. **The in-page title renames, as §4.1 asked** (Paul: "Why can't I click a title to edit it?"; amends note 13). |
| + - **The field.** On a team page the editor mounts on (`/p/{id}`, not History, not `?saved=1`, not the Markdown editor), the server marks the H1 `mapa-rename` and wraps its text in `<span mapa-title-text>`; without script that is the plain heading it was. `editor/title.mjs` makes the span `contenteditable`, `role="textbox"`, named "Title, renames the page". The heading keeps the title as its own name, read from the textbox's value, so heading navigation is unchanged. An input styled as the H1 was not chosen: a title wraps and an input does not, so a long title would shift the page, and a click on its second line could not place the caret. It is `contenteditable="true"`, not `plaintext-only`, which Chromium forces to `pre-wrap` (a line's end space kept and measured, so a wrapped title's box changed at mount); breaks and formatting are refused on `beforeinput`, and paste inserts text only, one line. CSS gives the span the heading's own `white-space`, `overflow-wrap` and `line-break`, so nothing moves when it becomes editable; the focus ring is an outline on the H1. |
| + - **Keys.** Click, tap or Tab to it; Enter, ⌘S or blur renames; Esc puts the title back and writes nothing; an empty or unchanged title sends nothing (blur restores the title). Enter is never acted on while composing (`isComposing`, keyCode 229). A refused title left by blur is not sent again until it changes. |
| + - **One pending state.** The header's title field, on that page, goes through the same `Renamer`: its submit is taken over (the busy shim leaves a cancelled submit alone). While one rename is out, both show the title on its way, the header field is read-only, the H1 refuses typing, and a second rename is not sent. The state holds at least 650ms (the busy rule), with estilo's spinner and "Renaming…" in the note under the H1, and on the header's Rename button when it sent. |
| + - **The POST.** `POST /p/{id}/rename` answers JSON when asked, as Make team page and Resolve do: `{title, href, from, to, links, count, aliases}`, where `from` and `to` are the revisions the rename was made over and minted (`"0"` both for an unchanged title) and `links`/`count` the confirm page's own scoped count (`AliasLinkers`, gate 1 compares it). A refusal (empty, too long, link syntax, date-shaped, taken by a title or an alias) is 422 `{error, taken}`, the form's sentence and the page holding the title. `POST /p/{id}/links` answers `{changed, notice}`. Without script both redirect as before. |
| + - **When it lands,** with no reload: the H1, the header field (value, `defaultValue` for estilo's Esc, refitted), `document.title`, the sidebar's entry, the kicker's "Also called", the editor's name ("Page text, …") and the Links panel and foot (refetched, as after a commit). The kicker's "Edited by" is not redrawn until the next load. |
| + - **Update links in the page.** With links to update, the note under the H1 says "Renamed. N pages you can edit link here by an old title." with Update links (the existing POST, held by the busy rule) and Not now; with none, "Renamed. The old title still leads here." Without script, rename still lands on the confirm page (note 13). |
| + - **Refusals** are said in the note, `role="alert"`, with "Open the page with that title" when one holds it. The field it was typed in keeps the text (`aria-invalid`); the other shows the page's title. |
| + - **The draft follows the rename.** A rename mints a revision holding exactly the body of the one before (base §3.2), so the store moves every draft on the page based on that revision to the new one, in the rename's transaction (`carryDrafts`; only the base, never the text, the version or the time written). The tab's saver moves its own base the same way (`Saver.renamed`). Before, a draft open across a rename committed as `Merged`, "merged with a teammate's changes", against a revision that changed only the title, and the editor rebased for it. |
| + - **Gates.** `internal/mapatest/title_test.go` (JSON answers, refusals, Update links, the draft carried, which pages are renamable); `title_browser_test.go` and `title_quality_browser_test.go` in `make browser` (click, type, Enter; Esc; a taken title; no double submit; not on daily, scratch or History; no shift at three widths and the caret where clicked; typing and draft kept with no rebase; axe in each state); `editor/title.test.mjs` (the shared state). Gate 1 compares the JSON answers. WebKit (Playwright 1.65.1, build 2388) by hand on the preview: no shift at 1440, 1000 and 390px, the caret where clicked, Esc, rename, refusal and the header all as in Chromium. IME composition was not driven by hand; it rests on the `isComposing` guard. |
| |
| |
| ## 14. Findings and what changed |