Complete Story 3.3: Preset Import & Export

Implements FR-19: Preset import/export as JSON

New Files:
- src/core/PresetImportExportManager.js - Core logic for export/import with merge/replace
- src/ui/gm/PresetExportDialog.js - Export dialog with file download
- src/ui/gm/PresetImportDialog.js - Import dialog with file picker, preview, merge/replace
- templates/preset-export.hbs - Export dialog template
- templates/preset-import.hbs - Import dialog template
- styles/components/_preset-import-export.less - Dialog styles
- tests/unit/core/PresetImportExportManager.test.js - 38 unit tests
- _bmad-output/implementation-artifacts/3-3-preset-import-and-export.md - Story file

Modified Files:
- src/ui/gm/DirectorsBoard.js - Added export/import button handlers
- templates/directors-board.hbs - Added Export/Import buttons to footer
- styles/scrying-pool.less - Added stylesheet import
- lang/en.json - Added localization strings for new UI
- _bmad-output/implementation-artifacts/sprint-status.yaml - Story status: review

Features:
- Export all presets from current scene as JSON file
- Import presets with merge (add new, skip duplicates) or replace (overwrite all) modes
- Preview of presets before import with validation status
- Confirmation dialog for replace mode to prevent data loss
- Comprehensive error handling and validation
- All ACs satisfied (AC-9 deferred for README docs)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-05-23 16:28:53 +02:00
parent e31badf865
commit d175f92806
13 changed files with 2357 additions and 79 deletions
+89 -1
View File
@@ -45,7 +45,9 @@
"openButton": "Open Director's Board",
"footer": {
"savePreset": "Save Preset…",
"loadPreset": "Load Preset…"
"loadPreset": "Load Preset…",
"exportPresets": "Export Presets…",
"importPresets": "Import Presets…"
},
"bulk": {
"showAll": "Show All",
@@ -76,6 +78,92 @@
"name": "Spotlight Focused Participant",
"hint": "Shows the focused participant and hides all others"
}
},
"presets": {
"save": {
"saveButton": "Save",
"cancelButton": "Cancel",
"title": "Save Scene Preset",
"nameLabel": "Preset Name",
"namePlaceholder": "Enter a name for this camera layout"
},
"load": {
"loadButton": "Load",
"cancelButton": "Cancel",
"title": "Load Scene Preset",
"emptyMessage": "No presets saved yet. Use 'Save Preset' to create one."
},
"notifications": {
"saved": "Scene preset '{name}' saved.",
"applied": "Scene preset '{name}' applied.",
"scene-applied": "Scene changed: camera layout updated"
}
},
"presetExport": {
"title": "Export Scene Presets",
"description": "Download all scene presets as a JSON file that can be imported into another world.",
"scene": "Scene",
"presetCount": "Presets",
"filename": "Filename",
"export": "Export",
"cancel": "Cancel",
"exporting": "Exporting…",
"exportSuccess": "Scene presets exported successfully.",
"exportFailed": "Failed to export presets"
},
"presetImport": {
"title": "Import Scene Presets",
"description": "Upload a JSON file containing scene presets to add to this scene.",
"selectFile": "Select File",
"chooseFile": "Choose a JSON file…",
"importMode": "Import Mode",
"importModeMerge": "Merge",
"importModeReplace": "Replace",
"importModeMergeHint": "Add new presets, skip duplicates",
"importModeReplaceHint": "Delete all existing presets and import new ones",
"previewTitle": "Preview",
"previewWillImport": "Will import",
"previewWillSkip": "Will skip (already exists)",
"import": "Import",
"confirmReplace": "Replace All",
"cancel": "Cancel",
"importing": "Importing…",
"importFailed": "Failed to import presets",
"selectFileFirst": "Please select a file first",
"existingPresetsWarning": "This scene has {existingPresetCount} existing preset(s).",
"replaceConfirmation": "This will delete all {existingPresetCount} existing preset(s) and replace them with the imported ones. This cannot be undone."
}
},
"SCRYING_POOL": {
"ExportPresetsTitle": "Export Scene Presets",
"ExportPresetsDescription": "Download all scene presets as a JSON file that can be imported into another world.",
"Scene": "Scene",
"PresetCount": "Presets",
"Filename": "Filename",
"Export": "Export",
"Cancel": "Cancel",
"Exporting": "Exporting…",
"ExportSuccess": "Scene presets exported successfully.",
"ExportFailed": "Failed to export presets",
"ImportPresetsTitle": "Import Scene Presets",
"ImportPresetsDescription": "Upload a JSON file containing scene presets to add to this scene.",
"SelectFile": "Select File",
"ChooseFile": "Choose a JSON file…",
"ImportMode": "Import Mode",
"ImportModeMerge": "Merge",
"ImportModeReplace": "Replace",
"ImportModeMergeHint": "Add new presets, skip duplicates",
"ImportModeReplaceHint": "Delete all existing presets and import new ones",
"PreviewTitle": "Preview",
"PresetExistsWillBeSkipped": "Already exists - will be skipped",
"Import": "Import",
"ConfirmReplace": "Replace All",
"Importing": "Importing…",
"ImportFailed": "Failed to import presets",
"SelectFileFirst": "Please select a file first",
"ExistingPresetsWarning": "This scene has {existingPresetCount} existing preset(s).",
"ReplaceConfirmation": "This will delete all {existingPresetCount} existing preset(s) and replace them with the imported ones. This cannot be undone.",
"UnknownScene": "Unknown Scene",
"firstBadgeEncounter": "First Badge Encounter"
}
}