Mapa: dates, times and numbers in the reader's locale
Paul's rule is to localise from day one. Every date, time and count Mapa shows is now written in the reader's locale: their own choice in Settings, else what the browser asks for, else the team's (MAPA_LOCALE, en-IE). The images' screens, merged from main, go through it too. Stored Markdown, URLs and payloads stay ISO. Level-up build note 85. Fable approved; Luna's copy pass applied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from feat/locale into main.
AGENTS.md+16 −0Makefile+12 −2cmd/mapa/main.go+1 −1copy-review/locale/result.json+143 −0copy-review/locale/strings.json+122 −0docs/superpowers/specs/2026-11-14-mapa-level-up.md+14 −1editor/datepicker.mjs+11 −11editor/datepicker.test.mjs+24 −0editor/dates.mjs+100 −0editor/dates.test.mjs+73 −0editor/gen-dates.mjs+177 −0editor/page.mjs+3 −0editor/parity.test.mjs+37 −0editor/resolutions.mjs+8 −17editor/typeddate.mjs+41 −6editor/typeddate.test.mjs+20 −4internal/mapa/app.go+13 −0internal/mapa/around.go+7 −5internal/mapa/auth_navigation.go+1 −1internal/mapa/calendar.go+17 −14internal/mapa/calendar_test.go+18 −5internal/mapa/colophon.go+1 −1internal/mapa/config.go+18 −0internal/mapa/config_test.go+25 −5internal/mapa/credits/assets.json+1 −1internal/mapa/diff_test.go+1 −1internal/mapa/door.go+3 −3internal/mapa/frame.go+1 −1internal/mapa/funcs.go+21 −62internal/mapa/graph.go+12 −3internal/mapa/handlers_history.go+6 −5internal/mapa/handlers_images.go+13 −7internal/mapa/handlers_images_form.go+1 −1internal/mapa/handlers_names.go+2 −2internal/mapa/handlers_pages.go+8 −4internal/mapa/handlers_search.go+5 −1internal/mapa/handlers_title.go+1 −2internal/mapa/history_view.go+15 −12internal/mapa/images.go+16 −9internal/mapa/images_list.go+9 −4internal/mapa/island.go+6 −0internal/mapa/locale/dates.json+2,176 −0internal/mapa/locale/format.go+200 −0internal/mapa/locale/locale.go+195 −0internal/mapa/locale/locale_test.go+185 −0internal/mapa/locale/testdata/date_labels.json+2,162 −0internal/mapa/locales.go+115 −0internal/mapa/locales_test.go+62 −0internal/mapa/mapview.go+3 −2internal/mapa/markup/chips.go+0 −14internal/mapa/markup/golden_locales_test.go+89 −0internal/mapa/markup/golden_test.go+17 −12internal/mapa/markup/testdata/corpus/edge.json+24 −0internal/mapa/markup/testdata/editor.json+7 −1internal/mapa/markup/testdata/golden.json+9 −3internal/mapa/markup/testdata/golden_locales.json+38 −0internal/mapa/members.go+13 −0internal/mapa/members_locale.go+70 −0internal/mapa/mentions.go+2 −1internal/mapa/migrations/0006_alter_members.sql+1 −0internal/mapa/migrations/schema.sql+1 −1internal/mapa/models.go+7 −0internal/mapa/private.go+1 −0internal/mapa/rank.go+4 −2internal/mapa/recent.go+1 −1internal/mapa/render.go+43 −8internal/mapa/seal/seal.go+2 −0internal/mapa/search.go+5 −3internal/mapa/search_groups_test.go+1 −1internal/mapa/settings.go+10 −2internal/mapa/settings_locale.go+85 −0internal/mapa/shell.go+1 −1internal/mapa/static/{editor.4b68391a7ef1b95e.js => editor.230eae88eb1bf4a3.js}+30 −30internal/mapa/static/mapa.js+11 −4internal/mapa/templates/deleted.html+1 −1internal/mapa/templates/frame.html+6 −5internal/mapa/templates/history.html+1 −1internal/mapa/templates/pages.html+1 −1internal/mapa/templates/partials.html+2 −2internal/mapa/templates/scratch.html+1 −1internal/mapa/templates/settings.html+4 −0internal/mapa/testdata/typed_dates.json+339 −1internal/mapa/today.go+13 −18internal/mapa/typeddate.go+96 −16internal/mapa/typeddate_test.go+43 −12internal/mapa/versions.go+14 −16internal/mapa/views.go+17 −12internal/mapatest/browser_test.go+33 −3internal/mapatest/daily_test.go+1 −1internal/mapatest/datepicker_browser_test.go+1 −1internal/mapatest/editor_typing_browser_test.go+3 −3internal/mapatest/gate8_test.go+2 −0internal/mapatest/history_panel_test.go+1 −1internal/mapatest/locale_browser_test.go+133 −0internal/mapatest/locale_settings_test.go+138 −0internal/mapatest/locale_sweep_test.go+194 −0internal/mapatest/locale_test.go+292 −0internal/mapatest/pagelink_browser_test.go+1 −1internal/mapatest/palette_test.go+1 −1internal/mapatest/plaintext_test.go+1 −0
CI passed — run details
CI log
=== editor ===
cd editor && npm ci --no-audit --no-fund --loglevel=error
added 16 packages in 318ms
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.230eae88eb1bf4a3.js (348754 bytes, 109.5KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ days and weeks move across months and years (1.231905ms)
✔ a month keeps the day, or takes the month's last (0.228965ms)
✔ the grid is six weeks from Monday, as the month calendar draws it (0.678499ms)
✔ the grid starts the week where the locale does (1.368839ms)
✔ the keys move a day, a week, a month and a year (0.254132ms)
✔ the picked day is the chip [[ makes for a date (14.741379ms)
✔ Insert → Today's date still puts today in at once (1.308517ms)
✔ / offers Date, the picker, and Today's date beside it (0.222433ms)
✔ after a ! the chip goes in after a space, never as an embed (2.237872ms)
✔ where the Markdown would read the chip differently, it is refused (1.551208ms)
✔ over a selection the chip goes after it and the words stay (1.362278ms)
✔ today is the day in the viewer's zone (16.395938ms)
✔ every offered locale has cases (1.082939ms)
✔ dates.mjs writes every date Go writes, byte for byte (4.595967ms)
✔ a chip, the month and the week, in three locales (0.602958ms)
✔ dates.json is what ICU gives, byte for byte (454.269006ms)
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (65.814944ms)
ℹ 794 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (57.992772ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (104.120219ms)
ℹ 782 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (109.167304ms)
ℹ 789 inserts, 747 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (3345.368389ms)
ℹ 19056 edits over 794 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (928.766675ms)
ℹ 4217 links over 794 bodies; refused: {"A page link can’t hold another link or a line break. Select plain words.":744,"A page link can’t show [ or ]]. Select words without them.":381,"Select some words to link them to a page.":169,"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.":17}
✔ L3: a picked date is one more date chip, or refused where a letter would be too (954.406113ms)
ℹ over 794 bodies: {"inserted":4727,"spaced":18,"refused":19,"unstable":9}
✔ linear: trailing spaces (44.977174ms)
✔ linear: trailing whitespace (18.173847ms)
✔ linear: unclosed web links (17.090277ms)
✔ linear: web links with no address (24.586926ms)
✔ linear: unclosed wiki links (20.727585ms)
✔ linear: unclosed embeds (16.457243ms)
✔ linear: closes only (7.240633ms)
✔ the selected words become the chip's shown text (10.534035ms)
✔ words that are the title make a plain [[Title]] (4.35018ms)
✔ spaces at the selection's edges stay outside the chip (1.64415ms)
✔ a date makes a date link, in a heading, an item and a quote (6.457369ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (0.983745ms)
✔ only the linked block's bytes change, and undo gives the body back (2.320816ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (1.154943ms)
✔ a target the words cannot be linked to as typed is refused (0.183821ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (1.899534ms)
✔ web-linked words are refused: the address would be lost (review M4) (0.765992ms)
✔ words whose Markdown would read otherwise are refused (review M3) (1.438288ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (0.297101ms)
✔ linkCheck says why it refuses (review low 2) (0.561692ms)
✔ golden file has bodies (0.858472ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (24.60532ms)
✔ markup.mjs strips and spans every block as Go does (30.547303ms)
✔ the schema's toDOM draws every body as Go renders it (60.086005ms)
✔ emphasis draws the four pinned outputs (14.195918ms)
✔ a body ends in the editor's empty paragraph (0.304625ms)
✔ the editor labels date chips as Go does, in every locale L4 holds (7.9455ms)
✔ a POST that never answers is aborted after the timeout (21.666717ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (3.603036ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (9.453639ms)
✔ an offered draft never commits by itself; Save commits it (1.069344ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.466034ms)
✔ closing carries text not yet sent, and the cap leaves it out (26.332103ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (2.877329ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (2.219168ms)
✔ typing mid-flight: the merge is not applied and the base does not move (1.014462ms)
✔ a merge the editor cannot represent stops after three tries (3.63371ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.294271ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.571837ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (1.876973ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (0.873671ms)
✔ noBase and gone lead to the existing choices (0.839056ms)
✔ a commit that merged is applied when nothing was typed since (0.95936ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (5.887363ms)
✔ an own draft committed meanwhile goes on as a new draft (1.040781ms)
✔ a reload keeps a stored draft; unsent text still commits (0.362903ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (0.759729ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (2.093885ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (0.95902ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (3.691719ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (1.16947ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.327928ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (0.892456ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.433233ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (0.649184ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.564007ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.515627ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (6.548078ms)
✔ marks close before code, links and atoms, and reopen after (0.502132ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (7.591926ms)
✔ empty blocks are written as nothing (3.272692ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.797534ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.521358ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (4.780048ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (2.52243ms)
✔ a trailing hard break stays on screen and is written as nothing (1.490055ms)
✔ the reparse waits while an IME is composing (1.092867ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (4.323019ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.911411ms)
✔ rebuild changes origins only, outside undo history (1.540088ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (1.349895ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (1.756549ms)
✔ a duplicate ^id typed above its holder never takes the id from it (1.66521ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.09965ms)
✔ a history command that throws is refused, never thrown (4.476795ms)
✔ an image re-emits its source, and an edited alt changes only its span (1.121271ms)
✔ a paste whose image copy is refused says why and pastes nothing (13.391774ms)
✔ one rename at a time, from either field (2.04351ms)
✔ an empty or unchanged title sends nothing (0.213175ms)
✔ a refusal keeps what was typed, and the title (0.243702ms)
✔ the pending state holds for the busy rule (9.558104ms)
✔ a failed POST says so and keeps the title (0.889029ms)
✔ Update links posts the confirm page's POST (0.246457ms)
✔ clean is CleanTitle's whitespace rule (0.33939ms)
✔ the saver's base follows a rename made over it, and only that (0.324732ms)
✔ closing sends the rename as one keepalive POST (2.909128ms)
✔ the port answers every shared case as typeddate.go does (4.239726ms)
✔ numbers follow the locale: 12/11 is November in en-IE, December in en-US (0.166318ms)
✔ M6: several files land in the order they were chosen (43.798338ms)
✔ M5: one Backspace before the box keeps the image where the box is (12.115367ms)
✔ M5: undoing text typed just before the box keeps the upload (10.53786ms)
✔ L12: a failed upload an undo takes away does not stall the next (14.561174ms)
✔ M4: Replace… keeps the old image until the new one is in, and its alt (12.261038ms)
✔ M3 and N1: text wins, except over a picture copied from a page (1.852488ms)
✔ N2: a JPEG over 10 MB is scaled before its size is checked (6.096009ms)
✔ a drag whose anchor the document no longer reaches selects to its end (6.266597ms)
ℹ tests 119
ℹ suites 0
ℹ pass 119
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 5698.744948
=== 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.151s
? amadan.net/oficina/mapa/internal/mapa/icons [no test files]
ok amadan.net/oficina/mapa/internal/mapa/imagefile (cached)
ok amadan.net/oficina/mapa/internal/mapa/locale 0.006s
ok amadan.net/oficina/mapa/internal/mapa/markup 0.094s
ok amadan.net/oficina/mapa/internal/mapa/seal 0.003s
ok amadan.net/oficina/mapa/internal/mapatest 13.214s
? 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.mdLoading diff…
MakefileLoading diff…
cmd/mapa/main.goLoading diff…
copy-review/locale/result.jsonLoading diff…
copy-review/locale/strings.jsonLoading diff…
docs/superpowers/specs/2026-11-14-mapa-level-up.mdLoading diff…
editor/datepicker.mjsLoading diff…
editor/datepicker.test.mjsLoading diff…
editor/dates.mjsLoading diff…
editor/dates.test.mjsLoading diff…
editor/gen-dates.mjsLoading diff…
editor/page.mjsLoading diff…
editor/parity.test.mjsLoading diff…
editor/resolutions.mjsLoading diff…
editor/typeddate.mjsLoading diff…
editor/typeddate.test.mjsLoading diff…
internal/mapa/app.goLoading diff…
internal/mapa/around.goLoading diff…
internal/mapa/auth_navigation.goLoading diff…
internal/mapa/calendar.goLoading diff…
internal/mapa/calendar_test.goLoading diff…
internal/mapa/colophon.goLoading diff…
internal/mapa/config.goLoading diff…
internal/mapa/config_test.goLoading diff…
internal/mapa/credits/assets.jsonLoading diff…
internal/mapa/diff_test.goLoading diff…
internal/mapa/door.goLoading diff…
internal/mapa/frame.goLoading diff…
internal/mapa/funcs.goLoading diff…
internal/mapa/graph.goLoading diff…
internal/mapa/handlers_history.goLoading diff…
internal/mapa/handlers_images.goLoading diff…
internal/mapa/handlers_images_form.goLoading diff…
internal/mapa/handlers_names.goLoading diff…
internal/mapa/handlers_pages.goLoading diff…
internal/mapa/handlers_search.goLoading diff…
internal/mapa/handlers_title.goLoading diff…
internal/mapa/history_view.goLoading diff…
internal/mapa/images.goLoading diff…
internal/mapa/images_list.goLoading diff…
internal/mapa/island.goLoading diff…
internal/mapa/locale/dates.jsonLoading diff…
internal/mapa/locale/format.goLoading diff…
internal/mapa/locale/locale.goLoading diff…
internal/mapa/locale/locale_test.goLoading diff…
internal/mapa/locale/testdata/date_labels.jsonLoading diff…
internal/mapa/locales.goLoading diff…
internal/mapa/locales_test.goLoading diff…
internal/mapa/mapview.goLoading diff…
internal/mapa/markup/chips.goLoading diff…
internal/mapa/markup/golden_locales_test.goLoading diff…
internal/mapa/markup/golden_test.goLoading diff…
internal/mapa/markup/testdata/corpus/edge.jsonLoading diff…
internal/mapa/markup/testdata/editor.jsonLoading diff…
internal/mapa/markup/testdata/golden.jsonLoading diff…
internal/mapa/markup/testdata/golden_locales.jsonLoading diff…
internal/mapa/members.goLoading diff…
internal/mapa/members_locale.goLoading diff…
internal/mapa/mentions.goLoading diff…
internal/mapa/migrations/0006_alter_members.sqlLoading diff…
internal/mapa/migrations/schema.sqlLoading diff…
internal/mapa/models.goLoading diff…
internal/mapa/private.goLoading diff…
internal/mapa/rank.goLoading diff…
internal/mapa/recent.goLoading diff…
internal/mapa/render.goLoading diff…
internal/mapa/seal/seal.goLoading diff…
internal/mapa/search.goLoading diff…
internal/mapa/search_groups_test.goLoading diff…
internal/mapa/settings.goLoading diff…
internal/mapa/settings_locale.goLoading diff…
internal/mapa/shell.goLoading diff…
internal/mapa/static/{editor.4b68391a7ef1b95e.js => editor.230eae88eb1bf4a3.js}Loading diff…
internal/mapa/static/mapa.jsLoading diff…
internal/mapa/templates/deleted.htmlLoading diff…
internal/mapa/templates/frame.htmlLoading diff…
internal/mapa/templates/history.htmlLoading diff…
internal/mapa/templates/pages.htmlLoading diff…
internal/mapa/templates/partials.htmlLoading diff…
internal/mapa/templates/scratch.htmlLoading diff…
internal/mapa/templates/settings.htmlLoading diff…
internal/mapa/testdata/typed_dates.jsonLoading diff…
internal/mapa/today.goLoading diff…
internal/mapa/typeddate.goLoading diff…
internal/mapa/typeddate_test.goLoading diff…
internal/mapa/versions.goLoading diff…
internal/mapa/views.goLoading diff…
internal/mapatest/browser_test.goLoading diff…
internal/mapatest/daily_test.goLoading diff…
internal/mapatest/datepicker_browser_test.goLoading diff…
internal/mapatest/editor_typing_browser_test.goLoading diff…
internal/mapatest/gate8_test.goLoading diff…
internal/mapatest/history_panel_test.goLoading diff…
internal/mapatest/locale_browser_test.goLoading diff…
internal/mapatest/locale_settings_test.goLoading diff…
internal/mapatest/locale_sweep_test.goLoading diff…
internal/mapatest/locale_test.goLoading diff…
internal/mapatest/pagelink_browser_test.goLoading diff…
internal/mapatest/palette_test.goLoading diff…
internal/mapatest/plaintext_test.goLoading diff…