- Player display: death-save pips for dying participants (3 successes / 3 failures), stable shows note without pips
- stableRegainHours: 1d4 hours rolled on natural stabilization (3rd save success, manual stabilize, revive-to-stable); cleared on heal, damage-while-stable, inline HP edit, and death; undo/redo round-trips through all paths
- Roster writeback: end-of-encounter sync writes stable hours to characters (stable -> hours, conscious -> null); character card badge shows hours; stable state carried into new encounters via buildCharacterParticipant; editor Cur HP > 0 clears
- End-combat message corrected: states turn position and round reset while initiative values are kept
- Reroll All Initiative: d20 + initMod for every participant in a single write, undoable, pre-combat or paused only; confirmation modal in UI, hidden during active combat
- Add All (Roll Init) hoisted to Add Participants header row so it stays visible when the section is collapsed; header title remains the collapse toggle
Character writeback in endEncounter wrote to a bare campaigns/{id} path,
which the firebase adapter passes straight to the SDK — the update hit a
nonexistent top-level doc, threw, and aborted the whole end-combat action
(round never reset, combat stayed running).
- endEncounter now uses ctx.campaignPath (full artifacts/... path from
App.js), falling back to the bare path for server/test adapters
- writeback failures no longer block ending combat
- regression tests: campaignPath routing, writeback-failure resilience,
and participants never cleared on end
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Campaign-level toggle (CharacterManager, live flip). When ON, ending an
encounter writes each character participant's current HP, Max HP, and AC back
to the campaign roster so they carry into the next encounter.
- shared: buildCharacterParticipant uses defaultCurrentHp (fallback maxHp)
- endEncounter: syncs maxHp/ac/currentHp to campaign players if syncCharacters,
snapshots old values into undo payload for restore. Works retroactive
(ctx.campaignId fallback for encounters lacking campaignId field).
- New encounters store campaignId field.
- Undo end-encounter restores character values client-side.
- CharacterManager: styled sync toggle (checkbox badge), stat badges in list
(HP/Current HP/AC/Init), edit box supports Current HP field.
Tests: 5 writeback cases (off/on/skip monsters/undo snapshot/missing char).