From 795ded9d19ff768f0113d82ae3853db61812f7bf Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 3 Nov 2026 13:29:08 +0100 Subject: [PATCH] fix: make home's failed-runs ask ai clickable, add failed filter and runs link (#12174) * fix: make the home failed-runs count's ask ai reachable, add a failed filter and runs link Co-Authored-By: Claude Opus 5.5 * fix: clear the failed filter with its last failure, keep the window tooltip Co-Authored-By: Claude Opus 5.5 * refactor: use design-system buttons in the failed-runs menu Co-Authored-By: Claude Opus 5.5 * fix: fall back to getAll for set-cookie in the pages preview proxy The Pages function runs without a compatibility date, where Headers has no getSetCookie, so every proxied API call failed with a 500. Co-Authored-By: Claude Opus 5.5 * refactor: use a design-system button for the header's failed runs link Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- .../home/RecentRunsHeaderStatus.svelte | 13 ++- .../components/home/RecentRunsPanel.svelte | 101 ++++++++++++++---- .../lib/components/home/recentRuns.svelte.ts | 15 +++ 3 files changed, 108 insertions(+), 21 deletions(-) diff --git a/frontend/src/lib/components/home/RecentRunsHeaderStatus.svelte b/frontend/src/lib/components/home/RecentRunsHeaderStatus.svelte index c2f24df00b..4bcb31ed93 100644 --- a/frontend/src/lib/components/home/RecentRunsHeaderStatus.svelte +++ b/frontend/src/lib/components/home/RecentRunsHeaderStatus.svelte @@ -6,6 +6,7 @@ import { allRunsHref, askAI, + failedRunsHref, canAskAI, collisionPrefixes, itemKey, @@ -154,7 +155,7 @@ {/if}
@@ -165,6 +166,16 @@ All runs + {#if data && data.failed_runs > 0} + + {/if} {#if onShowPanel}
- {/if} - + + + {#snippet trigger()} + {data.failed_runs} failed + {/snippet} + {#snippet content()} +
+ + {#if failedItems.length > 0} + + {/if} + {#if canAskAI() && failing.length > 0} + + {/if} + +
+ {/snippet} +
{:else} - {totalLabel(data)} + {totalLabel(data)} {/if} - · {windowText} + +  · {windowText} {/if} @@ -102,7 +163,7 @@ {:else if data}
- {#each data.items as item (itemKey(item))} + {#each shownItems as item (itemKey(item))} { + const { minTs, maxTs } = t.computeMinMax() + const span = minTs && maxTs ? Date.parse(maxTs) - Date.parse(minTs) : NaN + return Math.abs(span - windowHours * 3600_000) < 1000 + }) + if (timeframe) params.set('timeframe', timeframe.label) + return `/runs?${params}` +} + export function windowLabel(hours: number) { return hours > 24 && hours % 24 === 0 ? `last ${hours / 24}d` : `last ${hours}h` }