From 39c28a95bffb8a22772b7aa1eb9c609a365625a0 Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Wed, 7 Oct 2026 03:06:29 -0700 Subject: [PATCH] docs: drop the last traces of the carried draft value Nit-only round. Two comments still described the target as holding the value resolution had read, which the previous commit removed, and `ResolvedDraft` still declared a `value` field no caller reads. The field is gone with them, so the type says what it is: where the draft lives. Co-Authored-By: Claude Opus 5 (1M context) --- frontend/src/lib/components/copilot/chat/global/core.ts | 4 ++-- .../components/copilot/chat/global/userDraftAdapter.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/global/core.ts b/frontend/src/lib/components/copilot/chat/global/core.ts index f3c8306429..4c6ab519a5 100644 --- a/frontend/src/lib/components/copilot/chat/global/core.ts +++ b/frontend/src/lib/components/copilot/chat/global/core.ts @@ -4815,8 +4815,8 @@ function addressedDisplayPath( triggerKind?: TriggerKind ): string { // From the open editor, which holds the freshest name and answers without a request. A - // draft no editor holds falls back to the path the call named; the write's own result - // names it properly once the value has been read. + // draft no editor holds falls back to the path the call named; the result the write + // returns names it from the draft itself. const live = liveGlobalDraftDisplayPath(workspace, type, target.storagePath, triggerKind) return live === target.storagePath ? target.path : live } diff --git a/frontend/src/lib/components/copilot/chat/global/userDraftAdapter.ts b/frontend/src/lib/components/copilot/chat/global/userDraftAdapter.ts index 445f576feb..798dc2af1b 100644 --- a/frontend/src/lib/components/copilot/chat/global/userDraftAdapter.ts +++ b/frontend/src/lib/components/copilot/chat/global/userDraftAdapter.ts @@ -335,9 +335,9 @@ const NAMEABLE_DRAFT_KINDS: ReadonlySet = new Set( Object.keys(deployedExists) as UserDraftItemKind[] ) -/** What a path resolved to: where the draft is stored, and its value when reaching it - * already fetched one, so a read does not ask for the same draft twice. */ -type ResolvedDraft = { storagePath: string; value?: unknown } +/** What a path resolved to: where the draft is stored. Deliberately not the value read on + * the way there — see `readGlobalDraftValue` for why a caller must fetch its own. */ +type ResolvedDraft = { storagePath: string } /** * Where the draft a path names is stored. A new item is stored at a generated @@ -362,7 +362,7 @@ async function resolveDraft( // chat is handed storage paths. if (UserDraft.get(itemKind, path, { workspace }) !== undefined) return { storagePath: path } const own = await fetchBackendDraftValue(workspace, itemKind, path) - if (own !== undefined) return { storagePath: path, value: own } + if (own !== undefined) return { storagePath: path } return { storagePath: await storagePathForChosenName(workspace, itemKind, path, opts) } }