Update Neon colors and show color circles in theme picker
- Update NeonMoodTint to use synthwave colors matching Neon voting style (cyan, lime, yellow, orange, magenta) - Replace text label with 5 color circles in theme preview Colors row - Remove unused textColor customization code and picker views - Add .id(moodTint) to Month/Year views for color refresh - Clean up various unused color-related code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,9 +10,12 @@ import Foundation
|
||||
|
||||
extension DataController {
|
||||
func add(mood: Mood, forDate date: Date, entryType: EntryType) {
|
||||
// Delete existing entry for this date if present
|
||||
if let existing = getEntry(byDate: date) {
|
||||
modelContext.delete(existing)
|
||||
// Delete ALL existing entries for this date (handles duplicates)
|
||||
let existing = getAllEntries(byDate: date)
|
||||
for entry in existing {
|
||||
modelContext.delete(entry)
|
||||
}
|
||||
if !existing.isEmpty {
|
||||
try? modelContext.save()
|
||||
}
|
||||
|
||||
@@ -50,15 +53,23 @@ extension DataController {
|
||||
|
||||
let missing = Array(Set(allDates).subtracting(existingDates)).sorted(by: >)
|
||||
|
||||
guard !missing.isEmpty else { return }
|
||||
|
||||
// Batch insert all missing dates without triggering listeners
|
||||
for date in missing {
|
||||
// Add 12 hours to avoid UTC offset issues
|
||||
let adjustedDate = Calendar.current.date(byAdding: .hour, value: 12, to: date)!
|
||||
add(mood: .missing, forDate: adjustedDate, entryType: .filledInMissing)
|
||||
let entry = MoodEntryModel(
|
||||
forDate: adjustedDate,
|
||||
mood: .missing,
|
||||
entryType: .filledInMissing
|
||||
)
|
||||
modelContext.insert(entry)
|
||||
}
|
||||
|
||||
if !missing.isEmpty {
|
||||
EventLogger.log(event: "filled_in_missing_entries", withData: ["count": missing.count])
|
||||
}
|
||||
// Single save and listener notification at the end
|
||||
saveAndRunDataListeners()
|
||||
EventLogger.log(event: "filled_in_missing_entries", withData: ["count": missing.count])
|
||||
}
|
||||
|
||||
func fixWrongWeekdays() {
|
||||
|
||||
Reference in New Issue
Block a user