Add premium features and reorganize Settings tab
Premium Features: - Journal notes and photo attachments for mood entries - Data export (CSV and PDF reports) - Privacy lock with Face ID/Touch ID - Apple Health integration for mood correlation - 4 new personality packs (Motivational Coach, Zen Master, Best Friend, Data Analyst) Settings Tab Reorganization: - Combined Customize and Settings into single tab with segmented control - Added upgrade banner with trial countdown above segment - "Why Upgrade?" sheet showing all premium benefits - Subscribe button opens improved StoreKit 2 subscription view UI Improvements: - Enhanced subscription store with feature highlights - Entry detail view for viewing/editing notes and photos - Removed duplicate subscription banners from tab content 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,16 @@ struct MoodDataSummary {
|
||||
// Notable observations
|
||||
let hasAllMoodTypes: Bool
|
||||
let missingMoodTypes: [String]
|
||||
|
||||
// Health correlations (optional)
|
||||
let healthCorrelations: [HealthCorrelation]
|
||||
}
|
||||
|
||||
/// Health correlation data for AI insights
|
||||
struct HealthCorrelation {
|
||||
let metric: String
|
||||
let insight: String
|
||||
let correlation: String // "positive", "negative", or "none"
|
||||
}
|
||||
|
||||
/// Transforms raw MoodEntryModel data into AI-optimized summaries
|
||||
@@ -59,7 +69,7 @@ class MoodDataSummarizer {
|
||||
|
||||
// MARK: - Main Summarization
|
||||
|
||||
func summarize(entries: [MoodEntryModel], periodName: String) -> MoodDataSummary {
|
||||
func summarize(entries: [MoodEntryModel], periodName: String, healthCorrelations: [HealthCorrelation] = []) -> MoodDataSummary {
|
||||
let validEntries = entries.filter { ![.missing, .placeholder].contains($0.mood) }
|
||||
|
||||
guard !validEntries.isEmpty else {
|
||||
@@ -103,7 +113,8 @@ class MoodDataSummarizer {
|
||||
last7DaysAverage: recentContext.average,
|
||||
last7DaysMoods: recentContext.moods,
|
||||
hasAllMoodTypes: moodTypes.hasAll,
|
||||
missingMoodTypes: moodTypes.missing
|
||||
missingMoodTypes: moodTypes.missing,
|
||||
healthCorrelations: healthCorrelations
|
||||
)
|
||||
}
|
||||
|
||||
@@ -379,7 +390,8 @@ class MoodDataSummarizer {
|
||||
last7DaysAverage: 0,
|
||||
last7DaysMoods: [],
|
||||
hasAllMoodTypes: false,
|
||||
missingMoodTypes: ["great", "good", "average", "bad", "horrible"]
|
||||
missingMoodTypes: ["great", "good", "average", "bad", "horrible"],
|
||||
healthCorrelations: []
|
||||
)
|
||||
}
|
||||
|
||||
@@ -411,6 +423,14 @@ class MoodDataSummarizer {
|
||||
// Stability
|
||||
lines.append("Stability: \(String(format: "%.0f", summary.moodStabilityScore * 100))%, Mood swings: \(summary.moodSwingCount)")
|
||||
|
||||
// Health correlations (if available)
|
||||
if !summary.healthCorrelations.isEmpty {
|
||||
lines.append("Health correlations:")
|
||||
for correlation in summary.healthCorrelations {
|
||||
lines.append("- \(correlation.metric): \(correlation.insight)")
|
||||
}
|
||||
}
|
||||
|
||||
return lines.joined(separator: "\n")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user