Files
windmill/frontend/src/lib/components/DraftConflictAlert.svelte
T
Ruben FiszelandClaude Opus 5 d8ebbc06f5 fix: tell the user when a draft conflict has stopped their edits saving (#11241)
* fix: tell the user when a draft conflict has stopped their edits saving

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: give nothing up until the other version has actually loaded

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: ignore a reload the editor has moved on from, and settle saves before resolving

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: settle the key before a forced resolution, and cover quiesce with tests

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: let a resolution tell it belongs to an editor that is gone

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: end a conflict resolution when the editing session does, not the component

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: show the resource conflict in the fixed banner, and scope busy to its session

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: keep the conflict alert in editors no host wraps

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: free a reopened editor from a resolution the closed one left in flight

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: make switching workspace-specific versions a new conflict session

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: keep the local draft when a conflict resolution is abandoned

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: let a newer session outrank a resolution that outlived its editor

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: end a conflict resolution with the session that started it

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: reopen a conflicted editor on the version the server refused

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: keep a refused draft deletion a deletion

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: ungate the editor when a resolution loads the other draft

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: settle the draft key before reading the version to load

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix: settle the key again after reading, for edits made under the read

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 14:39:49 +00:00

32 lines
993 B
Svelte

<script lang="ts">
import { Alert, Button } from '$lib/components/common'
interface Props {
/** Take the draft the server holds, replacing what is on screen. */
onReload: () => void
/** Write what is on screen over the server's draft. */
onOverwrite: () => void
/** A resolution is in flight: neither answer is offered again until it settles. */
busy?: boolean
}
let { onReload, onOverwrite, busy = false }: Props = $props()
</script>
<Alert type="warning" title="Your draft changed elsewhere">
<div class="flex flex-col items-start gap-2">
<div>
It was saved from another tab or session since this one read it, so your changes here are no
longer being saved.
</div>
<div class="flex flex-row gap-2">
<Button unifiedSize="sm" variant="default" disabled={busy} onClick={onReload}>
Load the other version
</Button>
<Button unifiedSize="sm" variant="default" disabled={busy} onClick={onOverwrite}>
Keep mine
</Button>
</div>
</div>
</Alert>