Fix memory leaks and add debug tools, remove ControlCenterTip

Memory optimization:
- Add onDisappear cleanup for repeatForever animations in LockScreenView
- Add onDisappear cleanup for animations in FeelsSubscriptionStoreView
- Add onDisappear cleanup in AddMoodHeaderView and PaywallPreviewSettingsView

Debug improvements:
- Add test data and clear data buttons to Settings (debug builds only)

TipKit changes:
- Remove ControlCenterTip (unused)
- Add TipKit-Tips.md documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-28 21:07:22 -06:00
parent c4e013763a
commit e98142c72e
9 changed files with 370 additions and 60 deletions

View File

@@ -386,6 +386,9 @@ struct CelestialMiniPreview: View {
animate = true
}
}
.onDisappear {
animate = false
}
}
private var orbColors: [Color] {
@@ -445,6 +448,9 @@ struct GardenMiniPreview: View {
bloom = true
}
}
.onDisappear {
bloom = false
}
}
}
@@ -508,6 +514,9 @@ struct NeonMiniPreview: View {
pulse = true
}
}
.onDisappear {
pulse = false
}
}
}
@@ -552,6 +561,9 @@ struct MinimalMiniPreview: View {
breathe = true
}
}
.onDisappear {
breathe = false
}
}
}
@@ -592,6 +604,9 @@ struct ZenMiniPreview: View {
breathe = true
}
}
.onDisappear {
breathe = false
}
}
}
@@ -668,6 +683,9 @@ struct MixtapeMiniPreview: View {
spin = true
}
}
.onDisappear {
spin = false
}
}
}
@@ -710,6 +728,9 @@ struct HeartfeltMiniPreview: View {
beat = true
}
}
.onDisappear {
beat = false
}
}
}
@@ -756,6 +777,9 @@ struct LuxeMiniPreview: View {
shimmer = true
}
}
.onDisappear {
shimmer = false
}
}
}
@@ -801,6 +825,9 @@ struct ForecastMiniPreview: View {
drift = true
}
}
.onDisappear {
drift = false
}
}
}
@@ -847,6 +874,9 @@ struct PlayfulMiniPreview: View {
bounce = true
}
}
.onDisappear {
bounce = false
}
}
}

View File

@@ -55,6 +55,8 @@ struct SettingsContentView: View {
trialDateButton
animationLabButton
paywallPreviewButton
addTestDataButton
clearDataButton
#endif
Spacer()
@@ -159,7 +161,6 @@ struct SettingsContentView: View {
}
.padding(.top, 20)
.padding(.horizontal, 4)
.controlCenterTip()
}
private var legalSectionHeader: some View {
@@ -331,6 +332,66 @@ struct SettingsContentView: View {
}
}
}
private var addTestDataButton: some View {
ZStack {
theme.currentTheme.secondaryBGColor
Button {
DataController.shared.populateTestData()
} label: {
HStack(spacing: 12) {
Image(systemName: "plus.square.on.square")
.font(.title2)
.foregroundColor(.green)
.frame(width: 32)
VStack(alignment: .leading, spacing: 2) {
Text("Add Test Data")
.foregroundColor(textColor)
Text("Populate with sample mood entries")
.font(.caption)
.foregroundStyle(.secondary)
}
Spacer()
}
.padding()
}
}
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
private var clearDataButton: some View {
ZStack {
theme.currentTheme.secondaryBGColor
Button {
DataController.shared.clearDB()
} label: {
HStack(spacing: 12) {
Image(systemName: "trash")
.font(.title2)
.foregroundColor(.red)
.frame(width: 32)
VStack(alignment: .leading, spacing: 2) {
Text("Clear All Data")
.foregroundColor(textColor)
Text("Delete all mood entries")
.font(.caption)
.foregroundStyle(.secondary)
}
Spacer()
}
.padding()
}
}
.fixedSize(horizontal: false, vertical: true)
.cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
}
#endif
// MARK: - Privacy Lock Toggle