web: link artifacts and runs back to their sources

- The run Summary's Pipeline value is a button that opens that pipeline version.
- The artifact viewer carries an Open run button (the search viewer passes the
  artifact's run id), so the evidence always leads back to the run.
- Search artifact rows show the image itself as a thumbnail; other artifacts get
  a type tile (MD/TXT/JSON/CSV/GO/PDF/...), and every artifact row offers an
  Open run action next to its own navigation.
This commit is contained in:
2026-10-19 23:07:04 +01:00
parent af1050b842
commit 64e40f0b88
7 changed files with 218 additions and 7 deletions
+26
View File
@@ -105,6 +105,7 @@ export function createRunDetailView(rt) {
const renderConfirmDialog = (...args) => rt.views.dialogs.renderConfirmDialog(...args);
const renderActionFailedDialog = (...args) => rt.views.dialogs.renderActionFailedDialog(...args);
const openArtifactViewer = (...args) => rt.views.dialogs.openArtifactViewer(...args);
const selectPipeline = (...args) => rt.selectPipeline(...args);
/**
* The run detail: a tab strip (Summary / Graph / Input / Output / Timeline) over
@@ -212,6 +213,7 @@ function renderRunSummaryTab(d, now) {
if (row.kind === "wait") rows.append(h("div", { class: "run-wait", text: row.value }));
else if (row.kind === "duration") rows.append(renderDurationRow(d, row));
else if (row.kind === "block") rows.append(renderCodeBlock(row.key, row.value));
else if (row.kind === "pipeline") rows.append(renderPipelineRow(row));
else rows.append(renderKvRow(row));
}
wrap.append(rows);
@@ -237,6 +239,30 @@ function renderRunSummaryTab(d, now) {
return wrap;
}
/**
* The Pipeline row: the same "id N · vM" text, but a button that opens that
* pipeline version. A run is only legible next to the definition it executed, so
* this is the shortest path from the evidence to the pipeline.
*/
function renderPipelineRow(row) {
const wrap = h("div", { class: "kv-row" });
wrap.append(h("span", { class: "kv-key", text: row.key }));
const link = h("button", {
class: "kv-val kv-pipeline-link",
type: "button",
text: row.value,
title: `Open pipeline ${row.pipelineId}`,
"aria-label": `Open pipeline ${row.pipelineId}, version ${row.version}`,
});
link.addEventListener("click", async () => {
state.view = "pipelines";
state.selectedRunId = null;
await selectPipeline({ id: row.pipelineId, version: row.version });
});
wrap.append(link);
return wrap;
}
/** The Duration row, tagged so the detail clock can update it in place. */
function renderDurationRow(d, row) {
return h(