Fix theme selection bug and update onboarding with AppTheme picker

- Change Theme enum from Int to String raw values to fix theme selection bug
- Replace OnboardingStyle icon/color pickers with unified AppTheme grid
- Remove visible text labels from voting layouts while keeping accessibility labels (WCAG 2.1 AA compliant)
- Update widget voting views to use icons only with proper accessibility support
- Consolidate app icons to single unified icon set

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-28 00:03:34 -06:00
parent 8fab566724
commit c4e013763a
1001 changed files with 1377 additions and 6781 deletions

View File

@@ -11,12 +11,23 @@ struct ThemeConstants {
static let iconSize: CGFloat = 50
}
enum Theme: Int, CaseIterable {
case system
case iFeel
case dark
case light
enum Theme: String, CaseIterable {
case system = "system"
case iFeel = "iFeel"
case dark = "dark"
case light = "light"
// Legacy Int-based init for backwards compatibility with existing UserDefaults data
init?(legacyIntValue: Int) {
switch legacyIntValue {
case 0: self = .system
case 1: self = .iFeel
case 2: self = .dark
case 3: self = .light
default: return nil
}
}
var title: String {
switch self {
case .system:

View File

@@ -248,11 +248,29 @@ class UserDefaultsStore {
}
static func theme() -> Theme {
if let data = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.theme.rawValue) as? Int,
let model = Theme.init(rawValue: data) {
// Try String value first (new format)
if let stringValue = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.theme.rawValue) as? String,
let model = Theme(rawValue: stringValue) {
return model
} else {
return Theme.system
}
// Fall back to Int value (legacy format for existing users)
if let intValue = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.theme.rawValue) as? Int,
let model = Theme(legacyIntValue: intValue) {
// Migrate to new String format
GroupUserDefaults.groupDefaults.set(model.rawValue, forKey: UserDefaultsStore.Keys.theme.rawValue)
return model
}
return Theme.system
}
/// Call this on app launch to migrate any legacy Int-based theme values to String format
static func migrateThemeIfNeeded() {
// Check if we have an Int value stored (legacy format)
if let intValue = GroupUserDefaults.groupDefaults.object(forKey: UserDefaultsStore.Keys.theme.rawValue) as? Int,
let model = Theme(legacyIntValue: intValue) {
// Migrate to new String format
GroupUserDefaults.groupDefaults.set(model.rawValue, forKey: UserDefaultsStore.Keys.theme.rawValue)
GroupUserDefaults.groupDefaults.synchronize()
}
}