From c8d4afcc72689e0cec99f0f85f519d437e5d9591 Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Tue, 1 Sep 2026 17:27:24 +0200 Subject: [PATCH] docs: trim the run card's comments to one rationale each, four lines --- .../copilot/chat/AIChatManager.svelte.ts | 19 ++++------ .../copilot/chat/RunArgsFormDisplay.svelte | 18 +++++----- .../copilot/chat/RunScriptCard.svelte | 36 ++++++++----------- .../src/lib/components/copilot/chat/shared.ts | 12 +++---- .../sessions/sessionRuntime.svelte.ts | 6 ++-- 5 files changed, 37 insertions(+), 54 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts index 3108e3198f..db29e0eae9 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts +++ b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts @@ -4776,19 +4776,14 @@ export class AIChatManager { } /** What the transcript would be if the turn stopped here — for the writes that fire - * mid-turn without ending it. Loading is a property of this page: reloading resolves - * no card, so one stored still pending comes back asking for input nothing can - * deliver. Settles the stored copy only; the live turn keeps its cards. + * mid-turn without ending it. Loading is a property of this page: reloading resolves no + * card, so one stored still pending comes back asking for input nothing can deliver. + * Settles the stored copy only; the live turn keeps its cards. * - * Except a card the poller resolves after a reload: settling that one stores an - * "Interrupted" error, and the patch a completed job merges in carries no error to - * clear it with. Which cards those are is loadPastChat's question, so ask it the same - * way — a job still running inline is detached by the restore and polled like any - * other. - * - * That exemption is a bet on the poller, and the poller only knows the jobs stored - * in the same record — registering one does not write it. So the jobs come back - * with the transcript that depends on them, and both go into the same saveChat. */ + * Except a card the poller will resolve after a reload: settling that one stores an + * "Interrupted" error the patch a completed job merges in carries nothing to clear. + * Which cards those are is loadPastChat's question, asked the same way — and the poller + * only knows the jobs stored in the same record, so both go into the same saveChat. */ #interruptedSnapshot = (): { display: DisplayMessage[]; jobs: ChatJob[] } => { const polled = this.#pollableToolCalls() return { diff --git a/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte b/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte index f5a3845224..57a4e2270b 100644 --- a/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte @@ -31,11 +31,10 @@ // variables have to resolve there too. const workspace = $derived(aiChatManager.operatingWorkspace) - // The manager's draft, not a copy of its own: this form is mounted either in the chat - // card or in the preview pane, and moving between the two has to keep what was typed. - // It is also where the deep copy off displayMessages happens — see runFormDraft. - // untrack: taken once, on purpose. The message is replaced on every patch to the card, - // and re-seeding from a later copy of it would throw away what has been typed. + // The manager's draft, not a copy of its own: the chat card and the preview pane are two + // views of one form, and moving between them has to keep what was typed. untrack because + // the message is replaced on every patch to the card, and re-seeding from a later copy of + // it would discard those edits. const draft = untrack(() => aiChatManager.runFormDraft(toolCallId, runForm)) const properties = $derived(draft.schema?.properties ?? {}) @@ -194,11 +193,10 @@
{PLAN_MODE_MESSAGES.runFormRefused}
{/if} - +