Add interactive widget voting and fix warnings/bugs
Widget Features: - Add inline voting to timeline widget when no entry exists for today - Show random prompt from notification strings in voting mode - Update vote widget to use simple icon style for selection - Make stats bar full width in voted state view - Add Localizable.strings to widget extension target Bug Fixes: - Fix inverted date calculation in InsightsViewModel streak logic - Replace force unwraps with safe optional handling in widgets - Replace fatalError calls with graceful error handling - Fix CSV import safety in SettingsView Warning Fixes: - Add @retroactive to Color and Date extension conformances - Update deprecated onChange(of:perform:) to new syntax - Replace deprecated applicationIconBadgeNumber with setBadgeCount - Replace deprecated UIApplication.shared.windows API - Add @preconcurrency for Swift 6 protocol conformances - Add missing widget family cases to switch statement - Remove unused variables and #warning directives 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,6 +112,7 @@ struct SettingsView: View {
|
||||
defer { selectedFile.stopAccessingSecurityScopedResource() }
|
||||
|
||||
var rows = input.components(separatedBy: "\n")
|
||||
guard !rows.isEmpty else { return }
|
||||
rows.removeFirst()
|
||||
for row in rows {
|
||||
let stripped = row.replacingOccurrences(of: " +0000", with: "")
|
||||
@@ -119,10 +120,12 @@ struct SettingsView: View {
|
||||
if columns.count != 7 {
|
||||
continue
|
||||
}
|
||||
let forDate = dateFormatter.date(from: columns[3])!
|
||||
let moodValue = Int(columns[4])!
|
||||
guard let forDate = dateFormatter.date(from: columns[3]),
|
||||
let moodValue = Int(columns[4]) else {
|
||||
continue
|
||||
}
|
||||
let mood = Mood(rawValue: moodValue) ?? .missing
|
||||
let entryType = EntryType(rawValue: Int(columns[2])!) ?? .listView
|
||||
let entryType = EntryType(rawValue: Int(columns[2]) ?? 0) ?? .listView
|
||||
|
||||
DataController.shared.add(mood: mood, forDate: forDate, entryType: entryType)
|
||||
}
|
||||
@@ -357,7 +360,7 @@ struct SettingsView: View {
|
||||
Text(String(localized: "settings_use_cloudkit_title"))
|
||||
.foregroundColor(textColor)
|
||||
})
|
||||
.onChange(of: useCloudKit) { newValue in
|
||||
.onChange(of: useCloudKit) { _, newValue in
|
||||
EventLogger.log(event: "toggle_use_cloudkit", withData: ["value": newValue])
|
||||
}
|
||||
.padding()
|
||||
@@ -391,7 +394,7 @@ struct SettingsView: View {
|
||||
VStack {
|
||||
Toggle(String(localized: "settings_use_delete_enable"),
|
||||
isOn: $deleteEnabled)
|
||||
.onChange(of: deleteEnabled) { newValue in
|
||||
.onChange(of: deleteEnabled) { _, newValue in
|
||||
EventLogger.log(event: "toggle_can_delete", withData: ["value": newValue])
|
||||
}
|
||||
.foregroundColor(textColor)
|
||||
|
||||
Reference in New Issue
Block a user