diff --git a/web/run-detail.css b/web/run-detail.css index 7dd373bc..85360a73 100644 --- a/web/run-detail.css +++ b/web/run-detail.css @@ -205,6 +205,8 @@ cursor: pointer; } .kv-pipeline-link:hover { color: var(--color-text); } +.kv-pipeline-name { font-weight: 600; } +.kv-pipeline-ident { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 400; } .stat-add { color: var(--ok); } .stat-del { color: var(--bad); } diff --git a/web/src/runDetail.js b/web/src/runDetail.js index 558fa9bf..246fc3e3 100644 --- a/web/src/runDetail.js +++ b/web/src/runDetail.js @@ -143,6 +143,7 @@ export function summaryRows(run, nowMillis, options = {}) { key: "Pipeline", value: `id ${run.pipeline_id} · v${run.version ?? 0}`, pipelineId: Number(run.pipeline_id), + pipelineName: String(run.name ?? ""), version: Number(run.version) || 0, }); } else { diff --git a/web/src/views/runDetail.js b/web/src/views/runDetail.js index 7f4b3f89..76833bf8 100644 --- a/web/src/views/runDetail.js +++ b/web/src/views/runDetail.js @@ -250,10 +250,17 @@ function renderPipelineRow(row) { 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}`, + "aria-label": `Open pipeline ${row.pipelineName || row.pipelineId}, version ${row.version}`, }); + if (row.pipelineName) { + link.append( + h("span", { class: "kv-pipeline-name", text: row.pipelineName }), + h("span", { class: "kv-pipeline-ident", text: row.value }), + ); + } else { + link.textContent = row.value; + } link.addEventListener("click", async () => { state.view = "pipelines"; state.selectedRunId = null; diff --git a/web/src/views/search.js b/web/src/views/search.js index 67543a6c..e52091f7 100644 --- a/web/src/views/search.js +++ b/web/src/views/search.js @@ -5,7 +5,7 @@ import { h } from "../dom.js"; import { describeError } from "../format.js"; import { resolveArtifactUrl } from "../serverUrl.js"; -import { ArtifactKind, artifactKind } from "../artifacts.js"; +import { ArtifactKind, artifactKind, isViewerArtifact } from "../artifacts.js"; import { DEFAULT_SEARCH_KIND, DEFAULT_SEARCH_SORT, @@ -560,14 +560,16 @@ async function routeSearchResult(hit) { const resolved = resolveArtifactUrl(state.url, artifact.url); if (!resolved) return; closeSearch(); - const kind = artifactKind(artifact.content_type, artifact.name); - if (kind === ArtifactKind.Image || kind === ArtifactKind.Video) { + // Media, markdown and text all belong in the viewer, which now renders the + // document and offers the trip back to the run; anything else opens raw. + if (isViewerArtifact(artifact.content_type, artifact.name)) { rt.views.dialogs.openArtifactViewer( [ { url: artifact.url, name: artifact.name, content_type: artifact.content_type, + size_bytes: artifact.size_bytes, run_id: artifact.run_id, }, ], diff --git a/web/test/runDetail.test.mjs b/web/test/runDetail.test.mjs index 2a43136f..12264dc3 100644 --- a/web/test/runDetail.test.mjs +++ b/web/test/runDetail.test.mjs @@ -184,12 +184,13 @@ test("summaryRows is the Android order, omitting blank values", () => { }); test("the Pipeline summary row carries the pipeline and version for navigation", () => { - const rows = summaryRows({ pipeline_id: 24, version: 6, status: "succeeded" }, 0, TIME_OPTS); + const rows = summaryRows({ pipeline_id: 24, name: "Plan and land", version: 6, status: "succeeded" }, 0, TIME_OPTS); const row = rows.find((entry) => entry.kind === "pipeline"); assert.ok(row, "a pipeline row rather than plain text"); assert.equal(row.key, "Pipeline"); assert.equal(row.value, "id 24 · v6"); assert.equal(row.pipelineId, 24); + assert.equal(row.pipelineName, "Plan and land"); assert.equal(row.version, 6); });