KDChat/KDChat
Blake Oliver 8a39e5939f
Add swiftData message persistence and reactive side effects
Persistence:
- SavedMessage SwiftData model with index on [buffer, timestamp]
- @Query in ChatBufferView/DMListView/DMConversationView — SwiftData is the single source of truth, no in-memory dictionary
- Settings: Save Messages toggle, Save Debug Buffer toggle, Delete After picker (1d/1w/1m/1y/never), Delete All with confirmation dialog
- Expired and debug messages purged on launch based on settings
- Say messages go to debug buffer only (not all buffers)

Reactive side effects:
- Sound, haptic, and VoiceOver announcement all fire from ChatBufferView's onChange(of: messages.count)
- Sound plays for active buffer or background buffers if enabled
- Haptic and announcement fire on active buffer only, current session only (I'll add a toggle to announce other buffers next)
- Status haptic for Say messages stays imperative in model (global event, not per-buffer)
- Removed trigger counters and lastAnnouncement from ConnectionManager

DM conversation fix:
- Track DM recipient via lastDMRecipientId; tag outgoing echoes with partner ID in characterId
- Conversation view filters on characterId == partnerId (shows only that conversation)

Other:
- modelContext set in ContentView.onAppear (available for all screens)
- Instant scroll (no animation), respects Reduce Motion
2026-04-05 18:46:38 -06:00
..
Assets.xcassets Character switching, entity ID capture, and UI fixes 2026-04-05 09:11:02 -06:00
Models Add swiftData message persistence and reactive side effects 2026-04-05 18:46:38 -06:00
Networking Character switching, entity ID capture, and UI fixes 2026-04-05 09:11:02 -06:00
Services Add swiftData message persistence and reactive side effects 2026-04-05 18:46:38 -06:00
Sounds Chat sounds, message card UI, own-message detection, and crash fix 2026-04-05 08:15:31 -06:00
Views Add swiftData message persistence and reactive side effects 2026-04-05 18:46:38 -06:00
AppInfo.swift Initial commit of KDChat 2026-04-05 07:11:07 -06:00
ContentView.swift Add swiftData message persistence and reactive side effects 2026-04-05 18:46:38 -06:00
KDChatApp.swift Add swiftData message persistence and reactive side effects 2026-04-05 18:46:38 -06:00