From e887451c6b72071508e6bb3d85732bee7595d90e Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 5 Aug 2026 10:33:03 +0200 Subject: [PATCH] web/components/repo: show pipeline status in the commit list Every commit row on the repo overview now ends with the pipeline symbol, the way the appview's repo index does. Only repos with a spindle get one. The data is mocked for now, same as the pipelines tab. Bobbin's listPipelines still needs wiring up before any of it is real. Signed-off-by: eti --- web/src/lib/api/repoIndex.ts | 6 +++ .../components/repo/CommitList.stories.svelte | 4 +- web/src/lib/components/repo/CommitList.svelte | 36 ++++++++++++--- .../repo/RepoIndexView.stories.svelte | 46 ++++++++++++++----- .../lib/components/repo/RepoIndexView.svelte | 1 + web/src/lib/components/repo/pipelines/mock.ts | 15 ++++++ 6 files changed, 90 insertions(+), 18 deletions(-) diff --git a/web/src/lib/api/repoIndex.ts b/web/src/lib/api/repoIndex.ts index 77269024..e8bfb9d3 100644 --- a/web/src/lib/api/repoIndex.ts +++ b/web/src/lib/api/repoIndex.ts @@ -18,6 +18,7 @@ import { toTreeCommitSummary, toTreeEntrySummary } from "$lib/api/repo"; +import { pipelinesByCommitHash } from "$lib/components/repo/pipelines/mock"; import { renderDocument } from "$lib/markup"; import type { LanguageSlice, RepoInfo } from "$lib/components/repo/types"; // `/tree/{ref}` is this same page at another ref, so they share a load @@ -167,6 +168,11 @@ export const loadRepoIndex = async ( readmeHtml, commits, tagsByCommit: tagsByCommitHash(commits, tags), + // TODO: mocked, like the pipelines tab. only repos with a spindle run CI, + // so the appview does not even ask for statuses without one + pipelinesByCommit: parent.repo.spindle + ? pipelinesByCommitHash(commits.map((commit) => commit.hash)) + : {}, totalCommits: results.log.value?.total ?? commits.length, branches: branches.slice(0, BRANCH_LIMIT), totalBranches: branches.length, diff --git a/web/src/lib/components/repo/CommitList.stories.svelte b/web/src/lib/components/repo/CommitList.stories.svelte index 178d6ce1..9bd3d3b9 100644 --- a/web/src/lib/components/repo/CommitList.stories.svelte +++ b/web/src/lib/components/repo/CommitList.stories.svelte @@ -2,6 +2,7 @@ import { defineMeta, type StoryContext } from "@storybook/addon-svelte-csf"; import { expect } from "storybook/test"; import CommitList from "./CommitList.svelte"; + import { pipelinesByCommitHash } from "./pipelines/mock"; import type { CommitSummary } from "./types"; const commits: CommitSummary[] = [ @@ -47,7 +48,8 @@ commits, tagsByCommit: { "0123456789abcdef0123456789abcdef01234567": ["v1.0.0"] - } + }, + pipelinesByCommit: pipelinesByCommitHash(commits.map((commit) => commit.hash)) } }); diff --git a/web/src/lib/components/repo/CommitList.svelte b/web/src/lib/components/repo/CommitList.svelte index a2140507..24531e0e 100644 --- a/web/src/lib/components/repo/CommitList.svelte +++ b/web/src/lib/components/repo/CommitList.svelte @@ -4,16 +4,26 @@ import Tag from "$lib/components/ui/Tag.svelte"; import TimeAgo from "$lib/components/ui/TimeAgo.svelte"; import User from "$lib/components/ui/User.svelte"; - import type { CommitSummary } from "./types"; + import Separator from "../ui/Separator.svelte"; + import PipelineWorkflows from "./pipelines/PipelineWorkflows.svelte"; + import type { CommitSummary, PipelineSummary } from "./types"; interface Props { ownerHandle: string; repoName: string; commits: CommitSummary[]; tagsByCommit?: Record; + /** only repos with a spindle have any, and only some commits get one */ + pipelinesByCommit?: Record; } - let { ownerHandle, repoName, commits, tagsByCommit = {} }: Props = $props(); + let { + ownerHandle, + repoName, + commits, + tagsByCommit = {}, + pipelinesByCommit = {} + }: Props = $props(); const base = $derived(`/${ownerHandle}/${repoName}`); let expanded = $state>({}); @@ -43,7 +53,9 @@ {#if commit.body && expanded[commit.hash]} -

{commit.body}

+

+ {commit.body} +

{/if} {/each} diff --git a/web/src/lib/components/repo/RepoIndexView.stories.svelte b/web/src/lib/components/repo/RepoIndexView.stories.svelte index 1f641705..84149b4d 100644 --- a/web/src/lib/components/repo/RepoIndexView.stories.svelte +++ b/web/src/lib/components/repo/RepoIndexView.stories.svelte @@ -1,6 +1,7 @@