oficina / fichas Public

File is the first menu, as in Docs, Slides and Mapa. Paul asked (2026-11-22) why there was no File menu; Card becomes File with its rows unchanged (New, Open full page, History, Delete…). No Import row until the Notion databases phase gives Fichas an importer. Luna approved "File"; level-up build note 24; unit and browser gates for the order, the phone row and axe.

Squashed from fix/file-menu into main.
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 335ba9d3e096d0ac13b0ca90f2e89e2423b924d1 parent 3dbd97f
8 files changed, +205 −9
  • copy-review/file-menu/result.json +17 −0
  • copy-review/file-menu/strings.json +10 −0
  • docs/superpowers/specs/2026-11-17-fichas-level-up.md +3 −2
  • internal/fichas/frame.go +7 −3
  • internal/fichas/frame_test.go +50 −0
  • internal/fichas/templates/partials.html +1 −1
  • internal/fichastest/browser_edit_test.go +12 −3
  • internal/fichastest/browser_file_menu_test.go +105 −0

CI passed — run details

CI log
=== vet ===
go vet ./...
go vet -tags browser ./internal/fichastest/
=== fmt ===
=== test ===
go test ./...
?   	amadan.net/oficina/fichas/cmd/fichas	[no test files]
ok  	amadan.net/oficina/fichas/internal/fichas	2.339s
?   	amadan.net/oficina/fichas/internal/fichas/icons	[no test files]
ok  	amadan.net/oficina/fichas/internal/fichas/locale	0.007s
ok  	amadan.net/oficina/fichas/internal/fichas/seal	(cached)
ok  	amadan.net/oficina/fichas/internal/fichastest	1.876s
?   	amadan.net/oficina/fichas/scripts/mockups	[no test files]
?   	amadan.net/oficina/fichas/scripts/preview	[no test files]
?   	amadan.net/oficina/fichas/scripts/writeestilo	[no test files]
=== migration-check ===
go tool rastrillo migration check
rastrillo migration check: models and migrations agree
diff --git a/copy-review/file-menu/result.json b/copy-review/file-menu/result.json
new file mode 100644
index 0000000..7d7fdaf
--- /dev/null
+++ b/copy-review/file-menu/result.json
@@ -0,0 +1,17 @@
+{
+ "action": "approve",
+ "guidance": null,
+ "note": "Reviewed 2026-11-22 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 and the suite's ellipsis convention (Docs). Luna approved every string as drafted, with no edits and no flags. Paul's ask, 2026-11-22: \"Why is there no 'File' menu? I would have thought File -> Import was a thing\".",
+ "strings": [
+ {
+ "id": "menu.file",
+ "text": "File",
+ "original": "File",
+ "edited": false,
+ "rerolled": false,
+ "rerolls": [],
+ "done": true
+ }
+ ],
+ "flags": "none"
+}
diff --git a/copy-review/file-menu/strings.json b/copy-review/file-menu/strings.json
new file mode 100644
index 0000000..5f7109c
--- /dev/null
+++ b/copy-review/file-menu/strings.json
@@ -0,0 +1,10 @@
+[
+ {
+ "id": "menu.file",
+ "section": "File menu (the menu bar's first menu)",
+ "label": "Menu title",
+ "text": "File",
+ "context": "The first menu's title in the menu bar, renamed from \"Card\". Docs, Slides and Mapa call theirs \"File\". It holds New <singular>, and on a card Open full page, History and Delete….",
+ "notes": "No Import row until the Notion databases phase gives Fichas an importer."
+ }
+]
diff --git a/docs/superpowers/specs/2026-11-17-fichas-level-up.md b/docs/superpowers/specs/2026-11-17-fichas-level-up.md
index b9499ae..5fad8d4 100644
--- a/docs/superpowers/specs/2026-11-17-fichas-level-up.md
+++ b/docs/superpowers/specs/2026-11-17-fichas-level-up.md
@@ -35,7 +35,7 @@ Two things are borrowed from the other directions (Q1):
## 2. What was chosen
-- **Header:** Docs', Slides' and Mapa's I2 stacked header (estilo `39792ae`, already pinned). It carries Fichas' mark, the title, the menus Card, Edit, View, Type and Help, the **view switcher** and the save state in the lead slot, the **View** toggle, the primary action ("New customer") and the account.
+- **Header:** Docs', Slides' and Mapa's I2 stacked header (estilo `39792ae`, already pinned). It carries Fichas' mark, the title, the menus File, Edit, View, Type and Help (File was Card until build note 24), the **view switcher** and the save state in the lead slot, the **View** toggle, the primary action ("New customer") and the account.
- **Rail:** Fichas' rail stays (R1), with **folders** as collapsible headings (R2), an icon per type, New type below a rule, and ⌘\ to fold it.
- **The View panel:** one floating glass panel, Docs' inspector for data. It holds the layout (Table, Board, Calendar, Cards), filter, sort, group, and columns with order, width, hide and freeze. Its foot says "Changed" when the view differs from what is saved, with Reset, Save and Save as new.
- **The caption:** one sentence over the table: "Customers where Stage is Lead, Contacted or Proposal and Next action is before 1 December, soonest Next action first." Each underlined word opens that part of the panel.
@@ -59,7 +59,7 @@ The estilo bar stack, as Mapa uses it (Mapa level-up §3.1). Fichas' slots:
|---|---|
| Mark | Fichas' mark, linking to `/` |
| Title | The type's plural on a list ("Customers"); the card's title on a card's full page; "New type" in the designer. Not renamed in place: a type is renamed in its settings, a card on its card |
-| Menubar | **Card**: New, Open full page, Delete… · **Edit**: Undo, Redo · **View**: Show View panel, Table, Board, Calendar, Cards, Density, Fold rail · **Type**: Fields, Card layout, Type settings, New type, Folders · **Help** |
+| Menubar | **File** (build note 24; it was Card), first as in Docs, Slides and Mapa: New, Open full page, History, Delete…, and Import from Notion… after New once the Notion databases phase gives Fichas an importer · **Edit**: Undo, Redo · **View**: Show View panel, Table, Board, Calendar, Cards, Density, Fold rail · **Type**: Fields, Card layout, Type settings, New type, Folders · **Help** |
| Lead | The view switcher (§4.2) and the save state: "Saved", "Saving…", or "Couldn't save" with Retry |
| Actions | View (toggles the panel, `aria-pressed`), the primary "New <singular>". Search left the bar (build note 23): it is the rail's first row |
| Account | estilo's account menu, as today |
@@ -1105,6 +1105,7 @@ Choices made while building, where this spec was silent or the build chose diffe
### After Phase 1
23. **The header has no Search** (Paul, 2026-11-18: "I think we can just lose the search icon in the header"; amends §3.1 and §3.2). The bar's Search, made a lens with "Search ⌘K" as its tooltip that morning (main `6a57585`), is gone, and the rail never had one, so Search moved there, where Mapa has it: the rail's first row, "Search" with ⌘K beside it while the rail is open, the icon with "Search" as its tooltip when folded; and below 800px the Menu sheet's first row (the bar's `Nav`, which the sheet draws), the only Search a phone has on a card or History, which have no Find box. Each goes to the type's Find box (`/t/<type>#find`), focusing it in place on the list. ⌘K, from a page with no Find box, goes where the rail's row goes, never from inside a field; the row (`data-fichas-search`) is in the page below 800px too, where the rail is not drawn. estilo's `Action.IconOnly` stays for a later action. `browser_search_entries_test.go` holds it: no Search in the bar at 1440, 1000, 800 and 390, scripts on and off, nor "Search ⌘K" anywhere; the rail's row open and folded (by width and by choice), from the list and a card, scripts on and off; the sheet's one first row on the list, a card and History; ⌘K and Ctrl+K at three widths, and nothing from inside a field; axe at four widths; no shift in the bar.
+24. **File is the first menu** (Paul, 2026-11-22: "Why is there no 'File' menu? I would have thought File -> Import was a thing"; amends §2 and §3.1). The Card menu is now File (`id="fichas-menu-file"`), as in Docs, Slides and Mapa (Mapa level-up build note 87), and keeps its rows: New <singular> ("New card" off a type), and on a card Open full page, History and Delete…, last and set apart. **Import has a place but no row.** Fichas has no importer yet; the Notion databases phase (§11, the importer's §17) adds "Import from Notion…" after New, as Mapa has it, for its importers only. Until then File draws no Import, rather than a row that leads nowhere. With scripts off File is a `<details>` of links, and below 800px the menus are the bar's own second row (estilo's Menu sheet carries the types and actions, never the menus), so a phone reaches the same rows. No shortcut changed. Copy: "File" went through Luna (`copy-review/file-menu`). Gates: `frame_test.go` holds the menus' order and File's rows off a type, on a type and on a card; `browser_file_menu_test.go` checks File is the first menu and shown, with the same rows, each on screen with File open, at 1440 and 390, scripts on and off, on the list and a card, with no import link anywhere; File → New customer by pointer at both widths; and axe with File open at 1440 and 390.
---
diff --git a/internal/fichas/frame.go b/internal/fichas/frame.go
index ae4abd1..176444b 100644
--- a/internal/fichas/frame.go
+++ b/internal/fichas/frame.go
@@ -157,10 +157,14 @@ func menusFor(f frameFacts) menuBar {
if f.TypeKey != "" {
newCard.Href += "?type=" + f.TypeKey
}
- card := []menuItem{newCard}
+ // File is first, as in Docs, Slides and Mapa (level-up build note
+ // 24). Its Import from Notion… comes with the Notion databases
+ // phase, after New and before the card's rows, as in Mapa; until
+ // Fichas has an importer there is no row for it.
+ file := []menuItem{newCard}
if f.CardID != 0 {
id := strconv.FormatInt(f.CardID, 10)
- card = append(card,
+ file = append(file,
menuItem{Kind: "link", Label: "Open full page", Href: "/cards/" + id},
menuItem{Kind: "link", Label: "History", Href: "/cards/" + id + "/history"},
menuItem{Kind: "divider"},
@@ -191,7 +195,7 @@ func menusFor(f frameFacts) menuBar {
typ = append(typ, menuItem{Kind: "link", Label: "New type", Href: "/types/new"})
help := []menuItem{{Kind: "dialog", Label: "Keyboard shortcuts", Dialog: "fichas-keys", Key: "?"}}
return menuBar{Label: "Fichas", Menus: []menuView{
- {ID: "card", Title: "Card", Items: card},
+ {ID: "file", Title: "File", Items: file},
{ID: "edit", Title: "Edit", Items: edit},
{ID: "view", Title: "View", Items: view},
{ID: "type", Title: "Type", Items: typ},
diff --git a/internal/fichas/frame_test.go b/internal/fichas/frame_test.go
new file mode 100644
index 0000000..60e69c9
--- /dev/null
+++ b/internal/fichas/frame_test.go
@@ -0,0 +1,50 @@
+package fichas
+
+import (
+ "slices"
+ "testing"
+)
+
+// File is the first menu, as in Docs, Slides and Mapa (level-up build
+// note 24), and keeps what Card held: New, then on a card Open full
+// page, History and Delete…, last and set apart. Fichas has no importer
+// yet, so File has no Import row.
+func TestFileIsTheFirstMenu(t *testing.T) {
+ for _, check := range []struct {
+ facts frameFacts
+ want []string
+ }{
+ {frameFacts{}, []string{"New card"}},
+ {frameFacts{TypeKey: "t_customer", Singular: "Customer"},
+ []string{"New customer"}},
+ {frameFacts{TypeKey: "t_customer", Singular: "Customer", CardID: 7},
+ []string{"New customer", "Open full page", "History", "—",
+ "Delete…"}},
+ } {
+ bar := menusFor(check.facts)
+ var titles []string
+ for _, menu := range bar.Menus {
+ titles = append(titles, menu.Title)
+ }
+ if !slices.Equal(titles, []string{"File", "Edit", "View", "Type",
+ "Help"}) {
+ t.Fatalf("the menus are %q", titles)
+ }
+ file := bar.Menus[0]
+ if file.ID != "file" {
+ t.Errorf("File's id is %q", file.ID)
+ }
+ var rows []string
+ for _, item := range file.Items {
+ if item.Kind == "divider" {
+ rows = append(rows, "—")
+ continue
+ }
+ rows = append(rows, item.Label)
+ }
+ if !slices.Equal(rows, check.want) {
+ t.Errorf("%+v: File is %q, want %q", check.facts, rows,
+ check.want)
+ }
+ }
+}
diff --git a/internal/fichas/templates/partials.html b/internal/fichas/templates/partials.html
index a140512..a182a0a 100644
--- a/internal/fichas/templates/partials.html
+++ b/internal/fichas/templates/partials.html
@@ -57,7 +57,7 @@
</form>
</nav>{{end}}
-{{/* fichas-menubar: Card, Edit, View, Type, Help (§3.1). Each menu is a
+{{/* fichas-menubar: File, Edit, View, Type, Help (§3.1). Each menu is a
<details> in estilo's exclusive group, so it opens with no script. A
command row is disabled until grid.js binds it; a form row is a real
POST, so it works with scripts off. Data: menuBar. */}}
diff --git a/internal/fichastest/browser_edit_test.go b/internal/fichastest/browser_edit_test.go
index 3d40586..052b6c3 100644
--- a/internal/fichastest/browser_edit_test.go
+++ b/internal/fichastest/browser_edit_test.go
@@ -256,6 +256,17 @@ func TestTheKeyboardWalk(t *testing.T) {
// FICHAS_AXE, or the copy the Ruby gem ships; a missing axe fails, since
// a skip is not a pass.
func axeCheck(t *testing.T, rig *harness.Rig, path string, width int64, open string) {
+ t.Helper()
+ var steps []chromedp.Action[chromedp.Void]
+ if open != "" {
+ steps = append(steps, chromedp.Click(open), chromedp.WaitVisible(`dialog[fichas-sheet]`))
+ }
+ axeCheckWith(t, rig, path, width, steps...)
+}
+
+// axeCheckWith is axeCheck with the page put in a state by before (a
+// menu opened, say) once it has loaded.
+func axeCheckWith(t *testing.T, rig *harness.Rig, path string, width int64, before ...chromedp.Action[chromedp.Void]) {
t.Helper()
src := os.Getenv("FICHAS_AXE")
if src == "" {
@@ -274,9 +285,7 @@ func axeCheck(t *testing.T, rig *harness.Rig, path string, width int64, open str
chromedp.Navigate(rig.Origin + path),
chromedp.WaitReady(`[fichas-main]`),
}
- if open != "" {
- steps = append(steps, chromedp.Click(open), chromedp.WaitVisible(`dialog[fichas-sheet]`))
- }
+ steps = append(steps, before...)
steps = append(steps,
chromedp.Evaluate[chromedp.Void](string(body)),
harness.Into(&found, chromedp.Evaluate[[]string](`axe.run(document, {resultTypes: ['violations']}).then(r => r.violations.filter(v => v.impact === 'serious' || v.impact === 'critical').map(v => v.id + ': ' + v.nodes.map(n => n.target.join(' ')).slice(0, 3).join(', ')))`, chromedp.EvalAwaitPromise)),
diff --git a/internal/fichastest/browser_file_menu_test.go b/internal/fichastest/browser_file_menu_test.go
new file mode 100644
index 0000000..69faea1
--- /dev/null
+++ b/internal/fichastest/browser_file_menu_test.go
@@ -0,0 +1,105 @@
+//go:build browser
+
+package fichastest
+
+import (
+ "encoding/json"
+ "fmt"
+ "slices"
+ "testing"
+
+ "amadan.net/rastrillo/rastrillo/harness"
+ "github.com/chromedp/chromedp"
+)
+
+// File is the first menu, as in Docs, Slides and Mapa (level-up build
+// note 24; Paul, 2026-11-22: "Why is there no 'File' menu?"). It keeps
+// Card's rows, and has no Import until the Notion databases phase gives
+// Fichas an importer. Below 800px the menus are the bar's own second
+// row (estilo's Menu sheet carries the types and actions, not the
+// menus), so a phone reaches File's very rows; with scripts off File is
+// a <details> of links.
+
+// fileMenu is File's rows as drawn, a divider as "—", the first menu's
+// title and whether it is shown, and any import link on the page.
+const fileMenu = `(function () {
+ var first = document.querySelector("[estilo-menubar] [estilo-menubar-title]");
+ var file = document.getElementById("fichas-menu-file");
+ var rows = Array.prototype.map.call(
+ file.querySelectorAll("[estilo-menu] > hr, [estilo-menu-label]"),
+ function (row) { return row.tagName === "HR" ? "—" : row.textContent; });
+ return JSON.stringify({first: first.textContent,
+ shown: first.checkVisibility(), rows: rows,
+ imports: document.querySelectorAll('a[href*="import"]').length});
+})()`
+
+// rowsOffScreen names File's rows that are hidden or cross the
+// viewport's sides.
+const rowsOffScreen = `Array.prototype.filter.call(
+ document.querySelectorAll("#fichas-menu-file [estilo-menu-item]"),
+ function (row) {
+ var box = row.getBoundingClientRect();
+ return !row.checkVisibility() || box.left < 0 || box.right > document.documentElement.clientWidth;
+ }).map(function (row) { return row.textContent; }).join(", ")`
+
+type fileState struct {
+ First string
+ Shown bool
+ Rows []string
+ Imports int
+}
+
+func TestFileIsTheFirstMenu(t *testing.T) {
+ s := seedCards(t, 2)
+ card := cardPath(s.ids[0])
+ want := map[string][]string{
+ "/t/t_customer": {"New customer"},
+ card: {"New customer", "Open full page", "History", "—", "Delete…"},
+ }
+ for _, live := range []bool{false, true} {
+ for path, rows := range want {
+ for _, width := range []int64{1440, 390} {
+ name := fmt.Sprintf("%s at %dpx, scripts %v", path, width, live)
+ var raw string
+ s.rig.Run(scriptsOn(live), viewport(width),
+ chromedp.Navigate(s.rig.Origin+path), chromedp.WaitReady(`[estilo-bar]`),
+ harness.Into(&raw, chromedp.Evaluate[string](fileMenu)))
+ var got fileState
+ if err := json.Unmarshal([]byte(raw), &got); err != nil {
+ t.Fatalf("%s: %v", name, err)
+ }
+ if got.First != "File" || !got.Shown {
+ t.Errorf("%s: the first menu is %q, shown %v", name, got.First, got.Shown)
+ }
+ if !slices.Equal(got.Rows, rows) {
+ t.Errorf("%s: File is %q, want %q", name, got.Rows, rows)
+ }
+ // The phone reaches File's very rows: open, each is shown
+ // and inside the viewport's width.
+ var off string
+ s.rig.Run(chromedp.Click(`#fichas-menu-file > summary`),
+ harness.Into(&off, chromedp.Evaluate[string](rowsOffScreen)))
+ if off != "" {
+ t.Errorf("%s: File's rows not on screen: %s", name, off)
+ }
+ if got.Imports != 0 {
+ t.Errorf("%s: %d import links, before Fichas has an importer", name, got.Imports)
+ }
+ }
+ }
+ // File → New customer opens the form, by pointer, on a phone
+ // and wide.
+ for _, width := range []int64{1440, 390} {
+ s.rig.Run(scriptsOn(live), viewport(width),
+ chromedp.Navigate(s.rig.Origin+card),
+ chromedp.Click(`#fichas-menu-file > summary`),
+ chromedp.Click(`#fichas-menu-file a[href^="/cards/new"]`),
+ chromedp.WaitReady(`form[action="/cards"]`))
+ }
+ }
+ s.rig.Run(scriptsOn(true))
+ for _, width := range []int64{1440, 390} {
+ axeCheckWith(t, s.rig, card, width, chromedp.Click(`#fichas-menu-file > summary`),
+ chromedp.WaitVisible(`#fichas-menu-file a[href$="/history"]`))
+ }
+}