feat(rules,backend,web): narrative identity — epithet, appearance, traits, backstory#36
Merged
Merged
Conversation
…aits, backstory PR B of #10: users own their characters. New optional player-authored fields, ignored by the rules engine (story, not mechanics — nothing here can affect a derived number). - rules: narrativeSchema (epithet <=200, appearance fields, <=12 traits, backstory <=20k) as optional characterSchema.narrative; deriveSheet passes it through onto the sheet untouched. 5 tests incl. proof that identical builds with/without narrative derive identical numbers. - backend: characterFields.narrative + characters.updateNarrative — a narrow mutation that edits the story without resubmitting the build, still round-tripping the merged character through the rules layer so bounds are enforced at the write; passing no narrative clears it. 2 tests (round-trip incl. clear; bounds rejection). - web: shared NarrativeFields form (wizard identity step grows a collapsible PERSONNEL FILE section; the dossier gains an EDIT FILE panel via updateNarrative). SheetView identity band: schematic portrait frame ("NO IMAGE ON FILE"), name + serif epithet, trait chips, physicals readout, and the backstory panel in the one human voice. The editor lives outside the keyed sheet Match so live updates (e.g. rolling vitals mid-edit) cannot remount it and wipe typed text. Browser-verified: edited Kestrel via EDIT FILE -> identity band, chips, physicals, and backstory streamed onto the dossier live; wizard personnel-file section renders. 157 tests, per-package checks and prod build clean.
There was a problem hiding this comment.
5 issues found across 12 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…mma traits, disclosure a11y, form caps, empty-appearance guard
- the dossier editor resets its form (and closes) whenever the route
id changes, so one character''s draft can never be written into
another''s file — no longer relying on remount timing
- traits reject commas at the schema (chips are comma-separated in
editors; a comma would split a chip on round-trip) + regression test
- both disclosure toggles (PERSONNEL FILE, EDIT FILE) carry
aria-expanded/aria-controls
- form controls mirror the schema caps via maxLength (epithet 200,
appearance 40-120, backstory 20k, traits worst-legal-case), so
writes cannot be rejected for length
- the physicals block hides when an API-written `appearance: {}` has
no rows to show
There was a problem hiding this comment.
0 issues found across 6 files (changes from recent commits).
Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR B of #10: users own their characters. New optional, player-authored narrative fields with designed homes on the sheet — story, not mechanics.
Rules
narrativeSchema—epithet(≤200),appearance(height/weight/age/eyes/origin/disposition),traits(≤12 chips, ≤60 chars each),backstory(≤20k) — all optional, attached ascharacterSchema.narrative.deriveSheetpasses it through onto the sheet untouched. A test derives the same build with and without a narrative and asserts identical combat/vitals/skills/saves: nothing here can affect a number.Backend
characterFields.narrativemirrors the shape; create/update validate it for free via the existing rules round-trip.characters.updateNarrative— a narrow mutation to edit the story without resubmitting the whole build. It merges into the stored character and re-validates through the rules layer, so bounds are enforced at the write; passing no narrative clears it.Web
NarrativeFieldsform; name remains the only required field).updateNarrative. Deliberately rendered outside the keyed sheet<Match>so live subscription updates (e.g. rolling vitals mid-edit) can''t remount the editor and wipe typed text.Verification
Browser-verified against the local deployment: opened Kestrel''s dossier → EDIT FILE → filled epithet/appearance/traits/backstory → Commit to File → the identity band, chips, physicals, and backstory panel streamed in live over the subscription with zero console errors. Wizard personnel-file section renders and folds.
157 tests across the workspace (7 new); per-package
vp checkand the production build are clean.Out of scope: portrait upload (file storage), PR C (interactive rolls + telemetry rail + vitals bars).
Summary by cubic
Add optional player-authored narrative fields (epithet, appearance, traits, backstory) that appear on the character sheet and never affect mechanics. Adds a focused way to edit this story data without resubmitting a build.
New Features
narrativeSchemaadded tocharacterSchema.narrative(epithet, appearance, traits, backstory).deriveSheetpasses it through untouched; does not change any numbers.characterFields.narrativepluscharacters.updateNarrativeto edit or clear narrative. Changes re-validated through the rules layer to enforce limits.NarrativeFields, saving viaupdateNarrativeand rendered outside the keyed sheet to avoid wiping in-progress edits.Bug Fixes
aria-expanded/aria-controls.maxLengthso writes can't fail on length.appearance: {}has no values.Written for commit 5b1007e. Summary will update on new commits.