Commit Graph

17 Commits

Author SHA1 Message Date
uberwald 61f362004e Story 4.1: Task 1 Complete - PlayerPrivacyManager Core Logic
- Created src/contracts/privacy-settings.js with:
  - PrivacySettings typedef
  - PRIVACY_SETTINGS_DEFAULT (both flags false)
  - PRIVACY_SETTING_KEYS and FEATURE_NAME_MAP constants
  - createPrivacySettings() factory
  - isValidPrivacySettings() validator
  - validateSettingKey(), validateSettingValue(), validateFeatureName() helpers
- Created src/core/PlayerPrivacyManager.js with:
  - Constructor with FoundryAdapter DI validation
  - getSettings(userId) - retrieves settings from user flags
  - setSetting(userId, key, value) - async, validates, persists via user.setFlag
  - isOptedIn(userId, feature) - convenience method for feature checks
  - getAllSettings() - aggregates all users' settings (GM view)
  - onChange(callback) - subscription pattern for change events
  - teardown() - cleanup
- Created tests/unit/contracts/privacy-settings.test.js - 44 tests
- Created tests/unit/core/PlayerPrivacyManager.test.js - 35 tests
- All tests passing, lint clean
- Updated sprint-status.yaml: 4-1 from ready-for-dev to in-progress
- Updated story file: Task 1 subtasks 1.1-1.8 marked complete

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 21:11:55 +02:00
uberwald e81c05a3db Create Story 4.1: Player Privacy Panel & Automation Opt-ins
- Created comprehensive story file with 8 acceptance criteria from FR-23, FR-24, FR-25
- Documented PlayerPrivacyManager core logic with DI pattern
- Designed PlayerPrivacyPanel UI component extending ApplicationV2
- Added FoundryAdapter user flag access methods specification
- Integrated Reaction Cam badge into Director's Board design
- Defined all localization strings
- Mapped file structure (new and modified files)
- Specified testing requirements (12-15 new tests)
- Updated sprint-status.yaml: 4-1 from backlog to ready-for-dev, epic-4 to in-progress
- Resolved OQ-GDPR: using user flags for v1.0

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 21:02:43 +02:00
uberwald 972e456759 Epic 3 finished 2026-05-23 19:31:35 +02:00
uberwald f126793daf Update Epic 3 status to done - all stories complete
- Updated epic-3 status from in-progress to done
- All stories in Epic 3 are now done:
  - 3-1-save-and-load-scene-presets: done
  - 3-2-scene-auto-apply-and-confirmationbar: done
  - 3-3-preset-import-and-export: done

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 19:06:57 +02:00
uberwald 6a55d4f1e1 Fix sprint tracking: Story 3.1 was already implemented
- Updated sprint-status.yaml: 3-1-save-and-load-scene-presets → done
- Updated Story 3.1 file header: Status → done
- Updated last_updated timestamp

Note: Story 3.1 (Save & Load Scene Presets) was implemented as part of
commit a1e8886 (Story 3.2 done) which created ScenePresetManager,
PresetSaveDialog, PresetLoadDialog, and related tests.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 19:06:31 +02:00
uberwald 45fbb9da00 Update Story 3.3 status to done after code review fixes
- Updated sprint-status.yaml: 3-3-preset-import-and-export → done
- Updated story file header: Status → done
- Updated last_updated timestamp

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 18:59:59 +02:00
uberwald ea2c2ea093 Fix code review findings for Story 3.3: Preset Import & Export
Security & Quality Improvements:
- Fix XSS vulnerabilities in PresetImportDialog, PresetExportDialog, and templates
- Add resource leak protection in downloadExportFile() with try/finally
- Fix encapsulation violation by using public API instead of _presetsCache
- Add rollback mechanism for partial failures in replace mode
- Add preset name validation (length, characters, empty check)
- Add duplicate name detection within import files
- Add file size validation (5MB limit) and type validation
- Fix event listener leaks with proper cleanup in _onRender/_onClose
- Add constructor parameter validation for all dialogs

Acceptance Criteria Compliance:
- Fix AC-2: Export filename now uses world name (via parent.name)
- Fix AC-6: Error message matches spec exactly ('Import failed: invalid JSON format')
- Fix AC-8: Merge/Replace messages match spec format

Code Quality:
- Add shared HTML escaping utilities (src/utils/html.js)
- Consolidate duplicate localization strings (removed 28 duplicates from SCRYING_POOL)
- Use SCENE_PRESET_VERSION constant instead of hardcoded 1
- Handle null options in importPresets()
- Graceful handling of skipValidation with invalid data

Test Results: 679 passed, 3 failed (pre-existing in DirectorsBoard)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 18:58:34 +02:00
uberwald a1e8886fce Story 3.2 done 2026-05-23 18:23:48 +02:00
uberwald d175f92806 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>
2026-05-23 16:28:53 +02:00
uberwald e31badf865 Create Story 3.3: Preset Import & Export
- Add comprehensive story file for preset import/export functionality
- Update sprint status: 3-3-preset-import-and-export → ready-for-dev
- Story covers FR-19: Preset import/export as JSON
- Includes 9 acceptance criteria, tasks, and developer context

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 15:57:44 +02:00
uberwald dc63148b80 Create Story 3.2: Scene Auto-Apply & ConfirmationBar
- Created comprehensive story file for Scene Auto-Apply & ConfirmationBar
- Added detailed acceptance criteria covering FR-17 and FR-18
- Included exhaustive developer context with previous story intelligence
- Specified architecture compliance, file structure, and testing requirements
- Updated sprint-status.yaml to mark 3-2 as ready-for-dev

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 15:10:55 +02:00
uberwald 25b98ce64a Mark Story 2.3 code review as done
- Update deferred-work.md: mark ParticipantCard.js issue as resolved
- Update sprint-status.yaml: add code review completion date

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 11:43:05 +02:00
uberwald cc5b04d902 Update sprint status: Story 2.3 code review completed and merged
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 11:37:16 +02:00
uberwald 7918792f4e Fix Story 2.3 code review findings: remove duplicate ParticipantCard.js, fix lint in ScryingPoolStrip.js
- Delete src/ui/shared/ParticipantCard.js (duplicate of boardUtils.js with conflicting implementations)
- Delete tests/unit/ui/shared/ParticipantCard.test.js (tests for deleted file)
- Add directorsBoard to global declarations in ScryingPoolStrip.js to fix lint errors

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 11:31:01 +02:00
uberwald d001659e27 Update sprint status: Story 1.3 → done
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-22 13:24:06 +02:00
uberwald 5ba7717ecd Fix Story 1.3: StateStore spec compliance and minor cleanup
Critical Fix:
- StateStore now uses global Hooks.callAll directly (per spec)
- Removed hooks parameter from StateStore constructor
- Updated module.js to pass only adapter.settings
- Updated tests to stub globalThis.Hooks

Minor Cleanup:
- Fixed misleading warning in SocketHandler.registerPendingOp
- Added clarifying comment for setMatrix _revision behavior

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-22 11:38:45 +02:00
uberwald 110b295a7b CLose story 1.2 2026-05-21 23:08:34 +02:00