oficina / fichas Public

Fichas level-up spec, revision 4: Fable APPROVE on the re-check; its four lows folded in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 25e21c8079a0594243a9f7df2f83cb6811cbc22c parent 533f0f3
1 file changed, +7 −4
  • docs/superpowers/specs/2026-11-17-fichas-level-up.md +7 −4

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	(cached)
?   	amadan.net/oficina/fichas/internal/fichas/icons	[no test files]
ok  	amadan.net/oficina/fichas/internal/fichas/seal	(cached)
ok  	amadan.net/oficina/fichas/internal/fichastest	1.043s
?   	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/docs/superpowers/specs/2026-11-17-fichas-level-up.md b/docs/superpowers/specs/2026-11-17-fichas-level-up.md
index 0f13d02..848eba2 100644
--- a/docs/superpowers/specs/2026-11-17-fichas-level-up.md
+++ b/docs/superpowers/specs/2026-11-17-fichas-level-up.md
@@ -116,7 +116,9 @@ At 1440px with the rail, the table and the panel open, the page has three column
- **The foot:** when the state differs from the saved view, a "Changed" mark (a dot and the word), **Reset**, and **Save**. For a team view Save reads "Save for everyone". **Save as new…** opens the switcher's save form (§4.2).
- **Every change applies at once with script.** The panel rewrites the URL (`history.replaceState`) and the work redraws from the server's HTML fragment. Nothing is written until Save.
- **A value a person types into the panel is never put in the URL as typed** (§6.8): what `1.500` means depends on the reader's locale. The panel posts typed values as `tN`, with the page's locale as `tN.locale`, to `POST /t/{type}/apply`, which reads them (§6.8), writes nothing, and answers with the canonical URL: a 303 without script, the URL itself to the script, which puts it in the address. `parse` never reads `tN`, and `xN` is never read through a locale. Picked values (options, people, cards, relative date tokens) and dates from the date input are already canonical and go into the URL directly.
-- **With scripts off, the panel is a form.** "Apply" posts it to `POST /t/{type}/apply`, and the 303 lands on the same URL a script would have made. "Add a condition", "Then by…" and the column moves are submit buttons that redraw the form with one more row or a moved row. No GET writes anything (gate LU5).
+- **With scripts off, the panel is a POST form.** "Apply" posts it to `POST /t/{type}/apply`, and the 303 lands on the same URL a script would have made. "Add a condition", "Then by…" and the column moves post to the same route with the button's name, and land on the same URL with one more row or a moved row. `apply` writes nothing (gate LU5).
+ - **A refused value** (an ambiguous `1.500` under R2, or a bad `tN.locale`) writes no URL: the route redraws the panel (422) with the message beside the control.
+ - **A state past 4,000 bytes** is rendered as `POST /t/{type}/preview` renders it (§4.9), not redirected. "Add a condition", "Then by…" and the column moves are submit buttons that redraw the form with one more row or a moved row. No GET writes anything (gate LU5).
### 4.2 The view switcher
@@ -574,7 +576,7 @@ Each input is read in **the locale the page was drawn in**, which the form echoe
- **The seed** an editor starts from is the value in the reader's format **without group marks** (rastrillo's `currency.InputValue` rule: a group mark is what can make the same digits mean a thousand times more under another reading): `1200,5` for a German reader. **An unchanged seed is no change:** when the posted text equals the seed of `was`, the value is `was`, with no reading at all, as `form.Money`'s `Stored` rule keeps an ambiguous seed. So `1,234` (one point two three four, in German) saves untouched.
- **Money** is rastrillo's money field end to end: `form.Field{Kind: form.Money, Currency: <the field's code>, LocaleEcho: true}`, `parsed.Minor`, `form.SeedMoney` for the seed, `Stored` set to the posted `was` in minor units (nil when `was` is empty), so an unchanged seed of the value the editor saw is kept and the transaction's compare (§5.2) decides the rest, `Negative: true` (revision 3 allowed a minus; a refund is money too), and the `field-money` partial, in the scriptless form and the cell editor alike. The currency is always the server's; a posted currency that differs is refused (`money_currency_changed`). Decimals past the currency's are `money_precision`.
- **Dates and times** need no locale: `<input type="date">` and `type="time"` show the date in the browser's own locale and post ISO, and the picker (§3.4) posts ISO too. `form.Date` and `form.DateTime`, with `Field.Location` the team's zone, read it.
-- **The cell edit posts a form-encoded body, never JSON,** with the same names as the form (`<key>`, `was.<key>`, `<key>.locale`, and money's `<key>.seed` and `<key>.currency`), because rastrillo's `form.Parse` reads posted form values; it gets JSON back. So one reading serves both, and `was` is compared only after the value is read and made canonical (§5.2). The cell text it returns is drawn in the echoed page locale, not the request's.
+- **The cell edit posts a form-encoded body, never JSON,** with the same names as the form (`<key>`, `was.<key>`, `<key>.locale`, and money's `<key>.seed` and `<key>.currency`), because rastrillo's `form.Parse` reads posted form values; it gets JSON back. A number posts no seed: its unchanged-seed check is computed on the server from `was.<key>` and the echoed locale, so no posted seed is ever trusted. So one reading serves both, and `was` is compared only after the value is read and made canonical (§5.2). The cell text it returns is drawn in the echoed page locale, not the request's.
- **Everywhere else a person types a value** reads it the same way: a filter value in the View panel (posted and turned into a canonical URL, §4.1), and a paste (⌘V, §5.6). **The Find box is the exception:** it is a GET, so it carries no echo, and its query is read in the request's locale, under every reading (§6.4).
#### What rastrillo needs
@@ -590,6 +592,7 @@ Checked against the version Fichas pins (`v0.35.1-0.20261116213651-96812beacacc`
**Phase 1 reads numbers without R2.** Phase 1 edits today's kinds in place, Number among them, before the grammar. Its interim reading is the **strict** one, the reader's own convention only, as rastrillo's `Strict` money fields read, on the same pack data Phase 1 draws numbers from:
- digits (ASCII, or the locale's own ten); the pack's ordinary decimal mark (`Decimal`) at most once; and a leading minus;
+- every space a person can type (space, no-break space, narrow no-break space) is one mark, and U+0027 is U+2019, as rastrillo's `Clean` and parser treat them;
- the pack's group mark (`CurrencyGroup`, the only one the packs carry until R1) only at valid group positions of the pack's grouping, and **not at all** where that mark is also a decimal mark in the locale (`CurrencyGroup` equal to `Decimal`, or `CurrencyDecimal` differing from `Decimal`, as in `fr-CH`). So `1,200` from an English reader is 1200, and no mark is ever read both ways.
One convention means one reading, so it cannot be ambiguous; it never rounds, and it writes the canonical form. Phase 1 draws numbers without group marks, so nothing it draws depends on the group mark being read right. It is built on rastrillo's locale data (`locales.Resolve` and `locales.Data`), in one file, and is deleted when R2 lands in Phase 2. Anything it refuses gets "Enter a number, like 1200,5." in the reader's format. A test holds that every number Fichas draws and every seed, in every linked locale, read back through it as the same value.
@@ -955,7 +958,7 @@ Each phase after that is its own branch from `main`, with mock-ups checked again
- **First, rastrillo's R1 and R2** (§6.8), on a rastrillo branch with its own review, then pinned. The number reading becomes R2's, the interim strict reading is deleted, and number values are drawn by R1, grouped, rather than ungrouped from the pack's decimal mark.
- The Formats page and its cookie (§6.8), and search by value (§6.4).
4. The `views` table, `SeedViews`, `viewFor` with `scope.Owned`, the `fichas-views` cookie, the columns cookie retired (§4.3, §4.6, §4.8).
-5. The URL grammar: sections, per-kind values, `parse` and `href`, the redirect from today's parameters, the 4,000-byte rule and `POST /t/{type}/preview` (§4.9).
+5. The URL grammar: sections, per-kind values, `parse` and `href`, the redirect from today's parameters, the 4,000-byte rule, `POST /t/{type}/preview` and `POST /t/{type}/apply` (§4.1, §4.9).
6. The View panel for the table and the cards layouts: filter on any field with §6.3's operators for today's kinds, sort by several, group as one table with a `<tbody>` per group, columns with order, width, hide and freeze (§4.1, §4.4–4.6).
7. The caption (§4.10).
8. The switcher, Save, Save as new, Reset, team and personal scope, the revision check, Manage views, view history, Restore, Undo and deleted views (§4.2, §4.8).
@@ -1090,7 +1093,7 @@ Paul approved the spec and Q1–Q12 the same day, and asked whether Fichas uses
| Gate LU17; LU4's unchanged-value case restated per locale | §15 |
| D22, D23 | §16 |
-**Fable's diff check of revision 4** (`36df131`): CHANGES REQUIRED, one High (Phase 1 drew numbers through `x/text` and read them with the packs, whose marks disagree in dozens of locales), four Mediums (typed filter values in the URL; money's `Stored`; the cell edit's body; grouping before Phase 4) and eleven Lows. All folded in above.
+**Fable's diff check of revision 4** (`36df131`): CHANGES REQUIRED, one High (Phase 1 drew numbers through `x/text` and read them with the packs, whose marks disagree in dozens of locales), four Mediums (typed filter values in the URL; money's `Stored`; the cell edit's body; grouping before Phase 4) and eleven Lows. All folded in above. **Fable's re-check of the fixes** (`533f0f3`): **APPROVE**, with four Lows (the edges of `apply`, the scriptless panel's method, typed spaces and apostrophes, and the number seed), folded in here.
### Round 1: Fable on revision 1 (`00e3ad3`), CHANGES REQUIRED, answered in revision 2