oficina / mapa Public

Pages inside: browser gates, mutations, Luna's wording, AGENTS.md and build notes P1-P6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 18963be87b6314a3573b292d4a95e7234edc2538 parent f5ed75b
12 files changed, +200 −6
  • AGENTS.md +7 −0
  • copy-review/inside/result.json +43 −0
  • copy-review/inside/strings.json +58 −0
  • docs/superpowers/specs/2026-11-22-mapa-columns-icons.md +9 −0
  • internal/mapa/pins.go +1 −1
  • internal/mapa/templates/frame.html +2 −2
  • internal/mapa/templates/import.html +1 −1
  • internal/mapa/templates/inside.html +1 −1
  • internal/mapatest/inside_browser_test.go +50 −0
  • internal/mapatest/inside_test.go +1 −1
  • scripts/mutate/inside.go +26 −0
  • scripts/mutate/main.go +1 −0

CI failed — run details

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

added 16 packages in 315ms
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.3c106a8d6eac2ca9.js (354648 bytes, 111.4KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ a badge is named for what it does, starting with its visible word (1.016149ms)
✔ first words stop at five words or forty characters (0.395461ms)
✔ the field keeps one trimmed line, without brackets (0.382678ms)
✔ the field holds at most MaxAlt bytes, cut at a character (1.444212ms)
✔ days and weeks move across months and years (1.332064ms)
✔ a month keeps the day, or takes the month's last (0.342033ms)
✔ the grid is six weeks from Monday, as the month calendar draws it (0.636447ms)
✔ the grid starts the week where the locale does (0.693102ms)
✔ the keys move a day, a week, a month and a year (0.301528ms)
✔ the picked day is the chip [[ makes for a date (15.916919ms)
✔ Insert → Today's date still puts today in at once (2.198096ms)
✔ / offers Date, the picker, and Today's date beside it (0.804909ms)
✔ after a ! the chip goes in after a space, never as an embed (3.126043ms)
✔ where the Markdown would read the chip differently, it is refused (3.255733ms)
✔ over a selection the chip goes after it and the words stay (2.802625ms)
✔ today is the day in the viewer's zone (19.47959ms)
✔ every offered locale has cases (1.108401ms)
✔ dates.mjs writes every date Go writes, byte for byte (4.98891ms)
✔ a chip, the month and the week, in three locales (0.612673ms)
✔ dates.json is what ICU gives, byte for byte (491.954695ms)
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (81.003716ms)
ℹ 871 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (96.533997ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (118.712299ms)
ℹ 858 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (127.557043ms)
ℹ 866 inserts, 817 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (4263.290226ms)
ℹ 20904 edits over 871 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (1110.650586ms)
ℹ 4532 links over 871 bodies; refused: {"A page link can’t hold another link or a line break. Select plain words.":918,"A page link can’t show [ or ]]. Select words without them.":404,"Select some words to link them to a page.":174,"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.":18}
✔ L3: a picked date is one more date chip, or refused where a letter would be too (1105.787173ms)
ℹ over 871 bodies: {"inserted":5158,"spaced":23,"refused":45,"unstable":9}
✔ linear: trailing spaces (30.809821ms)
✔ linear: trailing whitespace (27.725465ms)
✔ linear: unclosed web links (41.861347ms)
✔ linear: web links with no address (32.826803ms)
✔ linear: unclosed wiki links (28.65266ms)
✔ linear: unclosed embeds (19.367102ms)
✔ linear: closes only (8.663017ms)
✔ the selected words become the chip's shown text (13.560749ms)
✔ words that are the title make a plain [[Title]] (4.65889ms)
✔ spaces at the selection's edges stay outside the chip (1.774132ms)
✔ a date makes a date link, in a heading, an item and a quote (8.56721ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (1.487331ms)
✔ only the linked block's bytes change, and undo gives the body back (2.796553ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (1.544387ms)
✔ a target the words cannot be linked to as typed is refused (0.358614ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (3.065992ms)
✔ web-linked words are refused: the address would be lost (review M4) (2.047319ms)
✔ words whose Markdown would read otherwise are refused (review M3) (2.054162ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (0.417262ms)
✔ linkCheck says why it refuses (review low 2) (1.384592ms)
✔ golden file has bodies (0.909302ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (34.283058ms)
✔ markup.mjs strips and spans every block as Go does (84.664667ms)
✔ the schema's toDOM draws every body as Go renders it (64.536409ms)
✔ emphasis draws the four pinned outputs (15.026421ms)
✔ a body ends in the editor's empty paragraph (0.239112ms)
✔ the editor labels date chips as Go does, in every locale L4 holds (8.894685ms)
✔ a POST that never answers is aborted after the timeout (21.163685ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (1.187046ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (11.266606ms)
✔ an offered draft never commits by itself; Save commits it (1.487993ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (0.6811ms)
✔ closing carries text not yet sent, and the cap leaves it out (38.83108ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (4.504233ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (3.654281ms)
✔ typing mid-flight: the merge is not applied and the base does not move (1.800422ms)
✔ a merge the editor cannot represent stops after three tries (4.450856ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.33509ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.550929ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (0.934229ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (0.814757ms)
✔ noBase and gone lead to the existing choices (0.864009ms)
✔ a commit that merged is applied when nothing was typed since (1.091158ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (9.642569ms)
✔ an own draft committed meanwhile goes on as a new draft (2.055763ms)
✔ a reload keeps a stored draft; unsent text still commits (0.589641ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.107178ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (10.117599ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (1.697441ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (6.358613ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (2.721014ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.423223ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (1.028863ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.518399ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (0.784251ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.645394ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.624606ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (4.721897ms)
✔ marks close before code, links and atoms, and reopen after (0.415488ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (15.081281ms)
✔ empty blocks are written as nothing (6.040475ms)
✔ an unclosed fence that is no longer last gets its closing fence (3.923869ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (3.321015ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (4.319883ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (2.879137ms)
✔ a trailing hard break stays on screen and is written as nothing (1.380363ms)
✔ the reparse waits while an IME is composing (1.242188ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (5.296539ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.680149ms)
✔ rebuild changes origins only, outside undo history (2.209358ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (2.001273ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (4.706237ms)
✔ a duplicate ^id typed above its holder never takes the id from it (2.937044ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.66457ms)
✔ a history command that throws is refused, never thrown (7.825569ms)
✔ an image re-emits its source, and an edited alt changes only its span (1.247187ms)
✔ a paste whose image copy is refused says why and pastes nothing (22.372492ms)
✔ a line of image openers reads in linear time (111.866262ms)
✔ a line of shared link address reads in linear time (11.700599ms)
✔ a line of shared web address reads in linear time (47.102023ms)
✔ one rename at a time, from either field (1.948906ms)
✔ an empty or unchanged title sends nothing (0.183941ms)
✔ a refusal keeps what was typed, and the title (0.376537ms)
✔ the pending state holds for the busy rule (7.424626ms)
✔ a failed POST says so and keeps the title (0.862556ms)
✔ Update links posts the confirm page's POST (0.247558ms)
✔ clean is CleanTitle's whitespace rule (0.206422ms)
✔ the saver's base follows a rename made over it, and only that (0.277413ms)
✔ closing sends the rename as one keepalive POST (2.727496ms)
✔ the port answers every shared case as typeddate.go does (8.16195ms)
✔ numbers follow the locale: 12/11 is November in en-IE, December in en-US (0.286069ms)
✔ M6: several files land in the order they were chosen (42.326559ms)
✔ M5: one Backspace before the box keeps the image where the box is (11.548866ms)
✔ M5: undoing text typed just before the box keeps the upload (12.445555ms)
✔ L12: a failed upload an undo takes away does not stall the next (14.936716ms)
✔ M4: Replace… keeps the old image until the new one is in, and its alt (14.557282ms)
✔ M3 and N1: text wins, except over a picture copied from a page (1.320424ms)
✔ N2: a JPEG over 10 MB is scaled before its size is checked (5.326636ms)
✔ a drag whose anchor the document no longer reaches selects to its end (5.247738ms)
ℹ tests 126
ℹ suites 0
ℹ pass 126
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 7045.670045
=== 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.
internal/mapatest/inside_browser_test.go line 41: 87 columns wide, over the 80 allowed. Wrap the line, or add a record with a reason to .rastrillo/code.txt.
rastrillo: budget code: 1 problem
make: *** [Makefile:69: code] Error 1

amadan: step code failed: exit status 2

amadan: job failed at step code — its output is above, not at the tail of this log
diff --git a/AGENTS.md b/AGENTS.md
index cfafc35..90fc0df 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -154,6 +154,13 @@ Makefile, estilo's files served straight from the module).
uploads and Reposition). A record's references are its body's and
its look's images (`Record.images`); chips draw icons from their
resolution (`markup.ChipIcon`), never from a node attribute.
+ - Pages inside (the same spec, §5, §6.3, phase 3): `inside.go` (the
+ "In: [[P]]" relation, derived in the index's `within` map, and the
+ scoped `Inside`), `side_inside.go` (the Pinned rows' arrows, the
+ `mapa-open` cookie, `POST /view/open` and `GET /p/{id}/inside`),
+ `import_pins.go` (the import pins its roots once, marked in the
+ sealed coordinate). Pins hold up to 20 (`pins.go` still reads a
+ list sealed at 12).
- `internal/mapatest/` — the gates of spec §11, from the outside.
`browser_test.go` is behind the `browser` tag.
- `scripts/preview/`, `scripts/mutate/` — `make preview`, `make mutate`.
diff --git a/copy-review/inside/result.json b/copy-review/inside/result.json
new file mode 100644
index 0000000..b17c0fb
--- /dev/null
+++ b/copy-review/inside/result.json
@@ -0,0 +1,43 @@
+{
+ "action": "approve",
+ "guidance": null,
+ "note": "Reviewed 2026-11-22 by Luna (gpt-5.6-luna through Codex). Luna's edits are applied.",
+ "not_applied": [],
+ "strings": [
+ {
+ "id": "inside.arrow",
+ "text": "Pages inside %s",
+ "was": null
+ },
+ {
+ "id": "inside.all",
+ "text": "See all pages inside (%d)",
+ "was": "All %d pages inside"
+ },
+ {
+ "id": "inside.page.title",
+ "text": "Pages inside %s",
+ "was": null
+ },
+ {
+ "id": "inside.page.sub",
+ "text": "Each page starts with a line saying it is inside this page.",
+ "was": "Each one starts with a line that says it is inside this page."
+ },
+ {
+ "id": "pins.full",
+ "text": "You can pin up to 20 pages. Choose Unpin from sidebar first.",
+ "was": "You can pin up to 20 pages. Unpin one first."
+ },
+ {
+ "id": "import.pins.some",
+ "text": "Pinned %d of your %d top-level team pages to your sidebar. Your sidebar holds 20 pins.",
+ "was": "Pinned %d of your %d top-level pages. Your sidebar holds 20 pins."
+ },
+ {
+ "id": "import.pins.all",
+ "text": "Pinned your %d top-level team pages to your sidebar.",
+ "was": "Pinned your %d top-level pages to your sidebar."
+ }
+ ]
+}
\ No newline at end of file
diff --git a/copy-review/inside/strings.json b/copy-review/inside/strings.json
new file mode 100644
index 0000000..194693f
--- /dev/null
+++ b/copy-review/inside/strings.json
@@ -0,0 +1,58 @@
+[
+ {
+ "id": "inside.arrow",
+ "section": "Sidebar",
+ "label": "inside.arrow",
+ "text": "Pages inside %s",
+ "context": "Accessible name of the disclosure arrow on a pinned sidebar row, and of the list it opens. %s is the page's title. The pages listed are those whose first line is 'In: [[that page]]', which the Notion import writes for each child page.",
+ "notes": ""
+ },
+ {
+ "id": "inside.all",
+ "section": "Sidebar",
+ "label": "inside.all",
+ "text": "All %d pages inside",
+ "context": "A link at the end of an opened list that shows the first 50: it opens a page listing all of them. %d is a number in the reader's locale.",
+ "notes": ""
+ },
+ {
+ "id": "inside.page.title",
+ "section": "All pages inside",
+ "label": "inside.page.title",
+ "text": "Pages inside %s",
+ "context": "Heading of that page.",
+ "notes": ""
+ },
+ {
+ "id": "inside.page.sub",
+ "section": "All pages inside",
+ "label": "inside.page.sub",
+ "text": "Each one starts with a line that says it is inside this page.",
+ "context": "Subheading: explains how a page comes to be listed (its first line is 'In: [[this page]]').",
+ "notes": ""
+ },
+ {
+ "id": "pins.full",
+ "section": "Refusals",
+ "label": "pins.full",
+ "text": "You can pin up to 20 pages. Unpin one first.",
+ "context": "Shown when pinning a page past the limit (raised from 12).",
+ "notes": ""
+ },
+ {
+ "id": "import.pins.some",
+ "section": "Import report",
+ "label": "import.pins.some",
+ "text": "Pinned %d of your %d top-level pages. Your sidebar holds 20 pins.",
+ "context": "In the Notion import's report, after a run that pinned the workspace's top-level pages to the runner's sidebar but ran out of room. A list of the ones not pinned follows.",
+ "notes": ""
+ },
+ {
+ "id": "import.pins.all",
+ "section": "Import report",
+ "label": "import.pins.all",
+ "text": "Pinned your %d top-level pages to your sidebar.",
+ "context": "The same when every top-level page fitted.",
+ "notes": ""
+ }
+]
\ No newline at end of file
diff --git a/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md b/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
index 3d8cba2..c3b6b00 100644
--- a/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
+++ b/docs/superpowers/specs/2026-11-22-mapa-columns-icons.md
@@ -758,3 +758,12 @@ Fable found every round-1 finding answered in substance, and five mediums and si
- **B11, Fable on the build.** Round 1 (`2f10e0e`): CHANGES REQUIRED, no high, five mediums: ⌘K drew no icons; an icon post naming no picture stored an empty icon; Reposition recentred a banner at the top, and a position post choosing none moved it to the centre; dragging was broken with a mouse and stuck on touch; History drew a broken image for an old icon gone from Mapa. All five are fixed with gates (`7643c98`), with the lows that matter: the busy rule on the look's controls, Reposition a real button with Esc to cancel, a refused script upload dropped only when it is the person's own pending picture, the emoji field trimmed, the live region served by the page. Round 2 (`7643c98`): APPROVE, with one medium-to-low (Reposition armed only by a keyup), fixed in `3c5f177` by arming after 400 ms too. Left as they are, with Fable's agreement: the picker's ↑ ↓ across uneven group rows, and LOOK12's 200-icon timing, replaced by `TestSmallPicturesAreServedFromTheCache` and the cache's scope gate.
- **B12, the gates at landing.** `make ci` green; `make browser` green but for one known flake (a test's temporary directory still holding SQLite's WAL at cleanup, which passes on rerun); `make mutate`: all 141 mutations caught; hub CI green.
+### Phase 3: pages inside and the import's pins (`feat/pages-inside`)
+
+- **P1, the relation.** `inTarget` reads a team page's first block: exactly `In: ` then one wiki link, no anchor, not a date; its folded target goes in the index's `within` map. `Inside` answers a team page's children in its own order (first links in its body, then by folded title), through the scoped view; private pages are neither children nor parents.
+- **P2, the arrow.** Pinned rows keep a 16px arrow cell. An arrow is a form (`POST /view/open`, the cookie, back to a checked local path), so it works with no script. With script, `mapa.js` sends the form in the background and puts the toggled row and its list in place from the page the server draws next, so the rest of the sidebar keeps its listeners; `GET /side/inside/{id}` (§5.3) was not needed. Opened lists show 50 rows and a link to `GET /p/{id}/inside`; the sidebar draws at most 200 opened rows; indents stop at four levels; a page that is one of its row's ancestors is listed without an arrow. The open list is a plain `ul` labelled "Pages inside <title>": `role="group"` made axe refuse its items.
+- **P3, not built: Page → Put inside… and Take out of.** Typing or deleting the `In:` line, with script or in the textarea, does it; a picker for it is left for later.
+- **P4, pins.** The limit is 20 (Q4). A list sealed when it held 12 is read and is written as 20 on the next pin.
+- **P5, the import's pins.** After the fix-up pass and before `done`, one lease-checked `Store.write` pins the roots with no `pin` mark (live, surveyed with no imported parent, in survey order, after the runner's own pins, up to the free slots), marks each in its stored coordinate (read again inside the write, since the page's own transaction wrote it last), and logs one `pins` event by the runner. Nothing to offer writes nothing. The report counts the marks with the run's id.
+- **P6, gates.** IN1 and IN2 (`inside_test.go`), IN3, IN4, IN6 and IN7 (`mapatest/inside_test.go`), IN5 and IN8 (`inside_browser_test.go`, axe included), I23 (`import_pins_test.go`, the report too); gate 8 drives `POST /view/open`; two mutations (a private In: line counts; a root offered every run), both caught. Luna's wording applied (`copy-review/inside`).
+
diff --git a/internal/mapa/pins.go b/internal/mapa/pins.go
index 3cfca77..29bbb4e 100644
--- a/internal/mapa/pins.go
+++ b/internal/mapa/pins.go
@@ -27,7 +27,7 @@ const oldPinBytes = 12 * 8
// ErrTooManyPins is a pin past maxPins.
var ErrTooManyPins = errors.New("You can pin up to 20 pages. " +
- "Unpin one first.")
+ "Choose Unpin from sidebar first.")
// Pins is the viewer's pinned page ids, newest first. A page since
// deleted or out of scope is dropped where the list is read.
diff --git a/internal/mapa/templates/frame.html b/internal/mapa/templates/frame.html
index f16761a..bdf4bbd 100644
--- a/internal/mapa/templates/frame.html
+++ b/internal/mapa/templates/frame.html
@@ -166,9 +166,9 @@
</div>
</nav>{{end}}
{{define "mapa-side-place"}}{{icon .Icon}}<span mapa-side-label>{{.Label}}</span>{{if eq .Href "/search"}}<kbd mapa-kbd aria-hidden="true">⌘K</kbd>{{end}}{{end}}
-{{define "mapa-side-link"}}<div mapa-side-row{{if .Gutter}} mapa-side-gutter data-depth="{{.Depth}}"{{end}}>{{if .Gutter}}{{template "mapa-side-arrow" .}}{{end}}<a mapa-side-item mapa-side-page href="{{.Href}}"{{if .Current}} aria-current="page"{{end}}>{{pageIcon .Look .Icon}}<span mapa-side-label>{{.Label}}{{if .Private}}<span mapa-sr>, only you see this</span>{{end}}</span>{{if .Private}}<span mapa-side-lock aria-hidden="true">{{icon "lock"}}</span>{{end}}</a>{{template "mapa-row-menu" .}}</div>{{if .Open}}<ul mapa-side-inside role="group" id="{{.ListID}}" aria-label="Pages inside {{.Label}}">
+{{define "mapa-side-link"}}<div mapa-side-row{{if .Gutter}} mapa-side-gutter data-depth="{{.Depth}}"{{end}}>{{if .Gutter}}{{template "mapa-side-arrow" .}}{{end}}<a mapa-side-item mapa-side-page href="{{.Href}}"{{if .Current}} aria-current="page"{{end}}>{{pageIcon .Look .Icon}}<span mapa-side-label>{{.Label}}{{if .Private}}<span mapa-sr>, only you see this</span>{{end}}</span>{{if .Private}}<span mapa-side-lock aria-hidden="true">{{icon "lock"}}</span>{{end}}</a>{{template "mapa-row-menu" .}}</div>{{if .Open}}<ul mapa-side-inside id="{{.ListID}}" aria-label="Pages inside {{.Label}}">
{{- range .Inside}}<li>{{template "mapa-side-link" .}}</li>{{end}}
- {{- if .More}}<li><a mapa-side-all href="{{.Href}}/inside">All {{number L .All}} pages inside</a></li>{{end}}
+ {{- if .More}}<li><a mapa-side-all href="{{.Href}}/inside">See all pages inside ({{number L .All}})</a></li>{{end}}
</ul>{{end}}{{end}}
{{/* mapa-side-arrow: a Pinned row's disclosure (columns and icons spec
diff --git a/internal/mapa/templates/import.html b/internal/mapa/templates/import.html
index 5ecaf27..cd97f93 100644
--- a/internal/mapa/templates/import.html
+++ b/internal/mapa/templates/import.html
@@ -56,7 +56,7 @@
<h2 id="import-report">Report</h2>
{{range .ImageFailures}}{{if eq .Label "images aren't set up in Mapa yet"}}<p mapa-notice role="status"><strong>No images were imported: images aren't set up in Mapa yet.</strong> Each one is a line in its page. Run the import again once images are set up.</p>{{end}}{{if hasSuffix .Label "allowance is full"}}<p mapa-notice role="status"><strong>Images stopped: {{.Label}}.</strong> Raise that allowance, or free some, and run the import again: the pages waiting for images are filled in.</p>{{end}}{{end}}
{{with .Roots}}<p>Started from: {{range $i, $r := .}}{{if $i}}, {{end}}“{{$r}}”{{end}}.</p>{{end}}
-{{if or .Pinned .Unpinned}}<p mapa-import-pins>{{if .Unpinned}}Pinned {{number L .Pinned}} of your {{number L .Offered}} top-level pages. Your sidebar holds {{number L 20}} pins.{{else}}Pinned your {{number L .Pinned}} top-level pages to your sidebar.{{end}}</p>
+{{if or .Pinned .Unpinned}}<p mapa-import-pins>{{if .Unpinned}}Pinned {{number L .Pinned}} of your {{number L .Offered}} top-level team pages to your sidebar. Your sidebar holds {{number L 20}} pins.{{else}}Pinned your {{number L .Pinned}} top-level team pages to your sidebar.{{end}}</p>
{{with .Unpinned}}<ul mapa-list>{{range .}}<li>{{if .Href}}<a href="{{.Href}}">{{.Title}}</a>{{else}}{{.Title}}{{end}}</li>{{end}}</ul>{{end}}{{end}}
<dl rst-detail>
<dt>Pages seen</dt><dd>{{number L .Seen}}</dd>
diff --git a/internal/mapa/templates/inside.html b/internal/mapa/templates/inside.html
index a855f57..af8ec16 100644
--- a/internal/mapa/templates/inside.html
+++ b/internal/mapa/templates/inside.html
@@ -2,7 +2,7 @@
§5.3), the sidebar's "All pages inside" link. Data: Page, Rows. */}}
{{define "content"}}{{$page := .Data.Page}}
{{template "back-nav" dict "Href" $page.Href "Label" $page.Label}}
-{{template "page-header" dict "Title" (printf "Pages inside %s" $page.Label) "Sub" "Each one starts with a line that says it is inside this page."}}
+{{template "page-header" dict "Title" (printf "Pages inside %s" $page.Label) "Sub" "Each page starts with a line saying it is inside this page."}}
<ul mapa-list>
{{range .Data.Rows}}<li><a href="{{.Href}}" mapa-looked>{{pageIcon .Look "file-text"}}<span>{{.Label}}</span></a></li>
{{end}}</ul>
diff --git a/internal/mapatest/inside_browser_test.go b/internal/mapatest/inside_browser_test.go
new file mode 100644
index 0000000..5d08db0
--- /dev/null
+++ b/internal/mapatest/inside_browser_test.go
@@ -0,0 +1,50 @@
+//go:build browser
+
+package mapatest
+
+import (
+ "context"
+ "testing"
+
+ "github.com/chromedp/chromedp"
+ "github.com/chromedp/chromedp/kb"
+
+ "amadan.net/oficina/mapa/internal/mapa"
+)
+
+// IN5 and IN8 (columns and icons spec §5.3, §9) in a real Chromium: the
+// arrow opens the pages inside at once, with script, and keeps focus;
+// opened rows are on the first paint after; axe finds nothing serious.
+
+func TestIN8TheArrowByKeyboard(t *testing.T) {
+ rig, store := browserRig(t, 0)
+ ctx := context.Background()
+ projects, err := store.CreateTeamPage(ctx, Bo, "Projects", "See.")
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, title := range []string{"Alpha", "Beta"} {
+ if _, err := store.CreateTeamPage(ctx, Bo, title,
+ "In: [[Projects]]\n\nText."); err != nil {
+ t.Fatal(err)
+ }
+ }
+ titledPage(t, rig, store, "Desk", "Work.")
+ viewer, _ := store.Viewer(ctx, Ana, nil)
+ if err := store.SetPin(ctx, viewer, projects.ID, true); err != nil {
+ t.Fatal(err)
+ }
+ drive(t, rig, chromedp.Reload(), chromedp.WaitVisible(mounted),
+ chromedp.Focus(`[mapa-side-arrow][aria-label="Pages inside Projects"]`),
+ chromedp.KeyEvent(kb.Enter),
+ chromedp.WaitVisible(`ul[mapa-side-inside]`))
+ focused := evaluate(t, rig, `document.activeElement.getAttribute("aria-expanded")`)
+ if focused != "true" {
+ t.Fatalf("focus after opening: aria-expanded %q", focused)
+ }
+ if found := axeSerious(t, rig); found != "" {
+ t.Fatalf("axe, a row open:\n%s", found)
+ }
+ drive(t, rig, chromedp.Navigate(rig.Origin+mapa.PagePath(projects)),
+ chromedp.WaitVisible(`ul[mapa-side-inside] [mapa-side-label]`))
+}
diff --git a/internal/mapatest/inside_test.go b/internal/mapatest/inside_test.go
index e210fdc..c738b72 100644
--- a/internal/mapatest/inside_test.go
+++ b/internal/mapatest/inside_test.go
@@ -109,7 +109,7 @@ func TestIN7CyclesAndCaps(t *testing.T) {
}
page = opened(t, rig, big, strings.TrimPrefix(big, "/p/"))
if strings.Count(page, `mapa-side-label>Child x`) != 50 ||
- !strings.Contains(page, big+`/inside">All 51 pages inside`) {
+ !strings.Contains(page, big+`/inside">See all pages inside (51)`) {
t.Fatal("51 pages inside are not 50 rows and a link")
}
if all := rig.page(t, Bo, big+"/inside"); strings.Count(all,
diff --git a/scripts/mutate/inside.go b/scripts/mutate/inside.go
new file mode 100644
index 0000000..f27dae3
--- /dev/null
+++ b/scripts/mutate/inside.go
@@ -0,0 +1,26 @@
+package main
+
+// The columns and icons spec's mutations for pages inside and the
+// import's pins (§9): a private page inside a team page, and a root
+// pinned again on every run.
+
+const (
+ insideGo = "internal/mapa/inside.go"
+ importPinsGo = "internal/mapa/import_pins.go"
+)
+
+var insideMutations = []mutation{
+ {gate: "IN3", test: "TestIN3PrivateInLinesAreNoPageInside",
+ name: "a private page's In: line counts",
+ edits: []edit{{file: insideGo,
+ from: "\tif kind != KindPage || rung != RungTeam || " +
+ "len(blocks) == 0 {",
+ to: "\tif len(blocks) == 0 {"}, {file: insideGo,
+ from: "\t\t\tif child != page.id && index.team[child] {",
+ to: "\t\t\tif child != page.id {"}}},
+ {gate: "I23", test: "TestI23TheImportPinsItsRootsOnce", pkg: inside,
+ name: "a root is offered on every run",
+ edits: []edit{{file: importPinsGo,
+ from: "\t\tif entry.place.Pin != nil || entry.place.PageID == 0 ||",
+ to: "\t\tif entry.place.PageID == 0 ||"}}},
+}
diff --git a/scripts/mutate/main.go b/scripts/mutate/main.go
index 0810b45..779f808 100644
--- a/scripts/mutate/main.go
+++ b/scripts/mutate/main.go
@@ -43,6 +43,7 @@ func every() []mutation {
all := append([]mutation{}, mutations...)
all = append(all, imageMutations...)
all = append(all, lookMutations...)
+ all = append(all, insideMutations...)
all = append(all, mapperMutations...)
all = append(all, importMutations...)
return append(all, menuMutations...)