Skip to content

feat: add Clean button for debug mode to reset database and settings#17

Merged
ikorich merged 2 commits into
developfrom
feature/swiftui-modernize
Jan 3, 2026
Merged

feat: add Clean button for debug mode to reset database and settings#17
ikorich merged 2 commits into
developfrom
feature/swiftui-modernize

Conversation

@ikorich
Copy link
Copy Markdown
Member

@ikorich ikorich commented Jan 3, 2026

Summary

Adds a debug-only Clean button in the Info view that completely resets the application state for testing purposes. This button allows developers to quickly clear all stored incidents and reset settings to defaults during debugging.

Changes

  • DatabaseManager: Added cleanAll() method to clear all stored incidents
  • AppSettings: Added resetToDefaults() method to reset all settings to their default values
  • ThiefManager: Added cleanAll() method that coordinates database clearing and settings reset
  • InfoViewModel: Added cleanTitle() and cleanAll() methods to drive the UI
  • InfoViews: Added Clean button inside debug-only block (visible when isImageCaptureDebug is true)
  • Test Files: Updated view model tests to match modernized @Observable architecture

Testing

All 115 tests pass. The Clean button is only visible in debug builds.

Adds a debug-only Clean button in the Info view that allows complete reset of:
- Database (all stored incidents)
- App Settings (reset to defaults)
- Trigger monitoring (restarted after reset)

Implements cleanAll() across DatabaseManager, AppSettings, and ThiefManager.
Fixes test files to match modernized ViewModel architecture (@observable).
Sets isImageCaptureDebug to false to hide debug buttons in release builds.
@ikorich ikorich merged commit a586d8d into develop Jan 3, 2026
@ikorich ikorich deleted the feature/swiftui-modernize branch January 3, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant