feat: in-app dark mode toggle (System / Light / Dark)
All checks were successful
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 4s

- AppearanceManager with UserDefaults persistence
- Three modes: System (follows iOS), Light, Dark
- Toggle in Home screen profile menu under "Appearance"
- Applied via .preferredColorScheme at app root
- Persists across app launches

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 20:22:35 -05:00
parent da44ee8b73
commit 028e308588
4 changed files with 63 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import PhotosUI
struct HomeView: View {
@Environment(AuthManager.self) private var auth
@Environment(AppearanceManager.self) private var appearance
@State private var vm = HomeViewModel()
@State private var ringAnimated = false
@Binding var selectedTab: Int
@@ -50,6 +51,18 @@ struct HomeView: View {
}
}
Divider()
Menu {
ForEach(AppearanceManager.Mode.allCases, id: \.self) { mode in
Button {
appearance.mode = mode
} label: {
Label(mode.label, systemImage: mode.icon)
}
}
} label: {
Label("Appearance", systemImage: appearance.mode.icon)
}
Divider()
Button(role: .destructive) {
Task { await auth.logout() }
} label: {