oficina / mapa Public

The header has no Search; Search is the sidebar's place and ⌘K

Paul, 2026-11-18: "I think we can just lose the search icon in the header". The bar's Search (the lens of 2a1a87a, tooltip "Search ⌘K") is removed. Search stays a place: the sidebar's row with ⌘K, the rail's icon with "Search" as its tooltip, the Menu sheet's place row below 800px (now the only Search row there), and ⌘K or Ctrl+K anywhere. Each opens ⌘K, and /search with scripts off. estilo is unchanged. Luna's copy record is kept, with a note on the removal. search_entries_browser_test.go checks there's no Search in the bar and that every remaining entry works, with axe and L5. Axe at 390px found the brand link had no name; frame.css's rule that keeps the name for screen readers now outweighs estilo's narrow rule. Build note 86 records it. make ci, make browser and hub CI green.

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

Squashed from fix/no-header-search into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 3a84dd765c754c1654ad3eba44fc0ab4f1360fb7 parent 2a1a87a
8 files changed, +225 −256
  • copy-review/search-icon/result.json +1 −0
  • copy-review/search-icon/strings.json +0 −26
  • docs/superpowers/specs/2026-11-14-mapa-level-up.md +2 −1
  • internal/mapa/frame.go +6 −11
  • internal/mapa/static/frame.css +4 −2
  • internal/mapa/static/mapa.js +2 −2
  • internal/mapatest/search_entries_browser_test.go +210 −0
  • internal/mapatest/search_icon_browser_test.go +0 −214

CI passed — run details

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

