From 18953e9b08cba3b802b8b27ba59e53b74ffd934f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Thu, 21 May 2026 12:58:12 +0200 Subject: [PATCH] Redesign JobCob popover --- src/components/JobCob.svelte | 495 ++++++++++++++++++++++----- src/views/repos/Cob/Revision.svelte | 7 +- src/views/repos/Commit.svelte | 4 +- src/views/repos/Source/Header.svelte | 14 +- 4 files changed, 416 insertions(+), 104 deletions(-) diff --git a/src/components/JobCob.svelte b/src/components/JobCob.svelte index 5aa060f8c..1592e9b5e 100644 --- a/src/components/JobCob.svelte +++ b/src/components/JobCob.svelte @@ -24,119 +24,448 @@ {#await jobsPromise} -
- -
+
{:then jobs} - {@const jobStatus = computeStatus(jobs)} - {#if jobStatus} - -
- {#if jobStatus === "succeeded"} - - All passed - - {:else if jobStatus === "failed"} - - All failed - - {:else} - - Mixed - - {/if} -
- -
- {#each jobs as job (job.jobId)} - {#each job.runs as run (run.runId)} - {#if run.status === "started"} - - Started - - {:else if run.status === "failed"} - - Failed - - {:else if run.status === "succeeded"} - - Passed - + {@const groups = groupJobs(jobs)} + {#if groups.length > 0} + {@const overallCounts = totalCounts(groups)} + {@const overall = aggregateStatus(overallCounts)} + + + + + +
+ {#each groups as group (group.nodeKey)} + {@const isCollapsed = collapsed[group.nodeKey]} +
+
toggleNode(group.nodeKey)} + on:keydown={e => { + if (e.key === "Enter" || e.key === " ") { + e.preventDefault(); + toggleNode(group.nodeKey); + } + }}> + + + + + {#if group.status === "succeeded"} + + {:else if group.status === "failed"} + + {:else} + + {/if} + + + + + + + + {#if group.inlineHost} + · {group.inlineHost} + {/if} + + {statusLabel(group.counts)} +
+ + {#if !isCollapsed} + {#if group.flatRuns} + {#each group.flatRuns as view (view.run.runId)} + {#if view.linkable} + + + {#if view.run.status === "succeeded"} + + {:else if view.run.status === "failed"} + + {:else} + + {/if} + + + run {view.label} + + + + + + {:else} +
+ + {#if view.run.status === "succeeded"} + + {:else if view.run.status === "failed"} + + {:else} + + {/if} + + + run {view.label} + + (no log) +
+ {/if} + {/each} + {:else} + {#each group.hosts as host} +
{host.host}
+ {#each host.runs as view (view.run.runId)} + {#if view.linkable} + + + {#if view.run.status === "succeeded"} + + {:else if view.run.status === "failed"} + + {:else} + + {/if} + + + run {view.label} + + + + + + {:else} +
+ + {#if view.run.status === "succeeded"} + + {:else if view.run.status === "failed"} + + {:else} + + {/if} + + + run {view.label} + + (no log) +
+ {/if} + {/each} + {/each} + {/if} + {/if} +
{/each}
- +
{/if} {:catch} diff --git a/src/views/repos/Cob/Revision.svelte b/src/views/repos/Cob/Revision.svelte index fa1436aee..d3597ad3d 100644 --- a/src/views/repos/Cob/Revision.svelte +++ b/src/views/repos/Cob/Revision.svelte @@ -443,12 +443,7 @@ {#if response.commits.length - 1 === index}
- +
{/if}
diff --git a/src/views/repos/Commit.svelte b/src/views/repos/Commit.svelte index 4f1adbe87..bec620ce0 100644 --- a/src/views/repos/Commit.svelte +++ b/src/views/repos/Commit.svelte @@ -116,9 +116,7 @@ slot="after-timestamp" {baseUrl} rid={repo.rid} - commit={header.id} - stylePopoverPositionTop="0.5rem" - stylePopoverPositionLeft="0" /> + commit={header.id} /> {header.parents.length === 1 ? "Parent" : "Parents"}: diff --git a/src/views/repos/Source/Header.svelte b/src/views/repos/Source/Header.svelte index ea777d235..3baed4ffb 100644 --- a/src/views/repos/Source/Header.svelte +++ b/src/views/repos/Source/Header.svelte @@ -145,12 +145,7 @@ {/if}
- +
@@ -219,12 +214,7 @@ {/if}
- +