From 3581a0e380bd925a17d5708d87bde489bc8b7220 Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Sun, 6 Sep 2026 19:49:10 +0200 Subject: [PATCH] fix(sessions): keep what a released editor was holding, and scope the ws selector to the drawer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An editor stays editable while its save is in flight, so a tab left in that window releases a cell that may carry an edit newer than the write — and a released cell reads as no cell at all, which the settle took for a draft nothing was watching and deleted. Keep what the last holder let go of, bounded like the other write markers, and let the settle read that when no handle is left. The linked-workspace selector follows the hand-off button: a session tab is keyed to one workspace, so re-pointing the editor at a linked one from inside a tab acted on an item the session is not about. A removal marker now also requires the delete to be what landed, as `flushDraftDelete` does: an upsert queued behind it displaces the delete, and waiting for the chain then reports idle on a draft that is back. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KcyBRxE8j3ujCYkum9KrC4 --- .../components/ResourceEditorDrawer.svelte | 18 +++++--- .../src/lib/components/VariableEditor.svelte | 6 ++- .../components/copilot/chat/global/core.ts | 11 +++-- frontend/src/lib/userDraft.svelte.ts | 41 +++++++++++++++++-- 4 files changed, 62 insertions(+), 14 deletions(-) diff --git a/frontend/src/lib/components/ResourceEditorDrawer.svelte b/frontend/src/lib/components/ResourceEditorDrawer.svelte index 1f570b10fd..56f5c7aea4 100644 --- a/frontend/src/lib/components/ResourceEditorDrawer.svelte +++ b/frontend/src/lib/components/ResourceEditorDrawer.svelte @@ -206,12 +206,18 @@ > History - + + {#if useDrawer} + + {/if} {/if}