Completed encounters collapse behind a toggle so reusable ended
encounters stay reachable without cluttering the active list. Group
headers show counts. Cards keep drag-reorder, player-display toggle,
live badge, and delete controls.
Pencil button on each encounter card opens an inline input prefilled
with the current name. Enter or the save button commits via updateDoc;
Escape or the cancel button discards. Empty/whitespace names are
ignored. Covers save, cancel, and empty-name cases in tests.
Open selected encounters in a focused full-page panel by default, with a Back control and scroll lock. Add per-device switches in the Encounters header to disable open-on-top or completed-group collapsing. Cover selection, return-to-list, display updates, and preference persistence.
Add an Edit action to campaign cards with a prefilled form for name, player-display background URL, and default ruleset. Update only those campaign fields, preserving roster and existing encounter rulesets. Cover save, clearing values, cancel, and invalid name.
Replace moon/coffee action-label toggle with coffee icon plus slash overlay. ON shows amber; OFF shows a slash with no color. Accessible name (Caffeine ON/OFF) and aria-pressed carry state. Applied to admin header, encounter header, and both player display states.
Add a dice button beside the Initiative field in the participant edit modal that rolls d20 + Init Mod; Cancel/Save guard accidental changes. Persist initMod on participant creation (quick-add monster, roster character/NPC, Add All) and expose it as an editable field in the modal. Roster NPCs added via the character dropdown now enter as npc type, and the duplicate guard keys on originalCharacterId regardless of type.
- 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
- use shared character participant builder for single-add and Add All so saved current HP, Max HP, AC, and stable state carry forward
- add End Encounter checkbox to override character writeback for one action
- default transient checkbox from campaign preference without persisting changes
- support explicit writeback override in shared endEncounter logic
- cover both add paths and modal enable/disable/reset behavior
- add generic encounter effects with round countdown, damage expiry, logs, and undo/redo
- add 5e Turned and Spiritual Weapon presets inside existing Conditions panel
- support custom participant or encounter effects with owner, notes, duration, and player visibility
- convert 5e minute durations to rounds while keeping generic rules round-only
- show prominent or compact effects on player and DM participant cards
- attach owner-linked encounter effects to owner card with global fallback for ownerless effects
- add direct turns-left editing plus step controls
Default effect ownership to active participant, allow inline reassignment or clearing, move owner-linked effects between participant cards, and add direct turns-left editing coverage.
- persist independent Hide Disabled and Hide Dead encounter controls
- keep dead PCs exempt from Hide Dead while allowing Hide Disabled to hide any inactive participant
- add confirmed Kill action that sets zero HP, dead, and inactive without deleting
- add undoable Heal Full action above Revive
- fix random initiative reroll test flake
Spec files are ephemeral (/tmp fine); the server DB is the durable
record — encounter docs carry hpFormula/ac/init, so past builds can be
reconstructed by querying live data, not from kept files.
Vetting before any write (vetSpec):
- monster/npc with neither maxHp nor hpFormula = hard reject (exit 3);
silent 10 HP defaults caused real damage. --allow-defaults escape
hatch warns loudly.
- character type in build spec = hard reject. PCs are added only from
campaign roster verbatim; tooling never invents or edits PC stats.
- missing ac or initMod/initiative = warning, build continues.
- duplicate participant names in one encounter = warning.
Flag parsing: --flags split from args, usage updated.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Broad encounter-management upgrade covering roster workflow, initiative, 5e death state, tracked effects, and tablet-friendly controls.
Encounter UX
Initiative and roster state
5e death saves and recovery
Tracked effects
Tooling/docs
Verification
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.