JSON import/export for full encounter state #17

Open
opened 2026-03-25 16:11:35 +01:00 by dostulata · 0 comments
Owner

Summary

Add the ability to export and import the full application state as a JSON file. Export includes the current encounter, undo/redo history, and player character templates. Import replaces all existing state after user confirmation (if an encounter is active). Supports both backup/restore of own sessions and sharing prepared encounters with other DMs.

Acceptance Criteria

  • User can export the current state to a .json file download
  • Export includes encounter (combatants + turn state), undo/redo stacks, and player character templates
  • User can import a .json file via file picker
  • Import replaces the current encounter, undo/redo history, and player characters
  • Import shows a confirmation dialog if the current encounter is non-empty
  • Imported data is validated using the same rules as localStorage loading (rejects malformed files)
  • Invalid files show a user-facing error message
  • Export/import buttons are accessible in the UI

Dependencies

  • #16 (Undo/redo) — export format includes undo/redo stacks

Context

  • Research: docs/agents/research/2026-03-25-combat-state.md
## Summary Add the ability to export and import the full application state as a JSON file. Export includes the current encounter, undo/redo history, and player character templates. Import replaces all existing state after user confirmation (if an encounter is active). Supports both backup/restore of own sessions and sharing prepared encounters with other DMs. ## Acceptance Criteria - [ ] User can export the current state to a `.json` file download - [ ] Export includes encounter (combatants + turn state), undo/redo stacks, and player character templates - [ ] User can import a `.json` file via file picker - [ ] Import replaces the current encounter, undo/redo history, and player characters - [ ] Import shows a confirmation dialog if the current encounter is non-empty - [ ] Imported data is validated using the same rules as localStorage loading (rejects malformed files) - [ ] Invalid files show a user-facing error message - [ ] Export/import buttons are accessible in the UI ## Dependencies - #16 (Undo/redo) — export format includes undo/redo stacks ## Context - Research: `docs/agents/research/2026-03-25-combat-state.md`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dostulata/initiative#17