You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement conflict resolution UI for concurrent edits #642
Pane A: Edit node:content → version 5
Pane B: Edit node:properties → version 5
Result: One wins (depends on timing)
User in losing pane: No indication their edit was rejected
The user has no visual feedback that their changes were discarded.
Acceptance Criteria
Detect when a conflict occurs (edit rejected due to version mismatch)
Provide visual feedback to the user in the affected pane
Choose appropriate notification method (see options below)
Add tests for conflict detection and user notification
Solution Options (Choose One)
Show notification - Brief toast: "Your edit was overwritten by another pane"
Highlight conflict field - Visual indicator in pane that lost conflict
Merge strategy - Content and properties updated independently (not either-or)
User choice - Show dialog when conflict detected, let user choose
Absorbed #303 (advanced conflict resolution UI) — this is now the single conflict-resolution issue.
Architectural dependency (audit #1228, finding C5): conflict resolution is currently frontend Last-Write-Wins (shared-node-store.svelte.ts, hardcoded 5s detection window, silently discards local edits). The audit recommends moving adjudication into the daemon — return version + conflict marker in the RPC error — so this UI work should consume an authoritative daemon signal rather than extend the frontend LWW. Sequence the daemon-side change first.
Reviewed by: Principal Engineer Verdict: Approve with minor notes — this is a clean, net-positive implementation. All four acceptance criteria are satisfied, tests pass (3923/3923), and the code follows project conventions.
Overall Assessment
The implementation correctly threads the conflict signal from SharedNodeStore.handleConflict() through a rune-based singleton store to a fixed-position toast component rendered in app-shell. The architecture is intentionally minimal for this feature's scope, the separation of concerns is sound, and cleanup paths are handled correctly.
ConflictNotificationStore.add() imposes no upper bound on notifications. In a pathological scenario (e.g. rapid sync with many conflicting nodes), the array grows indefinitely until the component auto-dismisses entries after 4 seconds. For a singleton living for the application lifetime, consider capping at a reasonable maximum (e.g. 10), dropping the oldest when the cap is reached. This is not a memory leak in the traditional sense, but it avoids a visible pile-up of toasts on the screen before auto-dismiss fires.
// Suggested guard in add():if(this.notifications.length>=10){this.notifications=this.notifications.slice(1);// drop oldest}
2. conflict-toast.svelte — $effect does not clean up orphaned timer entries
The $effect calls scheduleAutoDismiss for every notification on every reactive re-run (guarded by timers.has(id)). However, if a notification is dismissed externally via conflictNotifications.dismiss(id) (not through the local dismiss() wrapper), the corresponding setTimeout handle remains in timers indefinitely — the guard if (timers.has(id)) return will prevent rescheduling but the orphaned handle will still fire and call conflictNotifications.dismiss(id) on an already-removed entry (benign but unnecessary). A cleanup pass in the $effect would make this airtight:
$effect(()=>{constactiveIds=newSet(conflictNotifications.notifications.map(n=>n.id));// Cancel timers for notifications that were removed externallyfor(const[id,t]oftimers){if(!activeIds.has(id)){clearTimeout(t);timers.delete(id);}}for(constnofconflictNotifications.notifications){scheduleAutoDismiss(n.id);}});
3. shared-node-store.svelte.ts:2318 — Hardcoded message ignores conflict type
Both concurrent-edit and version-mismatch conflicts emit the same message: "Your edit was overwritten by another pane". The version-mismatch path is triggered by external sync (remote backend divergence), which is a subtly different user scenario from a local multi-pane conflict. This is acceptable for the current scope (issue #580 notes LWW is temporary), but a small messageForType() helper would make future differentiation easier and is low effort now:
constMESSAGE: Record<ConflictNotification['conflictType'],string>={'concurrent-edit': 'Your edit was overwritten by another pane','version-mismatch': 'Your edit conflicted with a remote change','deleted-node': 'The node you edited was deleted by another pane',};
4. conflict-notifications.svelte.ts:17 — ID generation uses Date.now() twice per entry
id is built with Date.now() and entry is built with a second Date.now() call. These are virtually always the same millisecond, but using the same timestamp for both is more correct and avoids the (theoretical) edge case of a clock tick between the two calls:
The HTML entity ⚠ renders the bare Unicode warning sign without the emoji variation selector. On some platforms/fonts this looks like a thin symbol rather than the warning emoji. Using the literal ⚠️ (or ⚠️) gives the colored emoji appearance consistently, or use an SVG icon from the design system if one exists.
Nit: conflict-notification-integration.test.ts:131-133 — Conditional assertion weakens the test
If the conflict is not detected (e.g. conflict window logic changes), this test silently passes with zero assertions. Replace with an unconditional expect(conflictNotifications.notifications.length).toBeGreaterThanOrEqual(1) first, then assert the metric. This makes the test fail loudly on regression rather than going green with no coverage.
Nit: conflict-toast.svelte — No prefers-reduced-motion guard
The toast-in animation runs unconditionally. Users who have enabled the OS reduced-motion preference will still see the slide animation. Adding @media (prefers-reduced-motion: reduce) { .conflict-toast { animation: none; } } is a one-liner accessibility improvement.
Requirements Validation
Acceptance Criterion
Status
Detect when a conflict occurs (edit rejected due to version mismatch)
Satisfied — detectConflict covers both version-mismatch and concurrent-edit
Provide visual feedback to the user in the affected pane
Satisfied — fixed-position toast with warning border
Choose appropriate notification method
Satisfied — Option 1 (brief toast) chosen, well-suited for a non-blocking transient event
Add tests for conflict detection and user notification
Satisfied — 6 store unit tests + 4 integration tests, all passing
Summary
Ship it. The four improvements above are all low-risk follow-ups; none are blockers. The conditional assertion in the metrics test (Nit #2) is the highest-priority fix among the nits as it could mask a future regression silently. The notification cap (Improvement #1) is the most practically impactful addition for production use.
Activity
Add follow-up issue links to multi-tab investigation doc
Investigate multi-tab/pane reactivity with LIVE SELECT updates (#637)
Investigate multi-tab/pane reactivity with LIVE SELECT updates (#637)
Investigate multi-tab/pane reactivity with LIVE SELECT updates (#637)
malibio commentedon May 29, 2026
Absorbed #303 (advanced conflict resolution UI) — this is now the single conflict-resolution issue.
Architectural dependency (audit #1228, finding C5): conflict resolution is currently frontend Last-Write-Wins (
shared-node-store.svelte.ts, hardcoded 5s detection window, silently discards local edits). The audit recommends moving adjudication into the daemon — return version + conflict marker in the RPC error — so this UI work should consume an authoritative daemon signal rather than extend the frontend LWW. Sequence the daemon-side change first.malibio commentedon May 29, 2026
Frontend baseline: 129 files, 3913 tests passed
malibio commentedon May 29, 2026
Code Review — Issue #642: Conflict Resolution UI (commit 8efb9d0)
Reviewed by: Principal Engineer
Verdict: Approve with minor notes — this is a clean, net-positive implementation. All four acceptance criteria are satisfied, tests pass (3923/3923), and the code follows project conventions.
Overall Assessment
The implementation correctly threads the conflict signal from
SharedNodeStore.handleConflict()through a rune-based singleton store to a fixed-position toast component rendered inapp-shell. The architecture is intentionally minimal for this feature's scope, the separation of concerns is sound, and cleanup paths are handled correctly.Findings
Suggested Improvements
1.
conflict-notifications.svelte.ts— Unbounded notification accumulationConflictNotificationStore.add()imposes no upper bound onnotifications. In a pathological scenario (e.g. rapid sync with many conflicting nodes), the array grows indefinitely until the component auto-dismisses entries after 4 seconds. For a singleton living for the application lifetime, consider capping at a reasonable maximum (e.g. 10), dropping the oldest when the cap is reached. This is not a memory leak in the traditional sense, but it avoids a visible pile-up of toasts on the screen before auto-dismiss fires.2.
conflict-toast.svelte—$effectdoes not clean up orphaned timer entriesThe
$effectcallsscheduleAutoDismissfor every notification on every reactive re-run (guarded bytimers.has(id)). However, if a notification is dismissed externally viaconflictNotifications.dismiss(id)(not through the localdismiss()wrapper), the correspondingsetTimeouthandle remains intimersindefinitely — the guardif (timers.has(id)) returnwill prevent rescheduling but the orphaned handle will still fire and callconflictNotifications.dismiss(id)on an already-removed entry (benign but unnecessary). A cleanup pass in the$effectwould make this airtight:3.
shared-node-store.svelte.ts:2318— Hardcoded message ignores conflict typeBoth
concurrent-editandversion-mismatchconflicts emit the same message:"Your edit was overwritten by another pane". Theversion-mismatchpath is triggered by external sync (remote backend divergence), which is a subtly different user scenario from a local multi-pane conflict. This is acceptable for the current scope (issue #580 notes LWW is temporary), but a smallmessageForType()helper would make future differentiation easier and is low effort now:4.
conflict-notifications.svelte.ts:17— ID generation usesDate.now()twice per entryidis built withDate.now()andentryis built with a secondDate.now()call. These are virtually always the same millisecond, but using the same timestamp for both is more correct and avoids the (theoretical) edge case of a clock tick between the two calls:Nitpicks
Nit:
conflict-toast.svelte:47—⚠vs⚠️The HTML entity
⚠renders the bare Unicode warning sign without the emoji variation selector. On some platforms/fonts this looks like a thin symbol rather than the warning emoji. Using the literal⚠️(or⚠️) gives the colored emoji appearance consistently, or use an SVG icon from the design system if one exists.Nit:
conflict-notification-integration.test.ts:131-133— Conditional assertion weakens the testIf the conflict is not detected (e.g. conflict window logic changes), this test silently passes with zero assertions. Replace with an unconditional
expect(conflictNotifications.notifications.length).toBeGreaterThanOrEqual(1)first, then assert the metric. This makes the test fail loudly on regression rather than going green with no coverage.Nit:
conflict-toast.svelte— Noprefers-reduced-motionguardThe
toast-inanimation runs unconditionally. Users who have enabled the OS reduced-motion preference will still see the slide animation. Adding@media (prefers-reduced-motion: reduce) { .conflict-toast { animation: none; } }is a one-liner accessibility improvement.Requirements Validation
detectConflictcovers bothversion-mismatchandconcurrent-editSummary
Ship it. The four improvements above are all low-risk follow-ups; none are blockers. The conditional assertion in the metrics test (Nit #2) is the highest-priority fix among the nits as it could mask a future regression silently. The notification cap (Improvement #1) is the most practically impactful addition for production use.
Implement conflict resolution UI with toast notifications (closes #642)
Implement conflict resolution UI for concurrent edits (#1231)
Implement conflict resolution UI for concurrent edits (#1231)