Problem
When two users edit the same line or nearby lines in a collaborative room, the last-write-wins behavior in Firestore causes silent data loss. The user whose change arrives second overwrites the first user's work without any warning or merge opportunity.
Proposed Improvement
Add an inline diff/merge conflict resolution UI that detects when concurrent edits collide and presents both versions side-by-side for manual resolution. The feature should:
- Detect line-level edit conflicts using operational transform or last-modified timestamps
- Display a split-pane diff view inline within the editor when conflicts are detected
- Show both versions with author labels and timestamps
- Provide "Accept Mine", "Accept Theirs", and "Merge Both" actions
- Store conflict metadata temporarily until resolved
- Fall back to last-write-wins if user ignores the conflict for >60 seconds
Expected Impact
- Better user experience by preventing silent data loss
- Improved collaboration trust — users know their edits won't disappear
- Higher usability for competitive programming and hackathon scenarios
- Better long-term scalability with robust conflict resolution
Possible Implementation
- Add
ConflictDetector utility in src/utils/ comparing local vs remote document versions using diff-match-patch
- Extend
useRoom.js to track lastModifiedBy and lastModifiedAt per line range
- Create
MergeConflictPanel component with split Monaco instances showing both versions
- Add conflict state to Firestore
rooms/{roomId}/conflicts/{conflictId}
- Integrate with existing
useEditor hook to pause auto-sync during active conflict
- Write unit tests for conflict detection edge cases (same line, adjacent lines, multi-line blocks)
I'm GSSoC'26 contributor, Please assign this task to me!
Problem
When two users edit the same line or nearby lines in a collaborative room, the last-write-wins behavior in Firestore causes silent data loss. The user whose change arrives second overwrites the first user's work without any warning or merge opportunity.
Proposed Improvement
Add an inline diff/merge conflict resolution UI that detects when concurrent edits collide and presents both versions side-by-side for manual resolution. The feature should:
Expected Impact
Possible Implementation
ConflictDetectorutility insrc/utils/comparing local vs remote document versions using diff-match-patchuseRoom.jsto tracklastModifiedByandlastModifiedAtper line rangeMergeConflictPanelcomponent with split Monaco instances showing both versionsrooms/{roomId}/conflicts/{conflictId}useEditorhook to pause auto-sync during active conflictI'm GSSoC'26 contributor, Please assign this task to me!