Add light and dark theme support with user-selectable preferences #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds comprehensive theming support to the Dropped app, allowing users to choose between light mode, dark mode, or system preference (which follows the device's theme setting).
Changes
Core Implementation
Added a new
AppThemeenum to the data model with three options:The theme preference is persisted in the
UserDatamodel and automatically applied app-wide via a newThemeManagerclass that observes theme changes and updates the root view's color scheme.User Interface
Added a new "Appearance" section to the Settings view with an intuitive segmented picker:
Architecture
ThemeManager Class (
DroppedApp.swift)UserData Model (
Models/UserData.swift)theme: Stringfield for persistenceappTheme()for type-safe accessSettings UI (
Views/SettingsView.swift)Testing
Unit Tests (
DroppedTests/UserDataTests.swift)UI Tests (
DroppedUITests/ThemeUITests.swift)Documentation
docs/memory.mdwith architecture changesdocs/features/theming.mdwith comprehensive feature documentation including implementation details, user guide, and technical flow diagramsBackward Compatibility
Existing users automatically default to system theme, maintaining their current experience while gaining the option to customize. No data migration required.
Technical Details
Theme changes propagate through the app via:
preferredColorSchemeThis architecture ensures immediate theme application without requiring app restart while maintaining clean separation of concerns.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.