feat(frontend): stat-block editor + infobox projection (#140) #209
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/140-statblock-editor"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Frontend for the v3.9.0 Game-Aware Systems pillar. Targets the integration branch. Builds on #139 (and #135). #145 (conversion wizard) depends on this.
Closes #140.
What
StatBlockEditorcomponent — on npc/creature wiki articles whose campaign links a system with a schema, renders a grouped, typed form fromGET /api/game-systems/{id}/schema: int→number, str→text, text→textarea, enum→select, bool→checkbox, list→repeatable rows. Prefilled fromentry.stats.values, plus a visibility control (defaultgm). Saves viaupdateLoreEntrywith{stats:{values,visibility}}; server 400s surface inline.entry.statsis present, its values render as infobox rows alongsidesidebar_fields, labelled from the schema. (The server already hides GM-only stat blocks from players.)stats.schema_version < schema.version) → read-only + "Update to v{n}" (GM-confirmed migration, nothing auto-migrates); system mismatch / unlinked → "not the campaign's current system" badge + per-entry "Delete stat block" (stats: null).fetchGameSystemSchema(systemId)added toapi/gameSystems.js.Verification (Node 20)
node:20-alpine,npm ci && npm test && npm run build).Review fix included
During verification the error-surfacing test surfaced a real design bug: the number inputs' native
max/minmade an out-of-range value:invalid, so native form validation silently blocked submit before the request reached the server — contradicting #139's "server is authoritative" contract. Fixed by addingnoValidateto the form (min/max stay as spinner hints; the server validates and its error surfaces). Committed asecf5acfon top of the implementation.🤖 Generated with Claude Code