Skip to content

feat(coach): past conversations list with swipe-to-delete and full cleanup - #149

Open
foureight84 wants to merge 1 commit into
saksham2001:mainfrom
foureight84:feat/coach-conversation-history
Open

foureight84 wants to merge 1 commit into
saksham2001:mainfrom
foureight84:feat/coach-conversation-history

Conversation

@foureight84

Copy link
Copy Markdown
Contributor

Ports Android PR #133's AI Coach conversation history improvements to iOS.

Summary

  • History list & title derivation (CoachHistoryService.swift, CoachView.swift):
    • Hides empty threads left by unused + taps and orders conversations newest-first with message counts.
    • Derives titles from the opening user message (collapsing whitespace, truncating at 60 chars, or "Photo" for image-only sends) as a single source of truth.
    • Defers inserting new CoachConversation rows until the first message is sent (activeConversationId = nil for unsent threads).
  • Swipe-to-delete & Delete All (CoachHistorySheet, CoachHistoryService.swift):
    • Adds trailing swipe-to-delete and top-leading Delete All with confirmation dialogs.
    • Removes the conversation along with its CoachMessage rows, CoachToolCall trace rows, and on-disk CoachAttachmentStore photos. Deleting the active thread starts a fresh unsent thread.
  • Mid-turn safety (CoachViewModel.swift):
    • Tracks sendingConversationId and activeTurnTask so the trace indicator only renders on the active sending thread, active turns are cancelled if their conversation is deleted mid-flight, and replies for deleted conversations are dropped instead of leaving orphaned rows.

Verification

  • xcodebuild test -project PulseLoop.xcodeproj -scheme PulseLoop -destination 'platform=iOS Simulator,name=iPhone 17' -only-testing:PulseLoopTests/CoachHistoryTests -only-testing:PulseLoopTests/CoachResponseTests -only-testing:PulseLoopTests/CoachTransparencyTests — 11/11 tests passed.

…eanup

Port Android PR saksham2001#133's Coach conversation history improvements to iOS:
- Hide empty threads and derive titles from the opening user message (or Photo for image-only sends) with message counts, newest first.
- Add swipe-to-delete and Delete All (with confirmation dialogs), deleting messages, CoachToolCall rows, and on-disk CoachAttachmentStore photos.
- Defer creating CoachConversation rows until first send instead of persisting empty threads on + taps.
- Cancel active in-flight turns on deletion and drop replies for deleted conversations instead of leaving orphaned rows.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant