web: open searched documents in the viewer and name the run's pipeline

A markdown/text artifact hit now opens the artifact viewer (with its Open run
action) instead of a raw browser tab, and the run Summary's Pipeline row shows
the pipeline's name beside its id and version, all in the link to the definition.
This commit is contained in:
2026-10-19 23:10:13 +01:00
parent 13af293c53
commit 5682aadfaa
5 changed files with 19 additions and 6 deletions
+1
View File
@@ -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 {
+9 -2
View File
@@ -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;
+5 -3
View File
@@ -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,
},
],