19 KiB
phase, plan, subsystem, tags, requires, provides, affects, actuals, plan_head_before, plan_head_after, tech-stack, key-files, key-decisions, patterns-established, requirements-completed, coverage, duration, completed, status
| phase | plan | subsystem | tags | requires | provides | affects | actuals | plan_head_before | plan_head_after | tech-stack | key-files | key-decisions | patterns-established | requirements-completed | coverage | duration | completed | status | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 10-admin-vue-spa | 03 | admin |
|
|
|
|
|
453b8ae786 |
8f32416f4f |
|
|
|
|
|
|
23min | 2026-09-27 | complete |
Phase 10 Plan 03: Admin lists, forms, filters and settings Summary
Any cabana controller now gets a working admin list and form from its server schema. Lists have URL-driven search, sort, filters and paging, plus selection and confirmed bulk delete. Forms have tabs and every built-in field type, including searchable relation selects and chips. They show 422 messages under their fields, toast on save, and follow the Winter redirects mapped onto SPA routes. Settings pages render through the same form renderer.
Performance
- Duration: 23 min
- Started: 2026-09-27T14:37:22Z
- Completed: 2026-09-27T15:00:38Z
- Tasks: 3
- Files modified: 64 in summercms.go (including rebuilt dist assets and generated OpenAPI outputs); fonoteka.go untouched
Accomplishments
- Strings (D-20, D-24).
main.tsloadsGET /langfirst, then/auth/me, then navigation and settings.i18n.tsstores the bundle andmeta.localeand sets<html lang>.t,tcandmessagepick CLDR forms withIntl.PluralRulesand fall back toother.interpolatemirrorsphrasebook.interpolatefor:name,:Nameand:NAME, replacing longest placeholders first. - Routes and URLs (D-10). New routes
/:vendor/:plugin/:controller/create,/:id(\d+),/settingsand/settings/:code.mapWinterUrlonly produces the current controller's list, create or record route. Foreign or unknown shapes fall back to the list (T-10-20). - Forms (D-05, D-09, D-18).
FormViewloads the form schema and the record (dataplusmeta.labels) and shows the fields whose context allows the mode. Fields are grouped into tabs, andFormGridlays them out by span. Saving POSTs or PUTs values keyed by field name, including relation ids. A 422 mapserror.detailsonto fields (aria-invalid, aria-describedby), shows the plural banner, badges tabs, focuses the first invalid field and clears a field's error when it changes. The sticky footer has Usuń (confirm, DELETE), Anuluj, Zapisz i zamknij (mappedredirectClose) and Zapisz (mappedcreate.redirectafter a create). A dirty form confirms before any route leave and sets abeforeunloadguard. - Registry (D-05, D-17, D-26). text, textarea, number, dropdown, switch, checkbox and relation are registered. Any other type, including
relation-managerfor now, renders the dashedUnsupportedFieldbox with the type in DM Mono. Relation fields cover three modes. A read-only field shows only its label. A single field is a searchable combobox overfields/{field}/options, withemptyOptionfirst and muted, a 300 ms debounce, 20 per page and more on scroll or a button. A multiple field shows ordered chips with initials avatars and "Usuń: :name" remove buttons, plus an appending search. - Lists (D-12, D-13, D-14, D-22, D-27). Search (300 ms debounce, resets the page), sort, page, per_page and
filter[<name>]live in the URL, and any change clears the selection.DataTablerenders exactly the schema columns: a tri-state page checkbox, a sort cycle witharia-sort, selected rows, a sticky header, eight skeleton rows and an empty slot.CellValuerenders text, datetime and switch pills. The heading shows the pluralrecordCountand the create button. The toolbar holds search and delete, which is disabled without a selection and otherwise confirms with the pluraldeleteConfirmbeforePOST bulk-delete.FilterBarsendsJSON.stringifyof switch values,from..todate ranges and scope values loaded fromfilters/{scope}/options.Paginationshows the range, the per-page select (hidden with one option) and a pager with ellipsis. - Settings (D-21). The rail pins Ustawienia to the bottom when
/settingsis non-empty. The index groups pages by category, and each page renders its schema throughFormGridand the registry, PUTs its values and maps a 422. - Contract. The admin OpenAPI document now types the write bodies and the list filter query (see Deviations), so the SPA sends typed payloads and declares no API shapes of its own.
Task Commits
- Task 1 (tracer): open, edit and save a record with toast and 422 feedback:
126ca5b(feat) - Task 2: search, sort, filter, page and bulk-delete any list:
8b5f856(feat) - Task 3: tabs, toggles, relation fields, form lifecycle and settings pages:
8f32416(feat)
Plan metadata: recorded in the docs commit that adds this file.
Tracer gate (Task 1): the Task 1 <verify> (typecheck, edit smoke test, TestPhase10SPAKeysResolve, check-admin-dist) was re-run after its commit and passed before Task 2 started (human_verify_mode end-of-phase, automated verify).
Decisions Made
See key-decisions in the frontmatter. The most consequential one is documenting the write bodies and the filter query in the framework OpenAPI document instead of loosening types in the SPA.
Deviations from Plan
Auto-fixed Issues
1. [Rule 3 - Blocking] The admin OpenAPI document had no request bodies and no filter parameter
- Found during: Task 1
- Issue:
schema.d.tstyped create, update, settings PUT and bulk delete withrequestBody?: never, so openapi-fetch rejected any body. The list query had nofilterparameter. The plan requires typed PUT and bulk-delete bodies and forbids SPA-declared payload shapes. - Fix:
cabana/admin_openapi.godeclares@Param body body AdminRecordon create, update and settings PUT, and a new doc typeAdminIDsRequest {ids: uint64[]}on bulk delete and relation link/unlink. Afilterobject query parameter is also declared.internal/tools/swagger2openapiconverts an object query parameter intostyle: deepObject, explode: truewith string values. Both generated outputs were regenerated and the drift check passes. Handlers and the conformance test are unchanged, since the conformance test checks responses only. - Files:
cabana/admin_openapi.go,internal/tools/swagger2openapi/main.go,admin/openapi/admin.json,admin/src/api/schema.d.ts - Commit:
126ca5b
2. [Rule 3] Helper modules not named in the plan's file list
admin/src/components/form/formState.ts(context filtering, save payload, 422 mapping, focus and tab ids) andFormErrorBanner.vueare shared byFormViewandSettingsFormView, as the plan requires ("maps a 422 like the record form").admin/src/components/ui/confirm.tsis the promise wrapper both views use aroundConfirmDialog.admin/tests/helpers.tsholds the fetch mock and app mount the four new smoke files share.- Commits:
126ca5b,8b5f856,8f32416
3. [Rule 1] Tracer smoke test adjusted to the new list
- Found during: Task 2
- Issue: The shared list fixture now has a checkbox column (
showCheckboxes: truerenders one), a datetime column and a switch column. The 10-01 tracer assertions compared everythandtd. - Fix: The tracer test skips
[data-select]cells and compares the first three schema columns of each row. Its intent (schema columns and rows through the typed client) is unchanged. - Commit:
8b5f856
4. [Rule 2 - Security] Winter attributes: pass through an allowlist
- A field's
attributesmap is plugin YAML. Binding it wholesale onto inputs would let a plugin set arbitrary attributes, includingon*handlers. Only readonly, placeholder, length and range limits, step, autocomplete, spellcheck and pattern are applied. - Commit:
126ca5b
5. [Process] Not a TDD plan
- The plan's tasks carry no
tdd="true", so no RED evidence was recorded. Each task's tests and code were committed together, keeping every commit green (CLAUDE.md).
6. [Process] Commits land on master
- As in 10-01 and 10-02 (
branching_strategy: none), the orchestrator directed commits ontomaster.
Total deviations: 4 auto-fixed (2 blocking, 1 bug, 1 security), 2 process notes. Impact on plan: None on scope. The OpenAPI change adds request documentation only, and wire behaviour is unchanged.
Issues Encountered
- The known fonoteka.go
parityfailures (TestMigrateSeedsCanonicalGenres,TestSchemaMatchesPHPSnapshot) remain, as logged indeferred-items.md. Every other package passesgo vetandgo test, including the fonoteka plugin modules.TestPhase10Controllerspasses. gofmt -l internal/build/registry.gois still listed (pre-existing, deferred).
Known Stubs
admin/src/components/form/registry.ts:relation-manageris not registered, so the Collections "Redaktorzy" tab renders the unsupported-field box. The plan requires this: Plan 10-04 adds the relation manager. It is recorded in.planning/WINDOWS.md(entry 4).- WINDOWS entries 2 (untranslated keys until the bundle loads) and 3 (read-only tracer list) are marked fixed by this plan.
Threat Flags
None. No new endpoint, auth path or schema change. The OpenAPI change documents existing request bodies. Plugin strings render as text only (no v-html), all requests go through the typed client, and Winter URLs are mapped, never followed verbatim.
User Setup Required
None.
Next Phase Readiness
- Plan 10-04 can register
relation-managerinregistry.ts, which removes the fallback on the Collections editors tab. It can reuseDataTable(selection, sorting and states),ConfirmDialogwithuseConfirm,Button, the toasts and the typedAdminIDsRequestbody for link and unlink.RelationSchema.messagesis already typed. - Plan 10-05's unit tests can target
i18n.ts,winterUrl.ts,listQuery.ts,formState.tsandregistry.tsdirectly. The smoke tests already cover most component behaviour. - The human browser check (five controllers and Ustawienia at /plytadmin) is left for phase verification.
Phase: 10-admin-vue-spa Completed: 2026-09-27
Self-Check: PASSED
All created files listed above exist; commits 126ca5b, 8b5f856 and 8f32416 (summercms.go) are present. Plan verification re-run: typecheck, all 51 smoke tests, go test ./phrasebook, check-admin-dist.sh, check-admin-openapi.sh --check, go vet ./... and go test ./... pass; TestPhase10Controllers passes in fonoteka.go.