-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/conversation merge improved #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Frontend: - Multi-select merge UI with selection mode and bottom action bar - Conversation list updates for selection indicators and guarded taps - Provider support for mergeSelectedConversations with API integration - Analytics tracking for conversationsMerged event Backend: - MergeConversationsRequest model and POST /v1/conversations/merge endpoint - DB helper merge_conversations with validation and LLM structuring - Merges segments, photos, events, action items, and audio files
…nd UX - Move selection state to ConversationProvider for better state management - Implement true adjacency validation: contiguous list position + 1-hour time gap - Add tap-to-deselect functionality for selected conversations - Block long-press selection for locked/discarded conversations - Disable swipe-to-delete during selection mode - Add canMergeSelectedConversations() validation method - Improve merge error messages with specific validation feedback - Add Mixpanel analytics tracking for merge operations - Keep selection mode active until explicit cancel (no auto-exit on empty) - Proper state cleanup on merge success/failure
…earch guards Complete implementation of conversation merge feature with all UX improvements: Selection Mode: - Long-press enters selection with locked/discarded guards - Tap to toggle selection (fast deselect for already-selected items) - Swipe-to-delete disabled during selection mode - 50% opacity for locked/discarded conversations (visual feedback) - Checkbox indicators show selection state - Purple border highlights selected conversations Merge Bar UX: - Positioned above bottom navigation using Stack + Positioned (bottom: 90) - Shows selection count and Cancel/Merge buttons - Merge button enabled only when canMergeSelectedConversations() passes - Inline spinner during merge (no blocking dialog) - Success toast (green) on successful merge - Error toast (red) with specific validation messages Validation & Safety: - True adjacency: contiguous list position + ≤1-hour time gaps - Locked/discarded conversations blocked from selection and merge - Search automatically clears selection to prevent stale state - Selection cleared after successful merge - No count cap on merge (unlimited adjacent conversations) Analytics: - Track merge initiated, successful, and failed events - Include conversation count and IDs in tracking Backend Integration: - mergeConversations API call with sorted conversation IDs - Error message extraction from backend responses - Local state updates after successful merge
The delete_vector function signature is delete_vector(uid, conversation_id) and it deletes
the Pinecone vector using the prefixed ID format: f'{uid}-{conversation_id}'.
Updated the merge endpoint to correctly call delete_vector(uid, conv_id) matching the
function signature and ensuring vectors are properly deleted with the correct ID prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements a conversation merge feature that allows users to combine multiple consecutive conversations into a single conversation. The feature includes both backend API endpoints and frontend UI components with validation to ensure only chronologically adjacent conversations can be merged.
- Backend API endpoint (
/v1/conversations/merge) that validates, merges, and regenerates metadata for conversations using LLM - Frontend selection mode UI that allows users to select and merge conversations with visual feedback
- Analytics tracking for merge operations and validation to prevent merging locked or discarded conversations
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/routers/conversations.py | Adds merge endpoint and updates delete_conversation to pass uid to delete_vector |
| backend/models/conversation.py | Adds MergeConversationsRequest model for API request validation |
| backend/database/conversations.py | Implements merge_conversations function with validation logic for consecutive conversations |
| app/pubspec.yaml | Removes deprecated Swift package manager configuration |
| app/lib/utils/analytics/mixpanel.dart | Adds conversationsMerged analytics tracking method |
| app/lib/providers/conversation_provider.dart | Implements selection mode state management and merge logic with validation |
| app/lib/pages/conversations/widgets/conversations_group_widget.dart | Updates widget to support selection mode with callbacks |
| app/lib/pages/conversations/widgets/conversation_list_item.dart | Adds selection mode UI with checkboxes and long-press handling |
| app/lib/pages/conversations/conversations_page.dart | Adds merge action bar UI overlay when in selection mode |
| app/lib/backend/http/api/conversations.dart | Adds mergeConversations API client method with error handling |
Comments suppressed due to low confidence (2)
backend/routers/conversations.py:143
- Call to function delete_vector with too many arguments; should be no more than 1.
delete_vector(uid, conversation_id)
backend/routers/conversations.py:696
- Call to function delete_vector with too many arguments; should be no more than 1.
delete_vector(uid, conv_id)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* feat: Add conversation merging functionality
Frontend:
- Multi-select merge UI with selection mode and bottom action bar
- Conversation list updates for selection indicators and guarded taps
- Provider support for mergeSelectedConversations with API integration
- Analytics tracking for conversationsMerged event
Backend:
- MergeConversationsRequest model and POST /v1/conversations/merge endpoint
- DB helper merge_conversations with validation and LLM structuring
- Merges segments, photos, events, action items, and audio files
* fix: remove invalid config section from pubspec.yaml
* feat: enhance conversation merge with improved adjacency validation and UX
- Move selection state to ConversationProvider for better state management
- Implement true adjacency validation: contiguous list position + 1-hour time gap
- Add tap-to-deselect functionality for selected conversations
- Block long-press selection for locked/discarded conversations
- Disable swipe-to-delete during selection mode
- Add canMergeSelectedConversations() validation method
- Improve merge error messages with specific validation feedback
- Add Mixpanel analytics tracking for merge operations
- Keep selection mode active until explicit cancel (no auto-exit on empty)
- Proper state cleanup on merge success/failure
* feat: complete conversation merge UX with Stack-based merge bar and search guards
Complete implementation of conversation merge feature with all UX improvements:
Selection Mode:
- Long-press enters selection with locked/discarded guards
- Tap to toggle selection (fast deselect for already-selected items)
- Swipe-to-delete disabled during selection mode
- 50% opacity for locked/discarded conversations (visual feedback)
- Checkbox indicators show selection state
- Purple border highlights selected conversations
Merge Bar UX:
- Positioned above bottom navigation using Stack + Positioned (bottom: 90)
- Shows selection count and Cancel/Merge buttons
- Merge button enabled only when canMergeSelectedConversations() passes
- Inline spinner during merge (no blocking dialog)
- Success toast (green) on successful merge
- Error toast (red) with specific validation messages
Validation & Safety:
- True adjacency: contiguous list position + ≤1-hour time gaps
- Locked/discarded conversations blocked from selection and merge
- Search automatically clears selection to prevent stale state
- Selection cleared after successful merge
- No count cap on merge (unlimited adjacent conversations)
Analytics:
- Track merge initiated, successful, and failed events
- Include conversation count and IDs in tracking
Backend Integration:
- mergeConversations API call with sorted conversation IDs
- Error message extraction from backend responses
- Local state updates after successful merge
* fix: correct delete_vector calls to pass both uid and conversation_id
The delete_vector function signature is delete_vector(uid, conversation_id) and it deletes
the Pinecone vector using the prefixed ID format: f'{uid}-{conversation_id}'.
Updated the merge endpoint to correctly call delete_vector(uid, conv_id) matching the
function signature and ensuring vectors are properly deleted with the correct ID prefix.
* Update backend/database/conversations.py
Note
Implements merging consecutive conversations with a new multi-select UI on the conversations page and a backend POST endpoint that validates, merges data, runs LLM structuring, and deletes originals.
locked/discardeditems; visual selection state and checkbox overlay.mergeConversations()API.Scaffoldwith overlayed selection toolbar.POST /v1/conversations/mergeacceptingMergeConversationsRequest:delete_vector(uid, id)).merge_conversationsin DB layer andMergeConversationsRequestmodel.uidin delete route.Written by Cursor Bugbot for commit 9a800a9. This will update automatically on new commits. Configure here.