Replace TipKit with custom themed tips modal system

- Add TipModalView with gradient header, themed styling, and spring animations
- Create FeelsTipsManager with global toggle, session tracking, and persistence
- Define FeelsTip protocol and convert all 7 tips to new system
- Add convenience view modifiers (.customizeLayoutTip(), .aiInsightsTip(), etc.)
- Remove TipKit dependency from all views
- Add Tips Preview debug screen in Settings to test all tip modals
- Update documentation for new custom tips system

🤖 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:33:36 -06:00
parent e98142c72e
commit c59f215535
11 changed files with 809 additions and 222 deletions

View File

@@ -109,38 +109,42 @@ This document covers the new Apple-specific features integrated into Feels, incl
---
## 4. TipKit
## 4. Custom Tips System
**File:** `Shared/FeelsTips.swift`
**Files:**
- `Shared/FeelsTips.swift` (Tips definitions and manager)
- `Shared/Views/TipModalView.swift` (Modal UI)
**What it does:** Shows contextual tips to help users discover features throughout the app.
**What it does:** Shows themed modal tips to help users discover features throughout the app. Tips appear as beautiful sheets that match the app's current theme.
### Available Tips
| Tip | Location | Trigger |
|-----|----------|---------|
| CustomizeLayoutTip | Customize screen | First visit |
| AIInsightsTip | Insights tab | After 7 days of data |
| AIInsightsTip | Insights tab | After 7 moods logged |
| SiriShortcutTip | Settings | After 3 mood logs |
| HealthKitSyncTip | Settings | After 5 mood logs |
| WidgetVotingTip | Day view | After first mood log |
| TimeViewTip | Day view header | After 2 days usage |
| HealthKitSyncTip | Settings | After viewing settings |
| WidgetVotingTip | Day view | After 2 days usage |
| TimeViewTip | Day view | First visit |
| MoodStreakTip | Day view | When streak >= 3 |
### How to Test
1. Tips appear automatically based on conditions
2. To reset tips for testing, add this code temporarily:
1. Tips appear automatically based on conditions (one per session)
2. To reset tips for testing:
```swift
try? Tips.resetDatastore()
FeelsTipsManager.shared.resetAllTips()
```
3. To disable tips globally:
```swift
FeelsTipsManager.shared.tipsEnabled = false
```
3. Or use the Tips debug menu in Xcode:
- Edit Scheme > Run > Arguments
- Add: `-com.apple.TipKit.DisplayFrequency weekly`
### Implementation Details
- `TipsManager.shared.configure()` called in `FeelsApp.init()`
- Each tip has rules based on `@Parameter` events and conditions
- Tips automatically dismiss after user interaction
- `FeelsTipsManager.shared.resetSession()` called in `FeelsApp.init()`
- Each tip has `isEligible` property based on user activity parameters
- Tips show as themed modal sheets with gradient headers
- Only one tip shown per app session
---