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
## 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
- [x] User can export the current state to a `.json` file download
- [x] Export includes encounter (combatants + turn state), undo/redo stacks, and player character templates
- [x] User can import a `.json` file via file picker
- [x] Import replaces the current encounter, undo/redo history, and player characters
- [x] Import shows a confirmation dialog if the current encounter is non-empty
- [x] Imported data is validated using the same rules as localStorage loading (rejects malformed files)
- [x] Invalid files show a user-facing error message
- [x] 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`
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
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
.jsonfile download.jsonfile via file pickerDependencies
Context
docs/agents/research/2026-03-25-combat-state.md