From 0e64cdb42d24c54ecc8e27514bb7cf8e92a153a8 Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Thu, 3 Sep 2026 11:58:28 +0200 Subject: [PATCH] fix: name the runnable in the run card's row, not its path --- .../copilot/chat/RunScriptCard.svelte | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte b/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte index 777edd2f0f..844373979b 100644 --- a/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte +++ b/frontend/src/lib/components/copilot/chat/RunScriptCard.svelte @@ -90,12 +90,16 @@ ? { present: 'Testing', past: 'Tested', future: 'Test' } : { present: 'Running', past: 'Ran', future: 'Run' } ) + // What the script is called on its own page and in the picker, so the row names the thing + // that ran rather than where it is filed. Not every script has one, so the path stays the + // fallback — and stays on the preview chip either way, since two folders can hold one name. + const runnableName = $derived(runForm.summary || runForm.path) const label = $derived( running - ? `${verbs.present} ${runForm.path}` + ? `${verbs.present} ${runnableName}` : settled && ran - ? `${verbs.past} ${runForm.path}` - : `${verbs.future} ${runForm.path}` + ? `${verbs.past} ${runnableName}` + : `${verbs.future} ${runnableName}` ) // Being cancelled is an outcome like any other, and it is the one the card has to say out @@ -239,7 +243,7 @@ }) // 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. + // stutters against the "Run " label beside it. const outcome = $derived(failed ? 'Failed' : canceled ? 'Cancelled' : 'Done') const statusTime = $derived(running ? elapsed : duration || outcome) @@ -258,14 +262,14 @@ ) const previewTitle = $derived( previewTarget === 'form' - ? 'Open this form in the preview panel' + ? `Open this form in the preview panel: ${runForm.path}` : aiChatManager.openRunInPreview - ? 'Open this run in the preview panel' - : 'Open this run in a new tab' + ? `Open this run in the preview panel: ${runForm.path}` + : `Open this run in a new tab: ${runForm.path}` ) function openPreview() { - const label = runForm.summary || runForm.path + const label = runnableName if (previewTarget === 'form') { aiChatManager.openRunForm?.({ toolCallId: message.tool_call_id, label }) return