Add Apple platform features and UX improvements
- Add HealthKit State of Mind sync for mood entries - Add Live Activity with streak display and rating time window - Add App Shortcuts/Siri integration for voice mood logging - Add TipKit hints for feature discovery - Add centralized MoodLogger for consistent side effects - Add reminder time setting in Settings with time picker - Fix duplicate notifications when changing reminder time - Fix Live Activity streak showing 0 when not yet rated today - Fix slow tap response in entry detail mood selection - Update widget timeline to refresh at rating time - Sync widgets when reminder time changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -151,9 +151,14 @@ struct EntryDetailView: View {
|
||||
@State private var showDeleteConfirmation = false
|
||||
@State private var showFullScreenPhoto = false
|
||||
@State private var selectedPhotoItem: PhotosPickerItem?
|
||||
@State private var selectedMood: Mood?
|
||||
|
||||
private var currentMood: Mood {
|
||||
selectedMood ?? entry.mood
|
||||
}
|
||||
|
||||
private var moodColor: Color {
|
||||
moodTint.color(forMood: entry.mood)
|
||||
moodTint.color(forMood: currentMood)
|
||||
}
|
||||
|
||||
private func savePhoto(_ image: UIImage) {
|
||||
@@ -267,7 +272,7 @@ struct EntryDetailView: View {
|
||||
)
|
||||
.frame(width: 60, height: 60)
|
||||
|
||||
imagePack.icon(forMood: entry.mood)
|
||||
imagePack.icon(forMood: currentMood)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 34, height: 34)
|
||||
@@ -276,7 +281,7 @@ struct EntryDetailView: View {
|
||||
.shadow(color: moodColor.opacity(0.4), radius: 8, x: 0, y: 4)
|
||||
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(entry.moodString)
|
||||
Text(currentMood.strValue)
|
||||
.font(.title3)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(moodColor)
|
||||
@@ -298,23 +303,28 @@ struct EntryDetailView: View {
|
||||
LazyVGrid(columns: Array(repeating: GridItem(.flexible(), spacing: 12), count: 5), spacing: 12) {
|
||||
ForEach(Mood.allValues) { mood in
|
||||
Button {
|
||||
// Update local state immediately for instant feedback
|
||||
withAnimation(.easeInOut(duration: 0.15)) {
|
||||
selectedMood = mood
|
||||
}
|
||||
// Then persist the change
|
||||
onMoodUpdate(mood)
|
||||
} label: {
|
||||
VStack(spacing: 6) {
|
||||
Circle()
|
||||
.fill(entry.mood == mood ? moodTint.color(forMood: mood) : Color(.systemGray5))
|
||||
.fill(currentMood == mood ? moodTint.color(forMood: mood) : Color(.systemGray5))
|
||||
.frame(width: 50, height: 50)
|
||||
.overlay(
|
||||
imagePack.icon(forMood: mood)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 28, height: 28)
|
||||
.foregroundColor(entry.mood == mood ? .white : .gray)
|
||||
.foregroundColor(currentMood == mood ? .white : .gray)
|
||||
)
|
||||
|
||||
Text(mood.strValue)
|
||||
.font(.caption2)
|
||||
.foregroundColor(entry.mood == mood ? moodTint.color(forMood: mood) : .secondary)
|
||||
.foregroundColor(currentMood == mood ? moodTint.color(forMood: mood) : .secondary)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
|
||||
Reference in New Issue
Block a user