Skip to content

Implement conflict resolution UI for concurrent edits - #1231

Merged
malibio merged 2 commits into
mainfrom
worktree-issue-642-conflict-resolution-ui
May 29, 2026
Merged

malibio merged 2 commits into
mainfrom
worktree-issue-642-conflict-resolution-ui

Conversation

@malibio

@malibio malibio commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #642

Michael Libio and others added 2 commits May 29, 2026 23:29
When SharedNodeStore detects a concurrent-edit conflict via its
Last-Write-Wins resolver, the losing pane now shows a brief toast:
"Your edit was overwritten by another pane". The toast auto-dismisses
after 4 seconds and can be manually closed.

- conflict-notifications.svelte.ts: rune-based singleton store for
  pending conflict notifications (add/dismiss/dismissAll)
- conflict-toast.svelte: fixed-position overlay toast component rendered
  in app-shell; uses CSS animation and var(--color-*) design tokens
- shared-node-store.svelte.ts: handleConflict() now calls
  conflictNotifications.add() after resolving via LWW
- app-shell.svelte: renders <ConflictToast /> above the status bar
- 10 new tests: store unit tests + SharedNodeStore integration tests

Co-Authored-By: Claude <[email protected]>
- conflict-notifications: cap at 10 entries (drop oldest on overflow),
  capture single Date.now() for id + createdAt
- shared-node-store: replace hardcoded message with CONFLICT_MESSAGE map
  keyed on conflictType; distinct messages for concurrent-edit,
  version-mismatch, and deleted-node
- conflict-toast: add orphaned-timer cleanup sweep in $effect; fix ⚠️
  emoji variant selector; add prefers-reduced-motion guard
- tests: add overflow cap test; make conflictCount metric assertion
  unconditional (was silently skippable if detection regressed)

Co-Authored-By: Claude <[email protected]>
@malibio
malibio force-pushed the worktree-issue-642-conflict-resolution-ui branch from 8efb9d0 to 56aeb0b Compare May 29, 2026 21:29
@malibio

malibio commented May 29, 2026

Copy link
Copy Markdown
Collaborator Author

Review Feedback Addressed

All 7 findings from the pragmatic code review have been addressed in commit 56aeb0b.

Changes Made

Finding Status Change
Unbounded notification accumulation ✅ Fixed Cap at 10; oldest dropped on overflow
Orphaned timer cleanup in $effect ✅ Fixed Added active-ID sweep before scheduling
Hardcoded conflict message ✅ Fixed CONFLICT_MESSAGE map keyed on conflictType
Two Date.now() calls per entry ✅ Fixed Single const now = Date.now()
Conditional metric assertion ✅ Fixed Unconditional expect(notifications.length).toBeGreaterThanOrEqual(1) first
⚠ emoji variant ✅ Fixed Changed to ⚠️
No prefers-reduced-motion guard ✅ Fixed Added @media (prefers-reduced-motion: reduce) block

Also added a test for the overflow cap behaviour (11th notification drops the oldest).

Tests: 131 files, 3924 tests — all passing.
Quality: 0 errors, 0 warnings.
Branch: rebased onto origin/main.

@malibio
malibio merged commit 73c0c40 into main May 29, 2026
@malibio
malibio deleted the worktree-issue-642-conflict-resolution-ui branch May 29, 2026 21:33
malibio added a commit that referenced this pull request Jun 22, 2026
* Implement conflict resolution UI with toast notifications (closes #642)

When SharedNodeStore detects a concurrent-edit conflict via its
Last-Write-Wins resolver, the losing pane now shows a brief toast:
"Your edit was overwritten by another pane". The toast auto-dismisses
after 4 seconds and can be manually closed.

- conflict-notifications.svelte.ts: rune-based singleton store for
  pending conflict notifications (add/dismiss/dismissAll)
- conflict-toast.svelte: fixed-position overlay toast component rendered
  in app-shell; uses CSS animation and var(--color-*) design tokens
- shared-node-store.svelte.ts: handleConflict() now calls
  conflictNotifications.add() after resolving via LWW
- app-shell.svelte: renders <ConflictToast /> above the status bar
- 10 new tests: store unit tests + SharedNodeStore integration tests

Co-Authored-By: Claude <[email protected]>

* Address code review feedback for conflict resolution UI

- conflict-notifications: cap at 10 entries (drop oldest on overflow),
  capture single Date.now() for id + createdAt
- shared-node-store: replace hardcoded message with CONFLICT_MESSAGE map
  keyed on conflictType; distinct messages for concurrent-edit,
  version-mismatch, and deleted-node
- conflict-toast: add orphaned-timer cleanup sweep in $effect; fix ⚠️
  emoji variant selector; add prefers-reduced-motion guard
- tests: add overflow cap test; make conflictCount metric assertion
  unconditional (was silently skippable if detection regressed)

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Michael Libio <[email protected]>
Co-authored-by: Claude <[email protected]>
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.

Implement conflict resolution UI for concurrent edits

1 participant