Fix artifacts-view scrolling, narrow widths and capture wording

The Artifacts view re-clamped its scroll offset to the selected row on every
render, so the tail of the list - a trailing visit that recorded none (running
or finished) and its capture summary - could never be brought on screen, and
the image marker crowded out artifact names at narrow widths.

- Decouple the scroll offset from the selection: add PgUp/PgDn (and ctrl+u/
  ctrl+d) paging, and make G/end select the last artifact and scroll to the
  tail so a trailing visit stays reachable.
- Share artifactContent/clampArtifactTop/revealArtifactSelection between
  selection and render so both agree on the same page.
- Show the [img] marker only while the width still leaves room for a usable
  name, keeping columns aligned either way.
- Advertise the scroll keys in the artifacts footer help.
- Test the omitted-files capture wording, trailing-visit reachability via
  G/end and page scroll, and narrow-width no-overflow; render both the top and
  the scrolled tail in the env-gated live capture test.
- Update the packaged operations reference for the A artifacts view.
This commit is contained in:
2026-10-17 00:24:42 +01:00
parent 865993b200
commit 889d811858
5 changed files with 172 additions and 34 deletions
+15 -4
View File
@@ -23,7 +23,9 @@ func TestLiveArtifactsFromCapture(t *testing.T) {
t.Skip("set PIPELINES_ARTIFACT_CAPTURES to comma-separated `pipelines inspect RUN_ID --json` files")
}
m := New(context.Background(), "ws://127.0.0.1:8080/connect")
m.width, m.height = 120, 60
// Height chosen so artifactsViewHeight() is 50, keeping the view's page size
// and the model's scroll page size identical (as they are in the app).
m.width, m.height = 120, 54
var rendered strings.Builder
for _, path := range strings.Split(list, ",") {
path = strings.TrimSpace(path)
@@ -39,9 +41,18 @@ func TestLiveArtifactsFromCapture(t *testing.T) {
t.Fatal(err)
}
m.runDetail = &detail
view := ansi.Strip(m.artifactsView(50))
t.Logf("capture %s (run #%d executing=%t):\n%s", path, detail.ID, detail.Executing, view)
rendered.WriteString(view)
m.artifactsOpen = true
m.artifactIndex, m.artifactTop = 0, 0
top := ansi.Strip(m.artifactsView(m.artifactsViewHeight()))
t.Logf("capture %s (run #%d executing=%t) top:\n%s", path, detail.ID, detail.Executing, top)
rendered.WriteString(top)
// Scroll to the tail so a trailing running visit's capture summary is
// rendered regardless of how many artifacts precede it; a fixed top
// page used to clip it once a run accumulated enough artifacts.
m = artifactKey(m, 'G')
tail := ansi.Strip(m.artifactsView(m.artifactsViewHeight()))
t.Logf("capture %s (run #%d executing=%t) tail:\n%s", path, detail.ID, detail.Executing, tail)
rendered.WriteString(tail)
}
text := rendered.String()
for _, want := range []string{"[img]", "partial capture", "capture pending", "not recorded for this visit", "image/png", "KiB"} {