Add guided reflection flow with mood-adaptive CBT/ACT questions
Walks users through 3-4 guided questions based on mood category: positive (great/good) gets gratitude-oriented questions, neutral (average) gets exploratory questions, and negative (bad/horrible) gets empathetic questions. Stored as JSON in MoodEntryModel, integrated into PDF reports, AI summaries, and CSV export. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,6 +51,18 @@ extension DataController {
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: - Guided Reflection
|
||||
|
||||
@discardableResult
|
||||
func updateReflection(forDate date: Date, reflectionJSON: String?) -> Bool {
|
||||
guard let entry = getEntry(byDate: date) else { return false }
|
||||
entry.reflectionJSON = reflectionJSON
|
||||
saveAndRunDataListeners()
|
||||
let count = reflectionJSON.flatMap { GuidedReflection.decode(from: $0) }?.answeredCount ?? 0
|
||||
AnalyticsManager.shared.track(.reflectionCompleted(answeredCount: count))
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: - Photo
|
||||
|
||||
@discardableResult
|
||||
|
||||
Reference in New Issue
Block a user