oficina / mapa Public

Mapa UI fixes: New team page in the top layer, rename from the title, whole rail tooltips

New team page is a native popover that the sidebar can no longer clip, with refusals in place. A team page's title renames in place, shares one pending state with the header, and carries open drafts to the new revision. The /new screen is a single title field. Fable APPROVED (315d8d7). Live at mapa.bds.oncarlos.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from ux/fixes-1 into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 60bb4d30a8c0f23d9563bafe48ede1a7e7be7082 parent 1e92f29
30 files changed, +1,785 −89
  • AGENTS.md +3 −1
  • docs/superpowers/specs/2026-11-14-mapa-level-up.md +23 −1
  • editor/page.mjs +16 −1
  • editor/saver.mjs +10 −0
  • editor/title.mjs +326 −0
  • editor/title.test.mjs +112 −0
  • internal/mapa/credits/assets.json +1 −1
  • internal/mapa/handlers_names.go +12 −1
  • internal/mapa/handlers_pages.go +39 −3
  • internal/mapa/handlers_title.go +52 −0
  • internal/mapa/private.go +1 −3
  • internal/mapa/static/{editor.1969c5f18c953d0a.js => editor.ac16df7e5105d46b.js} +32 −32
  • internal/mapa/static/frame.css +77 −21
  • internal/mapa/static/mapa.css +31 −0
  • internal/mapa/static/mapa.js +93 −0
  • internal/mapa/templates/frame.html +20 −9
  • internal/mapa/templates/page.html +1 −1
  • internal/mapa/templates/page_new.html +6 −2
  • internal/mapa/templates/partials.html +8 −3
  • internal/mapa/templates/shell.html +1 −0
  • internal/mapa/verbs.go +38 −4
  • internal/mapatest/browser_test.go +14 −4
  • internal/mapatest/gate1_test.go +8 −0
  • internal/mapatest/layout_browser_test.go +1 −1
  • internal/mapatest/newpage_browser_test.go +258 −0
  • internal/mapatest/pages_test.go +1 −1
  • internal/mapatest/share_json_test.go +27 −0
  • internal/mapatest/title_browser_test.go +254 −0
  • internal/mapatest/title_quality_browser_test.go +166 −0
  • internal/mapatest/title_test.go +154 −0

CI passed — run details

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

added 16 packages in 1s
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.ac16df7e5105d46b.js (311875 bytes, 97.2KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (71.428483ms)
ℹ 760 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (103.478535ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (166.476407ms)
ℹ 748 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (208.724171ms)
ℹ 755 inserts, 715 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (5489.673267ms)
ℹ 18240 edits over 760 bodies
✔ linear: trailing spaces (34.595288ms)
✔ linear: trailing whitespace (24.171524ms)
✔ linear: unclosed web links (17.46786ms)
✔ linear: web links with no address (24.598567ms)
✔ linear: unclosed wiki links (34.323293ms)
✔ linear: unclosed embeds (33.864252ms)
✔ linear: closes only (8.866251ms)
✔ golden file has bodies (1.072052ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (20.047753ms)
✔ markup.mjs strips and spans every block as Go does (38.032574ms)
✔ the schema's toDOM draws every body as Go renders it (72.63199ms)
✔ emphasis draws the four pinned outputs (20.162506ms)
✔ a body ends in the editor's empty paragraph (0.449415ms)
✔ a POST that never answers is aborted after the timeout (21.105217ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (1.198206ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (14.532377ms)
✔ an offered draft never commits by itself; Save commits it (1.44265ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.684542ms)
✔ closing carries text not yet sent, and the cap leaves it out (42.034157ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (3.975645ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (2.934952ms)
✔ typing mid-flight: the merge is not applied and the base does not move (1.117156ms)
✔ a merge the editor cannot represent stops after three tries (3.471028ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.151579ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.284646ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (0.98547ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (0.858104ms)
✔ noBase and gone lead to the existing choices (0.817349ms)
✔ a commit that merged is applied when nothing was typed since (1.15716ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (17.024145ms)
✔ an own draft committed meanwhile goes on as a new draft (2.244981ms)
✔ a reload keeps a stored draft; unsent text still commits (0.632725ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.338496ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (4.622728ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (1.36737ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (6.021346ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (2.338514ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.510899ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (2.167877ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (1.064077ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (1.245944ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.778877ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.771473ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (6.803309ms)
✔ marks close before code, links and atoms, and reopen after (0.490842ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (6.834367ms)
✔ empty blocks are written as nothing (2.484235ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.590995ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.33644ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (4.463862ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (2.312696ms)
✔ a trailing hard break stays on screen and is written as nothing (0.514155ms)
✔ the reparse waits while an IME is composing (0.67837ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (3.239959ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (1.355548ms)
✔ rebuild changes origins only, outside undo history (2.033778ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (2.058374ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (2.071368ms)
✔ a duplicate ^id typed above its holder never takes the id from it (4.873303ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.274738ms)
✔ a history command that throws is refused, never thrown (3.586943ms)
✔ one rename at a time, from either field (2.251733ms)
✔ an empty or unchanged title sends nothing (0.296892ms)
✔ a refusal keeps what was typed, and the title (0.289378ms)
✔ the pending state holds for the busy rule (5.401605ms)
✔ a failed POST says so and keeps the title (0.326346ms)
✔ Update links posts the confirm page's POST (0.355841ms)
✔ clean is CleanTitle's whitespace rule (0.116346ms)
✔ the saver's base follows a rename made over it, and only that (0.227432ms)
ℹ tests 74
ℹ suites 0
ℹ pass 74
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 6182.100452
=== 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	1.011s
?   	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	18.903s
?   	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
AGENTS.md

Loading diff…

docs/superpowers/specs/2026-11-14-mapa-level-up.md

Loading diff…

editor/page.mjs

Loading diff…

editor/saver.mjs

Loading diff…

editor/title.mjs

Loading diff…

editor/title.test.mjs

Loading diff…

internal/mapa/credits/assets.json

Loading diff…

internal/mapa/handlers_names.go

Loading diff…

internal/mapa/handlers_pages.go

Loading diff…

internal/mapa/handlers_title.go

Loading diff…

internal/mapa/private.go

Loading diff…

internal/mapa/static/{editor.1969c5f18c953d0a.js => editor.ac16df7e5105d46b.js}

Loading diff…

internal/mapa/static/frame.css

Loading diff…

internal/mapa/static/mapa.css

Loading diff…

internal/mapa/static/mapa.js

Loading diff…

internal/mapa/templates/frame.html

Loading diff…

internal/mapa/templates/page.html

Loading diff…

internal/mapa/templates/page_new.html

Loading diff…

internal/mapa/templates/partials.html

Loading diff…

internal/mapa/templates/shell.html

Loading diff…

internal/mapa/verbs.go

Loading diff…

internal/mapatest/browser_test.go

Loading diff…

internal/mapatest/gate1_test.go

Loading diff…

internal/mapatest/layout_browser_test.go

Loading diff…

internal/mapatest/newpage_browser_test.go

Loading diff…

internal/mapatest/pages_test.go

Loading diff…

internal/mapatest/share_json_test.go

Loading diff…

internal/mapatest/title_browser_test.go

Loading diff…

internal/mapatest/title_quality_browser_test.go

Loading diff…

internal/mapatest/title_test.go

Loading diff…