Commit Graph

16 Commits

Author SHA1 Message Date
uberwald 7b56d62563 Fianlize deck strip and management
CI / ci (push) Failing after 6s
2026-05-25 00:51:46 +02:00
uberwald 5dc9b3b8d4 Module cleanup and tests
CI / ci (push) Failing after 7s
2026-05-24 23:13:45 +02:00
uberwald 5b421d6d49 Fix DirectorsBoard position loading error
- Fixed TypeError: Cannot assign to read only property 'position' of object
- Changed _loadPosition() to use Object.assign() instead of direct assignment
- Added null check for this.options?.position to handle both Foundry and test environments
- Updated fallback _AppBase class to store options in constructor for test compatibility
- Added comprehensive tests for _loadPosition() method

The error occurred because in FoundryVTT v14, ApplicationV2 freezes the options object,
making direct assignment to this.options.position impossible. Using Object.assign()
merges the properties instead, which works with both frozen and unfrozen objects.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 13:50:46 +02:00
uberwald 25dd427a59 Update tests for Story 5-1 Full AV Replacement
- Mark Story 5-1 as done in sprint-status.yaml
- Update FoundryAdapter.test.js:
  - Updated probeCapability tests to expect 'stream-access' (was 'css-fallback')
  - Added tests for all 11 new buildWebRTCSurface methods
  - Added input validation tests for userId-taking methods
- Update ScryingPoolStrip.test.js:
  - Added tests for hasStreamAccess flag in buildParticipantList
  - Added tests for hasStreamAccess in getData()
  - Added tests for _attachVideoStream() method
  - Added tests for _cleanupVideoStreams() method

All 892 unit tests passing + 7 integration tests passing

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 12:36:52 +02:00
uberwald 6d7a0b5fd7 Now manage to replace the Foundry native AV dock
CI / ci (push) Failing after 16s
2026-05-24 09:39:53 +02:00
uberwald 20d13fc678 Story 4.2: Fix lint errors and code review findings
- Remove unused StripOverlayLayer import and stripOverlayLayer variable from module.js
- Add comprehensive JSDoc annotations to FoundryAdapter.js methods (settings, socket, users, scenes, notifications, hooks)
- Add /* global Dialog */ comment to PlayerPrivacyPanel.js for ESLint
- Remove unused _force parameter from GMPlayerPrivacySelector.js render() method
- Fix PlayerPrivacyPanelMenu.js: add constructor() to fallback class and call super()

All 862 unit tests passing. All Story 4.2 acceptance criteria met.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-24 01:25:30 +02:00
uberwald 2d898f6818 First round of test 2026-05-24 01:07:39 +02:00
uberwald 56eeb7cc83 Story 4.2 completed 2026-05-24 00:37:21 +02:00
uberwald de1b33c453 Story 4.1 completed 2026-05-23 23:00:07 +02:00
uberwald fd0a7868f3 Story 4.1: Tasks 3-6 Complete - Director's Board Integration & Settings Menu
- Task 3: Extended FoundryAdapter with user flag access methods
  - Added getFlag(userId, scope, key) method
  - Added setFlag(userId, scope, key, value) method
  - Added getFlagModule(userId, key) convenience method
  - Added setFlagModule(userId, key, value) convenience method

- Task 4: Integrated Privacy Settings with Director's Board
  - Updated participant-card.hbs to show Reaction Cam badge
  - Modified boardUtils.js to pass playerPrivacyManager through context
  - Updated DirectorsBoard to accept and pass playerPrivacyManager
  - Added CSS styles for Reaction Cam badge (SP accent color)

- Task 5: Registered PlayerPrivacyPanel in module settings
  - Added settings menu registration in module.js Hooks.once('ready')
  - Available to all users (restricted: false)
  - Uses localized labels and hints

- Task 6: Added all localization strings
  - Added SCRYING_POOL.PrivacyPanel.* strings for panel UI
  - Added SCRYING_POOL.Settings.* strings for settings menu

- Updated story file with task completion status

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-05-23 21:29:58 +02:00
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 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 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 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