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

@@ -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