diff --git a/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte b/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte index 57a4e2270b..05a53906f5 100644 --- a/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte +++ b/frontend/src/lib/components/copilot/chat/RunArgsFormDisplay.svelte @@ -115,19 +115,23 @@ class={twMerge('flex flex-col', layout === 'pane' ? 'h-full min-h-0' : 'pt-3')} data-chat-keyboard-scope="run-args-form" > - -
+ +
+
{#if hasArgs} @@ -143,7 +147,6 @@ disabled={planMode} {workspace} prettifyHeader - lightHeader bind:isValid bind:args={draft.args} /> @@ -163,8 +166,17 @@
-
+ and separating them would read as two subjects. No padding of its own over the fields: + every one of them ends on the room ArgInput keeps for a validation message, and adding + to it would sit the buttons twice as far below the last field as the first label sits + from the top. A form with no fields keeps none of that room, so there it comes back. --> +
{#if runForm.droppedKeys?.length}

Not an input of this script, so it will not be sent: diff --git a/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte b/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte index a1ac7c92ae..74240c3291 100644 --- a/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte +++ b/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte @@ -3,8 +3,6 @@ import { twMerge } from 'tailwind-merge' import { Button, Tab, Tabs } from '$lib/components/common' import Toggle from '$lib/components/Toggle.svelte' - import JobStatusIcon from '$lib/components/runs/JobStatusIcon.svelte' - import type { Job } from '$lib/gen' import DisplayResult from '$lib/components/DisplayResult.svelte' import { msToReadableTime } from '$lib/utils' import JobArgs from '$lib/components/JobArgs.svelte' @@ -170,27 +168,35 @@ chatJob?.durationMs !== undefined ? msToReadableTime(chatJob.durationMs, 2) : '' ) - // The card outlives its job, and sometimes precedes it: a call cancelled before Run never - // had one, and one that failed to start has none either. Synthesizing the shape - // JobStatusIcon discriminates on keeps a single vocabulary of status badges rather than a - // second one for the states only the card knows about. - const statusJob = $derived( - chatJob?.job ?? - ((canceled - ? { canceled: true, success: false } - : failed - ? { success: false, canceled: false } - : { running: false }) as unknown as Job) - ) - // The badge carries the outcome, so this is only ever how long it took, and 'Not run' where - // there is no time to give because nothing ran. - const statusTime = $derived( - running - ? elapsed - : ran - ? duration || (failed ? 'Failed' : canceled ? 'Cancelled' : 'Done') - : 'Not run' - ) + // The colours the jobs tray paints its status dots (JobsSegment's dotClass), as ink on a + // row that stays transparent: blue running, violet approval, orange queued, green ok, red + // fail. The card outlives its job and sometimes precedes it, so the states only it knows + // about — cancelled before Run, failed to start — read off its own flags instead. + const statusClass = $derived.by(() => { + if (canceled) return 'text-tertiary' + if (failed) return 'text-red-500' + if (!ran) return 'text-tertiary' + switch (chatJob?.status) { + case 'running': + return 'text-blue-500' + case 'suspended': + return 'text-violet-500' + case 'queued': + case 'scheduled': + return 'text-orange-500' + case 'failure': + return 'text-red-500' + case 'success': + return 'text-green-500' + default: + return settled ? 'text-green-500' : 'text-blue-500' + } + }) + // How long it took, which is the one thing the colour cannot say. A run that never started + // has no time to give, so its outcome takes the slot — as a word, never "Not run", which + // stutters against the "Run " label beside it. + const outcome = $derived(failed ? 'Failed' : canceled ? 'Cancelled' : 'Done') + const statusTime = $derived(running ? elapsed : duration || outcome) // What the preview button opens changes with the card: the form while the call is still // waiting on one, the run once a job exists. Neither, and there is nothing to open, so @@ -233,13 +239,13 @@ } - + {#snippet status()} {#if !pending} - - + {statusTime} {/if} @@ -274,11 +280,12 @@ {:else if pending} {:else} - -

+ +
-
- +
+

Run {message.runForm.summary || message.runForm.path}