From 1e2eb18e8c4233313182b95454146b5bba442b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Wed, 20 May 2026 16:34:42 +0200 Subject: [PATCH] Redesign JobCob popover --- src/components/JobCob.svelte | 431 ++++++++++++++++++++++++++++------- 1 file changed, 354 insertions(+), 77 deletions(-) diff --git a/src/components/JobCob.svelte b/src/components/JobCob.svelte index 4fc8af97b..2c7e25616 100644 --- a/src/components/JobCob.svelte +++ b/src/components/JobCob.svelte @@ -1,13 +1,17 @@ {#await invoke("list_jobs", { rid, sha: commit }) then jobs} {#if jobs.length > 0} - - {#snippet toggle()} - {#if jobs.every(j => { - return j.runs.every(r => { - return r.status === "succeeded"; - }); - })} -
- -
- {:else if jobs.every(j => { - return j.runs.every(r => { - return r.status === "failed"; - }); - })} -
- -
+ {@const groups = groupJobs(jobs)} + {@const overallCounts = totalCounts(groups)} + {@const overall = aggregateStatus(overallCounts)} + {#snippet statusChip(status: Status)} + + {#if status === "succeeded"} + + {:else if status === "failed"} + {:else} -
- -
+ {/if} +
+ {/snippet} + {#snippet runRow(view: RunView)} + {#if view.linkable} + + {@render statusChip(view.run.status)} + + run {view.label} + + + + + + {:else} +
+ {@render statusChip(view.run.status)} + + run {view.label} + + (no log) +
+ {/if} + {/snippet} + + {#snippet toggle(onclick)} + {/snippet} {#snippet popover()} - {#each jobs as job} - {#each job.runs as run} - - - {#if run.status === "started"} -
- Started -
- {:else if run.status === "failed"} -
- Failed -
- {:else if run.status === "succeeded"} -
- Passed -
- {/if} - +
+
+ {#each groups as group (group.nodeKey)} + {@const isCollapsed = collapsed.has(group.nodeKey)} +
- + class="row node-header" + role="button" + tabindex="0" + onclick={() => toggleNode(group.nodeKey)} + onkeydown={e => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + toggleNode(group.nodeKey); + } + }}> + + + + {@render statusChip(group.status)} + + + {#if group.inlineHost} + · {group.inlineHost} + {/if} + + + {statusLabel(group.counts)} +
- -
- {/each} - {/each} + + {#if !isCollapsed} + {#if group.flatRuns} + {#each group.flatRuns as view (view.run.runId)} + {@render runRow(view)} + {/each} + {:else} + {#each group.hosts as host} +
+ {host.host} +
+ {#each host.runs as view (view.run.runId)} + {@render runRow(view)} + {/each} + {/each} + {/if} + {/if} +
+ {/each} +
+
{/snippet} -
+ {/if} {/await}