oficina / mapa Public

Smooth nav: prefetch a page or day when the pointer rests on its link

Every shell page names Mapa's speculation ruleset by header (no inline
script, so the CSP holds): prefetch, never prerender, links to /p/:page
and /d/:day, moderately eager. It replaces rastrillo's default, which
selects a sidebar Mapa does not draw. A prefetch is a GET and writes
nothing (TestAPrefetchWritesNothing). While the editor holds text that
leaving would commit, <html data-mapa-uncommitted> turns the rule off
and Chromium evicts what it fetched, so the next page shows the commit.
Build note 60; TestHoveringALinkPrefetchesThePage checks both halves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 0c991692d4cfc25bd896eca55889c28fe15543d8 parent 6f1f138
10 files changed, +230 −24
  • docs/superpowers/specs/2026-11-14-mapa-level-up.md +1 −0
  • editor/page.mjs +17 −2
  • internal/mapa/app.go +1 −0
  • internal/mapa/credits/assets.json +1 −1
  • internal/mapa/shell.go +1 −0
  • internal/mapa/speculation.go +42 −0
  • internal/mapa/speculation.json +1 −0
  • internal/mapa/static/{editor.778d4034d2ac17d8.js => editor.1fe02276881d1b28.js} +21 −21
  • internal/mapatest/prefetch_browser_test.go +77 −0
  • internal/mapatest/speculation_test.go +68 −0
docs/superpowers/specs/2026-11-14-mapa-level-up.md

Loading diff…

editor/page.mjs

Loading diff…

internal/mapa/app.go

Loading diff…

internal/mapa/credits/assets.json

Loading diff…

internal/mapa/shell.go

Loading diff…

internal/mapa/speculation.go

Loading diff…

internal/mapa/speculation.json

Loading diff…

internal/mapa/static/{editor.778d4034d2ac17d8.js => editor.1fe02276881d1b28.js}

Loading diff…

internal/mapatest/prefetch_browser_test.go

Loading diff…

internal/mapatest/speculation_test.go

Loading diff…