Skip to content

Conversation

@itznex
Copy link

@itznex itznex commented Dec 1, 2025

Summary

Implements the conversation merge feature requested in #1505, allowing users to combine multiple related conversations into a single unified conversation.

  • Multi-select mode: Long-press any conversation to enter selection mode, select 2+ conversations to merge
  • Preview before merge: Review combined content before confirming the merge operation
  • Undo support: 8-second undo snackbar appears after merge with one-tap rollback
  • Merged badge: Visual indicator on merged conversations in the list
  • Full backend support: Merge validation, execution, and unmerge within 24-hour window

Demo Video

Merge.Conversations.mp4

Changes

Backend (Python)

  • backend/routers/merge_endpoints.py - REST API endpoints for merge operations
  • backend/utils/conversations/merge_utils.py - Core merge logic and validation
  • backend/database/merge_history.py - Firestore operations for merge tracking
  • backend/models/merge_history.py - Data models for merge records
  • backend/models/conversation.py - Added merge-related fields to conversation model

Frontend (Flutter/Dart)

  • app/lib/backend/http/api/merge.dart - API client for merge endpoints
  • app/lib/providers/conversation_provider.dart - State management for merge operations
  • app/lib/pages/conversations/conversations_page.dart - Multi-select UI and merge toolbar
  • app/lib/pages/conversations/widgets/conversation_list_item.dart - Selection checkboxes and merged badge

Test Plan

  • - Long-press conversation to enter multi-select mode
  • - Select 2+ conversations and tap merge button
  • -Preview dialog shows combined content
  • - Confirm merge creates unified conversation
  • - Undo snackbar appears for 8 seconds
  • - Tapping Undo restores original conversations
  • - Merged conversations show purple "Merged" badge

@itznex itznex changed the title feat: Conversation merge feature with undo support (#1505) feat: Conversation merge feature with undo support Dec 1, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a conversation merge feature, complete with backend logic, API endpoints, and frontend UI/state management. The implementation is comprehensive, covering merge preview, execution, and rollback capabilities. My review focuses on improving the robustness and data consistency of the new feature. I've identified several critical issues related to non-atomic database operations in the backend that could lead to data inconsistency, and lack of robust error handling in the frontend that could cause crashes or poor user experience. I've also included a high-severity comment on Python import practices to improve code maintainability. I've also highlighted how some of these issues relate to established repository rules regarding robust deserialization and consistent UI actions.

- Add null safety for DateTime parsing in Dart API responses
- Add firestore import for Query.DESCENDING usage
- Make merge/rollback operations atomic with Firestore batch writes
- Add error handling and return type to executeMerge
- Move imports to top of merge_utils.py per Python best practices
@aaravgarg
Copy link
Collaborator

demo doesnt show actual merging

@itznex
Copy link
Author

itznex commented Dec 2, 2025

demo doesnt show actual merging

Quick note on testing:
I’ve implemented the conversation-merge UI and tested it locally with mock/dummy data. To test with real Omi data I’d need a Firebase config (google-services.json for Android), which I don’t currently have.

Right now I can’t log in with my own Omi account when I launch the dev/debug app. If there’s a step I’m missing, I’m happy to fix that and re-record the video. Otherwise, if you can share a dev/testing config, I can run it end-to-end on real data.

I sent a similar note on Discord, but adding it here for visibility.

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.

2 participants