added 16 packages in 310ms
cd editor && node build-bundles.mjs
wrote internal/mapa/static/editor.115ddee5d3f54787.js (354112 bytes, 111.2KB gzipped; L12 budget 120KB)
cd editor && node --test
✔ a badge is named for what it does, starting with its visible word (2.413503ms)
✔ first words stop at five words or forty characters (0.171077ms)
✔ the field keeps one trimmed line, without brackets (0.264831ms)
✔ the field holds at most MaxAlt bytes, cut at a character (0.5185ms)
✔ days and weeks move across months and years (1.479823ms)
✔ a month keeps the day, or takes the month's last (0.298684ms)
✔ the grid is six weeks from Monday, as the month calendar draws it (0.666385ms)
✔ the grid starts the week where the locale does (1.418409ms)
✔ the keys move a day, a week, a month and a year (0.364265ms)
✔ the picked day is the chip [[ makes for a date (17.456056ms)
✔ Insert → Today's date still puts today in at once (2.343022ms)
✔ / offers Date, the picker, and Today's date beside it (0.279478ms)
✔ after a ! the chip goes in after a space, never as an embed (3.820259ms)
✔ where the Markdown would read the chip differently, it is refused (2.689483ms)
✔ over a selection the chip goes after it and the words stay (3.074337ms)
✔ today is the day in the viewer's zone (18.554342ms)
✔ every offered locale has cases (0.886443ms)
✔ dates.mjs writes every date Go writes, byte for byte (2.818283ms)
✔ a chip, the month and the week, in three locales (0.380275ms)
✔ dates.json is what ICU gives, byte for byte (439.552755ms)
✔ L1: mounting then serialising gives cleanBody(body), byte for byte (89.675313ms)
ℹ 871 bodies
✔ L1: mounting a stored body adds nothing, and saving it writes nothing new (72.250905ms)
✔ L2: one edited block changes only that block's bytes; undo gives the body back (116.911203ms)
ℹ 858 single-block edits
✔ L2: inserting or deleting a block changes bytes only at the new seams, by Join (127.770906ms)
ℹ 866 inserts, 817 deletes
✔ L3: seeded edits keep the document and its Markdown saying the same thing (4055.451847ms)
ℹ 20904 edits over 871 bodies
✔ L3: Link to a page makes exactly one chip, and changes nothing else (1070.444844ms)
ℹ 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 (1059.725681ms)
ℹ over 871 bodies: {"inserted":5158,"spaced":23,"refused":45,"unstable":9}
✔ linear: trailing spaces (31.589748ms)
✔ linear: trailing whitespace (19.648418ms)
✔ linear: unclosed web links (23.559377ms)
✔ linear: web links with no address (35.103911ms)
✔ linear: unclosed wiki links (28.432285ms)
✔ linear: unclosed embeds (18.225214ms)
✔ linear: closes only (7.394753ms)
✔ the selected words become the chip's shown text (9.431808ms)
✔ words that are the title make a plain [[Title]] (3.780175ms)
✔ spaces at the selection's edges stay outside the chip (1.889831ms)
✔ a date makes a date link, in a heading, an item and a quote (4.928292ms)
✔ bold words lose their bold: a chip carries no marks in Mapa's Markdown (0.823496ms)
✔ only the linked block's bytes change, and undo gives the body back (1.730306ms)
✔ a selection across blocks, over a chip or a break, or of brackets is refused (0.838433ms)
✔ a target the words cannot be linked to as typed is refused (0.189962ms)
✔ ⌘L: over a selection it opens Page link; with none it types [[; in code it does nothing (2.269155ms)
✔ web-linked words are refused: the address would be lost (review M4) (0.840808ms)
✔ words whose Markdown would read otherwise are refused (review M3) (1.880064ms)
✔ ⌘A then ⌘L says why, instead of doing nothing (review low 1) (0.391525ms)
✔ linkCheck says why it refuses (review low 2) (1.222566ms)
✔ golden file has bodies (0.977421ms)
✔ markup.mjs parses every body into Go's blocks, byte offsets and all (32.636027ms)
✔ markup.mjs strips and spans every block as Go does (55.207833ms)
✔ the schema's toDOM draws every body as Go renders it (60.666409ms)
✔ emphasis draws the four pinned outputs (16.000029ms)
✔ a body ends in the editor's empty paragraph (0.211962ms)
✔ the editor labels date chips as Go does, in every locale L4 holds (9.635866ms)
✔ a POST that never answers is aborted after the timeout (21.432486ms)
✔ a keepalive POST carries no signal, and an answer clears the timer (1.26283ms)
✔ autosave sends only what differs, and the tab owns the draft it wrote (12.097267ms)
✔ an offered draft never commits by itself; Save commits it (1.485193ms)
✔ reload, then close: sessionStorage says the draft is this tab's own (1.200745ms)
✔ closing carries text not yet sent, and the cap leaves it out (42.062082ms)
✔ clean rebase: applied, the caret survives, the base moves by the rebase POST (3.905949ms)
✔ the block under the caret is the teammate's too, and undo brings back yours (8.58061ms)
✔ typing mid-flight: the merge is not applied and the base does not move (1.974027ms)
✔ a merge the editor cannot represent stops after three tries (4.282536ms)
✔ a conflict is shown, locks the editor's own commits, and Resolve settles it (1.516681ms)
✔ leaving: a conflict stays with the choice; a failed flush offers Leave anyway; a stored draft leaves (1.905992ms)
✔ a stale tab shows the newer draft, offered, and never overwrites it (0.836851ms)
✔ the first scratch commit: empty creates nothing, then one page, then drafts on it (0.732037ms)
✔ noBase and gone lead to the existing choices (0.677375ms)
✔ a commit that merged is applied when nothing was typed since (0.797798ms)
✔ back from the cache: nothing unsaved reloads, unsaved text autosaves at once (6.100265ms)
✔ an own draft committed meanwhile goes on as a new draft (1.192219ms)
✔ a reload keeps a stored draft; unsent text still commits (0.476103ms)
✔ a page deleted mid-edit: what is typed is still stored as the draft, and nothing commits (H1) (1.055867ms)
✔ an offered draft committed in another tab: typing goes on as a new draft (H1) (2.189427ms)
✔ a commit reply without a revision is not a commit; an emptied day starts afresh (H2) (0.899276ms)
✔ Resolve stores what was typed first, and takes no typing until its answer is applied (M1) (1.909158ms)
✔ closing with a choice open, or commits held, still writes the text, never commits (M2) (1.203741ms)
✔ closing inside the settling window sends the loaded version with settling=1 (M3) (0.355699ms)
✔ a clean merge not applied because of typing still ends the choice on show (M4) (0.970649ms)
✔ settling finds the draft committed with a teammate's text: a close still writes (M-A) (0.534551ms)
✔ settling finds another tab's newer draft: the tab shows it before any typing (0.723351ms)
✔ a page deleted before the first autosave: the text is offered as a scratch page, and a close makes one (M-B) (0.711809ms)
✔ an autosave that never answered but landed: its 409 keeps the typing since (L3) (0.6478ms)
✔ marks: em outside strong, bold reopened around italics, edges outside (5.200897ms)
✔ marks close before code, links and atoms, and reopen after (0.374204ms)
✔ untouched blocks and atoms re-emit their source; edited atoms are written from attributes (5.575842ms)
✔ empty blocks are written as nothing (2.085454ms)
✔ an unclosed fence that is no longer last gets its closing fence (1.41971ms)
✔ the structure check puts Join's seam where a kept one would merge two blocks (2.365955ms)
✔ prepareSave adopts the parse when no seam or rewrite can save the document (4.151924ms)
✔ reparse: typed emphasis becomes a mark, "- " after a break becomes an item (2.530699ms)
✔ a trailing hard break stays on screen and is written as nothing (1.292215ms)
✔ the reparse waits while an IME is composing (0.931656ms)
✔ copied blocks paste with their bytes and seams; a cut and paste gives the body back (3.04861ms)
✔ a forged x-mapa slice is refused, and text from outside is read as Markdown (0.632222ms)
✔ rebuild changes origins only, outside undo history (1.37593ms)
✔ applyBody takes a teammate's block, keeps the caret, and ends untouched (1.208941ms)
✔ a block whose context changed is written again: a task toggled, a bullet, a quote (7.451467ms)
✔ a duplicate ^id typed above its holder never takes the id from it (0.962934ms)
✔ a copy-dragged block is reparsed, and says what its Markdown says (1.085101ms)
✔ a history command that throws is refused, never thrown (4.163065ms)
✔ an image re-emits its source, and an edited alt changes only its span (1.022113ms)
✔ a paste whose image copy is refused says why and pastes nothing (17.491723ms)
✔ a line of image openers reads in linear time (88.74562ms)
✔ a line of shared link address reads in linear time (12.652807ms)
✔ a line of shared web address reads in linear time (50.268199ms)
✔ one rename at a time, from either field (1.793613ms)
✔ an empty or unchanged title sends nothing (0.171959ms)
✔ a refusal keeps what was typed, and the title (0.255825ms)
✔ the pending state holds for the busy rule (6.391003ms)
✔ a failed POST says so and keeps the title (0.454122ms)
✔ Update links posts the confirm page's POST (0.330182ms)
✔ clean is CleanTitle's whitespace rule (0.12947ms)
✔ the saver's base follows a rename made over it, and only that (0.305507ms)
✔ closing sends the rename as one keepalive POST (1.786681ms)
✔ the port answers every shared case as typeddate.go does (5.754984ms)
✔ numbers follow the locale: 12/11 is November in en-IE, December in en-US (0.21567ms)
✔ M6: several files land in the order they were chosen (40.618167ms)
✔ M5: one Backspace before the box keeps the image where the box is (12.367669ms)
✔ M5: undoing text typed just before the box keeps the upload (12.466481ms)
✔ L12: a failed upload an undo takes away does not stall the next (14.293786ms)
✔ M4: Replace… keeps the old image until the new one is in, and its alt (12.167366ms)
✔ M3 and N1: text wins, except over a picture copied from a page (1.53279ms)
✔ N2: a JPEG over 10 MB is scaled before its size is checked (4.617998ms)
✔ a drag whose anchor the document no longer reaches selects to its end (4.337268ms)
ℹ tests 126
ℹ suites 0
ℹ pass 126
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 6747.409532
=== 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	3.102s
?   	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	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/markup	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/notionmd	(cached)
ok  	amadan.net/oficina/mapa/internal/mapa/seal	(cached)
ok  	amadan.net/oficina/mapa/internal/mapatest	12.682s
?   	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
diff --git a/copy-review/search-icon/result.json b/copy-review/search-icon/result.json
index 9753094..94524d1 100644
--- a/copy-review/search-icon/result.json
+++ b/copy-review/search-icon/result.json
@@ -2,6 +2,7 @@
"action": "approve",
"guidance": null,
"note": "Reviewed 2026-11-18 by Luna (gpt-5.6-luna through Codex, ephemeral), the copy-review gate for Oficina copy since Paul's delegation of 2026-11-17, briefed with Paul's house rules from CARLOS platform's LUNA-COPY-BRIEF-stateless-replicas-4.md. Luna approved every string as drafted, with no edits and no flags.",
+ "removed": "2026-11-18, the same day: Paul, \"I think we can just lose the search icon in the header\". The bar's Search is gone, and with it all three strings reviewed here: the lens's name (bar.search.name), its tooltip \"Search ⌘K\" (bar.search.tooltip) and the Menu sheet's action row (sheet.search). Their drafts (strings.json) are deleted; this record of Luna's approval stays. Search remains a place, as before this review: the sidebar's row with ⌘K, the rail's icon with \"Search\" as its tooltip, and the Menu sheet's place row \"Search\" below 800px.",
"strings": [
{
"id": "bar.search.name",
diff --git a/copy-review/search-icon/strings.json b/copy-review/search-icon/strings.json
deleted file mode 100644
index c20f5f9..0000000
--- a/copy-review/search-icon/strings.json
+++ /dev/null
@@ -1,26 +0,0 @@
-[
- {
- "id": "bar.search.name",
- "section": "The bar",
- "label": "Search's accessible name",
- "text": "Search",
- "context": "The header's Search is now the lens icon alone; this is its aria-label. The shortcut is aria-keyshortcuts (Meta+K Control+K), not part of the name.",
- "notes": "Unchanged wording; it was the visible label."
- },
- {
- "id": "bar.search.tooltip",
- "section": "The bar",
- "label": "Search's tooltip",
- "text": "Search ⌘K",
- "context": "Shown on hover and keyboard focus over the lens: the name, a space, and the shortcut as the app writes it elsewhere.",
- "notes": "New."
- },
- {
- "id": "sheet.search",
- "section": "The bar",
- "label": "The Menu sheet's Search row",
- "text": "Search ⌘K",
- "context": "Below 800px the header's actions are rows in the Menu sheet; the row keeps the word and now shows the shortcut, as Fichas' does.",
- "notes": "The ⌘K is new in Mapa."
- }
-]
diff --git a/docs/superpowers/specs/2026-11-14-mapa-level-up.md b/docs/superpowers/specs/2026-11-14-mapa-level-up.md
index 64f0910..767e12d 100644
--- a/docs/superpowers/specs/2026-11-14-mapa-level-up.md
+++ b/docs/superpowers/specs/2026-11-14-mapa-level-up.md
@@ -59,7 +59,7 @@ He was shown three directions: Página, Estante and Contexto. He ruled: **"Let's
- presence, "Ana is editing", on team pages only (base §5);
- estilo's `savestatus`;
- the day pill, on daily notes (§4.4).
- - **Actions:** Search ⌘K, History and Links.
+ - **Actions:** History and Links. (Search ⌘K was the first; build note 86 took it out.)
- Links is a `WideOnly` toggle action, with `aria-expanded` and `aria-controls`, like Docs' Format.
- **Account:** last, after estilo's divider.
- **Mark and hue:**
@@ -1279,6 +1279,7 @@ Phase 1's choices where this spec was silent, or where the build chose different
- **Round 8** (Fable on `9fb939f`: CHANGES REQUIRED, three Mediums, no High). M1, M2 and L4 as above. M3, the gates missed most localised places: `locale_sweep_test.go` seeds an old page, a team page linked and mentioned from two daily notes, 1,234 added blocks, a restore and a pinned daily note, then reads every screen (today, two days, a paged month, the team page, its History, the History fragment, a version, the day's History, version and delete screens, All pages, two searches, Settings) in German and in en-US, failing on anything only an en-IE writing has (a day before an undotted month name, an English weekday, an English short pill, English week letters, a comma-grouped or ungrouped 1234) or that en-US never writes (a day before its month, a weekday with no comma, a 24-hour afternoon); `TestTheSweepSeesEveryKindOfDate` holds the same screens to show each in en-IE, so none passes by showing nothing. 34 call-site mutations, each swapping the reader's locale for the default (or the per-locale templates for the default's, or the header-only negotiation for rastrillo's middleware), run through `go test -overlay` over the locale gates: 32 caught. Two survive, both by construction: a team page's label is its title, which no locale writes (`around.go`'s team chip), and Update links' "N pages" (`pagesCount`) differs only past 999. `locale_settings_test.go`: the prefix is a 404, the cookie is ignored, the own format outranks en-US, French and no header, is sealed and logged once, goes back to the browser's, refuses four bad values without a row, and reading writes nothing; gate 8 drives the new route. Lows: `Locale.Localizer` is nil-safe (L1); `dates.test.mjs` regenerates `dates.json` from ICU and compares byte for byte when the Node links the same ICU and CLDR, and says it skipped otherwise (L2); rastrillo's `number` writes 1.234 in Spanish and U+00A0 in French where CLDR 48 writes 1234 and U+202F, pinned in `TestNumbersAreRastrillos` and reported for rastrillo (L3). Fable's diff check of `4cbc802`: APPROVE, M1 to M3 resolved; its three Lows are fixed: a stored code Mapa no longer offers reads as unset in Settings (`TestAFormatNoLongerOfferedReadsAsUnset`), saving the format already set writes nothing, no event and no member row (`TestSavingTheSameFormatWritesNothing`; both red on `4cbc802`), and `versionDay` lost its unused `now`.
- **For Paul.** CLDR's en-IE writes "Thursday, 12 November" without the year and "Wednesday 1 January 2025" with it, and en-GB the other way round; Mapa writes what CLDR says, so the default's chips without a year gained a comma ("Thursday, 12 November"); day titles, cut from the full date, did not ("Thursday 12 November" and " 2026"). With the shown text and ", your note" a chip's accessible name reads "Thursday, 12 November, your note". Which locales Mapa offers is a list in `gen-dates.mjs`. A person's own format is a Settings choice (round 8); without one, a reader in Ireland whose browser asks for en-US gets month-first dates, Sunday weeks, 12-hour times and `12/11` as 11 December.
- **Merged with images** (main `f9337f9`). The images' screens go through the reader's locale too: "Images on this page" writes "Earlier image, taken out on <date>" with `dateYear` in the reader's locale and time zone (it was Go's `2 January 2006` in UTC), and an upload's refusals write their numbers with `Locale.Number` (the 10,000-pixel side, and the allowances' sizes). The sweep reads the old page's Markdown screen, which lists an image taken out of it; `TestImageRefusalsWriteNumbersInTheReadersLocale` reads both refusals in en-IE and German. The locale's migration is `0006_alter_members`, after images' `0005_images`.
+86. **The header has no Search** (Paul, 2026-11-18: "I think we can just lose the search icon in the header"; amends §3.1). The bar's Search, made a lens with "Search ⌘K" as its tooltip that morning (main `2a1a87a`), is gone. Search is a place, as it always was: the sidebar's row with ⌘K, the rail's icon with "Search" as its tooltip, the Menu sheet's place row below 800px (now its only Search row; it had two), and ⌘K or Ctrl+K on every page. Each opens ⌘K, and the search page with scripts off. estilo's `Action.IconOnly` stays for a later action. `search_entries_browser_test.go` holds it: no Search in the bar at 1440, 1000, 800 and 390, scripts on and off, nor "Search ⌘K" anywhere; the sidebar's row open and in the rail, its tooltip on hover; the sheet's one row; the shortcut from six screens at three widths; axe at four widths; L5 for the bar. Axe at 390 found the brand link nameless there (below 800px estilo's rule for a bar with a title hides the name again, outweighing Mapa's rule that kept it for screen readers); that rule in `frame.css` now outweighs it.
## 14. Findings and what changed
diff --git a/internal/mapa/frame.go b/internal/mapa/frame.go
index 127d275..39ac802 100644
--- a/internal/mapa/frame.go
+++ b/internal/mapa/frame.go
@@ -119,12 +119,6 @@ func leadFor(page *pageChrome) leadView {
Status: page.Editor || page.Writable, Day: page.Day}
}
-// searchAction is the bar's Search: a link to the search page, which
-// mapa.js turns into ⌘K.
-var searchAction = chrome.Action{Item: menu.Item{Href: "/search",
- Label: "Search", Key: "⌘K"}, Icon: iconHTML("search"), IconOnly: true,
- KeyShortcuts: "Meta+K Control+K"}
-
// placesNav is the sidebar's places as the bar's nav. estilo shows them
// as rows in the Menu sheet below 800px, where there is no sidebar;
// mapa.css hides the bar's own copy from 800px, where the sidebar is.
@@ -137,12 +131,13 @@ func placesNav(items []NavItem) []chrome.Link {
return links
}
-// barActions are Search, History and Links (§3.1). History needs a page
-// with history; Links, a screen with the panel. Search is the lens alone
-// in the bar (Paul, 2026-11-18): "Search" is its name, "Search ⌘K" its
-// tooltip, and the Menu sheet's row keeps the word.
+// barActions are History and Links (§3.1). History needs a page with
+// history; Links, a screen with the panel. The bar has no Search (Paul,
+// 2026-11-18: "I think we can just lose the search icon in the
+// header"): Search is a place, the sidebar's row with ⌘K, the rail's
+// icon and the Menu sheet's row below 800px (placesNav).
func barActions(page *view) []chrome.Action {
- actions := []chrome.Action{searchAction}
+ var actions []chrome.Action
chromeOf := page.Chrome
if chromeOf != nil && chromeOf.Page != nil && chromeOf.Page.ID != 0 {
actions = append(actions, chrome.Action{Item: menu.Item{
diff --git a/internal/mapa/static/frame.css b/internal/mapa/static/frame.css
index a589e12..f145422 100644
--- a/internal/mapa/static/frame.css
+++ b/internal/mapa/static/frame.css
@@ -501,8 +501,10 @@ table[mapa-help-table] td:first-child { white-space: nowrap; }
/* estilo's stacked bar hides the app's name with display: none, which
* leaves the brand link with no name (axe's link-name, found by L10).
* The name stays in the accessibility tree, out of sight. To report
- * upstream: Docs' bar has the same gap. */
-[estilo-bar~="stacked"] [estilo-bar-name] {
+ * upstream: Docs' bar has the same gap. Below 800px estilo hides it
+ * again with a weightier rule, (0,3,0), for a bar with a title; this
+ * one, (0,4,0), outweighs both (axe at 390px, search_entries). */
+[estilo-bar~="stacked"][estilo-bar] [estilo-bar-brand] [estilo-bar-name] {
display: block;
position: absolute;
inline-size: 1px;
diff --git a/internal/mapa/static/mapa.js b/internal/mapa/static/mapa.js
index 83d556f..f417ed6 100644
--- a/internal/mapa/static/mapa.js
+++ b/internal/mapa/static/mapa.js
@@ -872,8 +872,8 @@
var palette = null;
bindCommands();
belowTheText();
- // Search in the bar and the sidebar opens ⌘K; without script they
- // are links to the search page.
+ // Search in the sidebar and in the bar's Menu sheet opens ⌘K;
+ // without script they are links to the search page.
document.querySelectorAll('[estilo-bar] a[href="/search"], [mapa-side] a[href="/search"]').forEach(function (link) {
link.addEventListener("click", function (event) {
if (event.metaKey || event.ctrlKey || event.shiftKey) return;
diff --git a/internal/mapatest/search_entries_browser_test.go b/internal/mapatest/search_entries_browser_test.go
new file mode 100644
index 0000000..80a4e1c
--- /dev/null
+++ b/internal/mapatest/search_entries_browser_test.go
@@ -0,0 +1,210 @@
+//go:build browser
+
+package mapatest
+
+import (
+ "fmt"
+ "strings"
+ "testing"
+
+ "amadan.net/rastrillo/rastrillo/harness"
+ "github.com/chromedp/chromedp"
+ "github.com/chromedp/chromedp/kb"
+)
+
+// The header has no Search (Paul, 2026-11-18: "I think we can just lose
+// the search icon in the header"). Search is a place: the sidebar's row
+// with ⌘K, the rail's icon with "Search" its tooltip, the Menu sheet's
+// row below 800px, once, and ⌘K or Ctrl+K anywhere. Each opens ⌘K with
+// scripts and the search page without.
+
+// barSearch is anything in the bar that is a Search: a link to the
+// search page or an icon-only action, outside the Menu sheet.
+const barSearch = `Array.prototype.filter.call(
+ document.querySelectorAll('[estilo-bar] a[href="/search"], ' +
+ '[estilo-bar] [estilo-bar-icon], [estilo-bar] [aria-keyshortcuts]'),
+ function (el) {
+ return !el.closest('[estilo-menu="sheet"]') && el.checkVisibility();
+ }).length`
+
+// paletteOpen waits for ⌘K's dialog.
+var paletteOpen = chromedp.WaitVisible("dialog[mapa-palette] input")
+
+func TestTheBarHasNoSearch(t *testing.T) {
+ rig, _ := browserRig(t, 1)
+ path := firstTeamPage(t, rig)
+ for _, live := range []bool{false, true} {
+ for _, width := range []int64{1440, 1000, 800, 390} {
+ for _, at := range []string{"/", path, path + "/history",
+ "/search?q=line"} {
+ drive(t, rig, scripts(live),
+ chromedp.EmulateViewport(width, 900),
+ chromedp.Navigate(rig.Origin+at),
+ chromedp.WaitVisible("[estilo-bar]"))
+ if got := read(t, rig, chromedp.Evaluate[int](
+ barSearch)); got != 0 {
+ t.Errorf("%s at %dpx, scripts %v: the bar shows %d "+
+ "Search controls", at, width, live, got)
+ }
+ if html := read(t, rig, chromedp.Evaluate[string](
+ `document.documentElement.outerHTML`)); strings.Contains(
+ html, "Search ⌘K") {
+ t.Errorf("%s at %dpx, scripts %v: \"Search ⌘K\" is "+
+ "still drawn", at, width, live)
+ }
+ }
+ }
+ }
+ for _, width := range []int64{1440, 1000, 800, 390} {
+ drive(t, rig, scripts(true), chromedp.EmulateViewport(width, 900),
+ chromedp.Navigate(rig.Origin+path),
+ chromedp.WaitVisible("[estilo-bar]"))
+ if found := axeSerious(t, rig); found != "" {
+ t.Errorf("%dpx: axe:\n%s", width, found)
+ }
+ }
+}
+
+// openSearch presses the Search at selector: ⌘K with scripts, the
+// search page without.
+func openSearch(t *testing.T, rig *harness.Rig, name, selector string,
+ live bool, before ...chromedp.Action[chromedp.Void]) {
+ t.Helper()
+ steps := append(before, press(selector))
+ if live {
+ drive(t, rig, append(steps, paletteOpen)...)
+ return
+ }
+ drive(t, rig, append(steps,
+ chromedp.WaitVisible(`main input[name="q"]`))...)
+ if at := read(t, rig, chromedp.Evaluate[string](
+ `location.pathname`)); at != "/search" {
+ t.Errorf("%s with scripts off went to %s", name, at)
+ }
+}
+
+// The sidebar's row, open and in the rail, scripts on and off.
+func TestTheSidebarsSearchOpensSearch(t *testing.T) {
+ rig, _ := browserRig(t, 1, harness.WithHover())
+ path := firstTeamPage(t, rig)
+ for _, side := range sideCases {
+ for _, live := range []bool{false, true} {
+ name := fmt.Sprintf("%dpx, %s (cookie %q), scripts %v",
+ side.width, side.show, side.cookie, live)
+ drive(t, rig, scripts(live), sideCookie(rig, side.cookie),
+ chromedp.EmulateViewport(side.width, 877),
+ chromedp.Navigate(rig.Origin+path),
+ chromedp.WaitVisible(sideSearch))
+ label := read(t, rig, chromedp.Evaluate[string](
+ `document.querySelector('`+sideSearch+
+ ` [mapa-side-label]').textContent`))
+ if label != "Search" {
+ t.Errorf("%s: the sidebar's Search is labelled %q",
+ name, label)
+ }
+ if side.show == "rail" {
+ // The label is the rail's tooltip: hidden at rest, shown
+ // on hover.
+ const shown = `getComputedStyle(document.querySelector('` +
+ sideSearch + ` [mapa-side-label]')).opacity`
+ rested := read(t, rig, chromedp.Evaluate[string](shown))
+ drive(t, rig, rest(sideSearch), chromedp.Sleep(200e6))
+ hovered := read(t, rig, chromedp.Evaluate[string](shown))
+ if rested != "0" || hovered != "1" {
+ t.Errorf("%s: the rail's tooltip is at opacity %s at "+
+ "rest and %s on hover", name, rested, hovered)
+ }
+ drive(t, rig, rest("main"))
+ } else if kbd := read(t, rig, chromedp.Evaluate[string](
+ `document.querySelector('`+sideSearch+
+ ` kbd').textContent`)); kbd != "⌘K" {
+ t.Errorf("%s: the sidebar's Search shows %q", name, kbd)
+ }
+ openSearch(t, rig, name, sideSearch, live)
+ }
+ }
+}
+
+// Below 800px Search is the Menu sheet's row, once.
+func TestTheMenuSheetHasSearchOnce(t *testing.T) {
+ rig, _ := browserRig(t, 1)
+ path := firstTeamPage(t, rig)
+ const sheetSearch = `[estilo-menu="sheet"] a[href="/search"]`
+ for _, live := range []bool{false, true} {
+ name := fmt.Sprintf("the Menu sheet's Search, scripts %v", live)
+ drive(t, rig, scripts(live), chromedp.EmulateViewport(390, 844),
+ chromedp.Navigate(rig.Origin+path),
+ chromedp.Click("[estilo-bar-more] > summary"),
+ chromedp.WaitVisible(sheetSearch))
+ rows := read(t, rig, chromedp.Evaluate[string](
+ `Array.prototype.map.call(document.querySelectorAll(
+ '[estilo-menu="sheet"] [estilo-menu-item]'),
+ function (row) { return row.textContent.trim(); }).join("|")`))
+ if strings.Count("|"+rows+"|", "|Search|") != 1 ||
+ strings.Contains(rows, "⌘K") {
+ t.Errorf("scripts %v: the Menu sheet's rows are %q", live, rows)
+ }
+ openSearch(t, rig, name, sheetSearch, live)
+ }
+}
+
+// blurAll takes focus off whatever a page focused on load.
+const blurAll = `document.activeElement && document.activeElement.blur()`
+
+// ⌘K and Ctrl+K open Search from any page, at any width.
+func TestTheShortcutOpensSearchAnywhere(t *testing.T) {
+ rig, _ := browserRig(t, 1)
+ path := firstTeamPage(t, rig)
+ for _, width := range []int64{1440, 900, 390} {
+ for _, at := range []string{"/", "/pages", "/scratch", path,
+ path + "/history", "/search"} {
+ for _, modifier := range []chromedp.Modifier{
+ chromedp.ModifierMeta, chromedp.ModifierCtrl} {
+ drive(t, rig, scripts(true),
+ chromedp.EmulateViewport(width, 900),
+ chromedp.Navigate(rig.Origin+at),
+ chromedp.WaitVisible("[estilo-bar]"),
+ chromedp.Evaluate[chromedp.Void](blurAll),
+ chromedp.KeyEvent("k", chromedp.KeyModifiers(modifier)),
+ paletteOpen,
+ chromedp.KeyEvent(kb.Escape),
+ chromedp.WaitNotVisible("dialog[mapa-palette]"))
+ }
+ }
+ }
+}
+
+// L5 for the header: every control in it is where the server drew it
+// (scripts off) once the page has mounted, and no layout shift is
+// recorded from the start of the load, light and dark.
+func TestTheBarMovesNothing(t *testing.T) {
+ rig, _ := browserRig(t, 1)
+ path := firstTeamPage(t, rig)
+ drive(t, rig, onNewDocument(shiftRecorder))
+ const bar = `JSON.stringify(Array.prototype.map.call(
+ document.querySelectorAll("[estilo-bar-end] > *, " +
+ "[estilo-bar-actions] a, [estilo-bar-actions] button"),
+ function (el) { var b = el.getBoundingClientRect();
+ return [el.nodeName, b.left, b.top, b.width, b.height].join(" "); }))`
+ for _, dark := range []bool{false, true} {
+ for _, width := range []int64{1440, 1000} {
+ load := func(live bool) string {
+ drive(t, rig, scripts(live),
+ chromedp.EmulateViewport(width, 900), colorScheme(dark),
+ chromedp.Navigate(rig.Origin+path),
+ chromedp.WaitVisible("[estilo-bar-end]"),
+ chromedp.Sleep(300e6))
+ return read(t, rig, chromedp.Evaluate[string](bar))
+ }
+ off, on := load(false), load(true)
+ if off != on {
+ t.Errorf("%dpx dark=%v: the bar moved once scripts "+
+ "ran:\noff %s\non %s", width, dark, off, on)
+ }
+ if shifts := read(t, rig, chromedp.Evaluate[string](
+ `JSON.stringify(window.__shifts || [])`)); shifts != "[]" {
+ t.Errorf("%dpx dark=%v: layout shifts %s", width, dark, shifts)
+ }
+ }
+ }
+}
diff --git a/internal/mapatest/search_icon_browser_test.go b/internal/mapatest/search_icon_browser_test.go
deleted file mode 100644
index e895833..0000000
--- a/internal/mapatest/search_icon_browser_test.go
+++ /dev/null
@@ -1,214 +0,0 @@
-//go:build browser
-
-package mapatest
-
-import (
- "encoding/json"
- "fmt"
- "testing"
-
- "amadan.net/rastrillo/rastrillo/harness"
- "github.com/chromedp/chromedp"
- "github.com/chromedp/chromedp/kb"
-)
-
-// The header's Search is the lens alone (Paul, 2026-11-18): no visible
-// word, "Search" its accessible name, its shortcut aria-keyshortcuts,
-// "Search ⌘K" its tooltip on hover and on focus, whole on screen. It
-// still opens ⌘K, and the search page with scripts off; it moves
-// nothing as the page loads (L5); axe finds nothing serious; and on a
-// touch screen a tap lands on it anywhere in 44px.
-
-// barSearch is the header's Search, on screen from 800px.
-const barSearch = `[estilo-bar-actions] a[href="/search"]`
-
-// searchFacts is what the header's Search shows and says. Tip is
-// whether its tooltip can be hit at each edge: the tooltip takes
-// pointer events for the moment it is asked, so a box laid out but cut
-// off fails.
-const searchFacts = `(function () {
- var a = document.querySelector(%q), box = a.getBoundingClientRect();
- var tip = getComputedStyle(a, "::after");
- var probe = document.createElement("style");
- probe.textContent = "[estilo-bar-icon]::after { " +
- "pointer-events: auto !important; transition: none !important; }";
- document.head.appendChild(probe);
- // The tooltip's border box: rst-tip hangs it 6px under the control,
- // its end on the control's end. The middle of each edge, 2px in (the
- // corners are rounded), must be the tooltip's.
- var pad = function (side) { return parseFloat(tip["padding" + side]); };
- var content = tip.boxSizing !== "border-box";
- var width = parseFloat(tip.width) +
- (content ? pad("Left") + pad("Right") : 0);
- var height = parseFloat(tip.height) +
- (content ? pad("Top") + pad("Bottom") : 0);
- var right = box.right, top = box.bottom + 6, left = right - width;
- var misses = isFinite(width) && isFinite(height) ? [] :
- ["no tooltip box"];
- if (!misses.length) [[left + width / 2, top + 2],
- [left + width / 2, top + height - 2], [left + 2, top + height / 2],
- [right - 2, top + height / 2]
- ].forEach(function (p) {
- if (!a.contains(document.elementFromPoint(p[0], p[1]))) {
- misses.push(Math.round(p[0]) + "," + Math.round(p[1]));
- }
- });
- probe.remove();
- return JSON.stringify({Text: a.innerText.trim(),
- Name: a.getAttribute("aria-label"),
- Keys: a.getAttribute("aria-keyshortcuts"),
- Tip: tip.content, Shown: tip.opacity, Misses: misses.join(" "),
- Width: box.width, Height: box.height});
-})()`
-
-type searchShows struct {
- Text, Name, Keys, Tip, Shown, Misses string
- Width, Height float64
-}
-
-func showsOf(t *testing.T, rig *harness.Rig) searchShows {
- t.Helper()
- var got searchShows
- raw := read(t, rig, chromedp.Evaluate[string](
- fmt.Sprintf(searchFacts, barSearch)))
- if err := json.Unmarshal([]byte(raw), &got); err != nil {
- t.Fatal(err)
- }
- return got
-}
-
-func TestTheBarsSearchIsTheLensAlone(t *testing.T) {
- rig, _ := browserRig(t, 1, harness.WithHover())
- path := firstTeamPage(t, rig)
- for _, width := range []int64{1440, 1000, 800} {
- drive(t, rig, scripts(true), chromedp.EmulateViewport(width, 900),
- chromedp.Navigate(rig.Origin+path),
- chromedp.WaitVisible(barSearch))
- got := showsOf(t, rig)
- if got.Text != "" || got.Name != "Search" ||
- got.Keys != "Meta+K Control+K" || got.Tip != `"Search ⌘K"` {
- t.Errorf("%dpx: the bar's Search is %+v", width, got)
- }
- if got.Width != got.Height || got.Width < 24 {
- t.Errorf("%dpx: the lens is %vx%v, not a square of at least 24px",
- width, got.Width, got.Height)
- }
- if got.Shown != "0" {
- t.Errorf("%dpx: the tooltip shows at rest (opacity %s)",
- width, got.Shown)
- }
- drive(t, rig, rest(barSearch), chromedp.Sleep(200e6))
- if got := showsOf(t, rig); got.Shown != "1" || got.Misses != "" {
- t.Errorf("%dpx: on hover the tooltip is at opacity %s, "+
- "cut off at %q", width, got.Shown, got.Misses)
- }
- // Keyboard focus, reached by keys (Shift+Tab off the lens and
- // Tab back), so :focus-visible holds as it does for a person.
- drive(t, rig, rest("main"), chromedp.Focus(barSearch),
- chromedp.KeyEvent(kb.Tab,
- chromedp.KeyModifiers(chromedp.ModifierShift)),
- chromedp.KeyEvent(kb.Tab), chromedp.Sleep(200e6))
- if !read(t, rig, chromedp.Evaluate[bool](
- `document.querySelector('`+barSearch+
- `').matches(":focus-visible")`)) {
- t.Fatalf("%dpx: the lens did not take keyboard focus", width)
- }
- if got := showsOf(t, rig); got.Shown != "1" {
- t.Errorf("%dpx: on focus the tooltip is at opacity %s",
- width, got.Shown)
- }
- if found := axeSerious(t, rig); found != "" {
- t.Errorf("%dpx: axe:\n%s", width, found)
- }
- }
-
- // The same action as before: ⌘K with scripts, the page without.
- drive(t, rig, rest("main"), scripts(true),
- chromedp.EmulateViewport(1280, 900),
- chromedp.Navigate(rig.Origin+path), chromedp.WaitVisible(barSearch),
- press(barSearch), chromedp.WaitVisible("dialog[mapa-palette] input"))
- drive(t, rig, scripts(false), chromedp.Navigate(rig.Origin+path),
- chromedp.WaitVisible(barSearch), press(barSearch),
- chromedp.WaitVisible(`main input[name="q"]`))
- at := read(t, rig, chromedp.Evaluate[string](`location.pathname`))
- if at != "/search" {
- t.Errorf("with scripts off the lens went to %s", at)
- }
-
- // Below 800px the actions are the Menu sheet's rows, which keep the
- // word, and show the shortcut. (The sheet's places, Mapa's nav, come
- // first and hold their own Search, as they did before.)
- drive(t, rig, scripts(true), chromedp.EmulateViewport(390, 844),
- chromedp.Navigate(rig.Origin+path),
- chromedp.WaitVisible("[estilo-bar-more] > summary"))
- row := read(t, rig, chromedp.Evaluate[string](
- `Array.prototype.map.call(document.querySelectorAll(
- '[estilo-menu="sheet"] a[href="/search"]'),
- function (a) { return a.textContent; }).pop()`))
- if row != "Search⌘K" {
- t.Errorf("the Menu sheet's Search row reads %q", row)
- }
-}
-
-// L5 for the header: the lens and every control beside it are where the
-// server drew them (scripts off) once the page has mounted, and no
-// layout shift is recorded from the start of the load, light and dark.
-func TestTheBarsSearchMovesNothing(t *testing.T) {
- rig, _ := browserRig(t, 1)
- path := firstTeamPage(t, rig)
- drive(t, rig, onNewDocument(shiftRecorder))
- const bar = `JSON.stringify(Array.prototype.map.call(
- document.querySelectorAll("[estilo-bar-end] > *, " +
- "[estilo-bar-actions] a, [estilo-bar-actions] button"),
- function (el) { var b = el.getBoundingClientRect();
- return [el.nodeName, b.left, b.top, b.width, b.height].join(" "); }))`
- for _, dark := range []bool{false, true} {
- for _, width := range []int64{1440, 1000} {
- load := func(live bool) string {
- drive(t, rig, scripts(live),
- chromedp.EmulateViewport(width, 900), colorScheme(dark),
- chromedp.Navigate(rig.Origin+path),
- chromedp.WaitVisible(barSearch), chromedp.Sleep(300e6))
- return read(t, rig, chromedp.Evaluate[string](bar))
- }
- off, on := load(false), load(true)
- if off != on {
- t.Errorf("%dpx dark=%v: the bar moved once scripts "+
- "ran:\noff %s\non %s", width, dark, off, on)
- }
- if shifts := read(t, rig, chromedp.Evaluate[string](
- `JSON.stringify(window.__shifts || [])`)); shifts != "[]" {
- t.Errorf("%dpx dark=%v: layout shifts %s", width, dark, shifts)
- }
- }
- }
-}
-
-// On a touch screen the lens is drawn as the other controls are and
-// takes a tap anywhere in 44px around its centre.
-func TestTheBarsSearchTakesATouchIn44px(t *testing.T) {
- rig, _ := browserRig(t, 1, harness.WithCoarsePointer())
- path := firstTeamPage(t, rig)
- drive(t, rig, chromedp.EmulateViewport(1024, 768),
- chromedp.Navigate(rig.Origin+path), chromedp.WaitVisible(barSearch))
- if !read(t, rig, chromedp.Evaluate[bool](
- `matchMedia("(pointer: coarse)").matches`)) {
- t.Fatal("the page does not see a coarse pointer")
- }
- misses := read(t, rig, chromedp.Evaluate[string](`(function () {
- var a = document.querySelector('`+barSearch+`');
- var b = a.getBoundingClientRect(), misses = [];
- var x = (b.left + b.right) / 2, y = (b.top + b.bottom) / 2, r = 21.5;
- [[-r, -r], [r, -r], [-r, r], [r, r], [0, -r], [0, r], [-r, 0], [r, 0]]
- .forEach(function (d) {
- if (!a.contains(document.elementFromPoint(x + d[0], y + d[1]))) {
- misses.push(d.join(","));
- }
- });
- return misses.join(" ") + (misses.length ?
- " (drawn " + b.width + "x" + b.height + ")" : "");
-})()`))
- if misses != "" {
- t.Errorf("a tap misses the lens at %s", misses)
- }
-}