web: pipeline list, filter/sort and detail (P1/P2/P3)

Close three rows of the browser client's parity checklist, matching the Android
app's wording and behaviour:

- P1 pipeline list: name; "id {id} · v{version} · {N stages}"; "updated d MMM
  HH:mm"; a last-run line joined from list_runs (status chip plus
  "{ago} · {duration} · run {id}", or "no runs recorded").
- P2 filter + sort: Filter menu (name contains, Runs Any/Has runs/No runs, the
  seven server run statuses, Clear filters) and Sort menu (Server order default,
  Name A-Z/Z-A, Most recent run, Fewest/Most stages, Reset). Server order is
  preserved.
- P3 pipeline detail: Summary/Graph/Source tabs; Summary shows the content hash
  (monospace), latest version, created/updated and a collapsed-by-default
  Versions section. The Graph tab carries the browser guidance note only; the
  rendered graph stays P6.

New src/pipelines.js holds the pure, DOM-free helpers (timestamps, durations,
last-run join, comparators, filter, empty states); app.js is wiring only.
web/test/pipelines.test.mjs covers the helpers; web/test/ui-smoke.mjs captures
the list, controls and detail against the live server. All server strings are
set with textContent.
This commit is contained in:
2026-10-19 02:52:35 +01:00
parent 4721b8af10
commit 13404b2a2b
6 changed files with 1368 additions and 52 deletions
+49
View File
@@ -142,3 +142,52 @@ button.ghost { background: transparent; }
.banner.error { background: #2c1616; color: var(--bad); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
/* Pipeline list: filter + sort controls. */
.list-controls { border-bottom: 1px solid var(--border); }
.list-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 12px; }
.control { font-size: 12px; padding: 4px 10px; }
.control.active { border-color: var(--accent); color: var(--accent); }
.control .count { color: var(--accent); }
.clear { font-size: 12px; padding: 4px 10px; }
.menu-panel { border-top: 1px solid var(--border); padding: 8px 12px 12px; background: var(--surface); }
.filter-section { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 4px; }
.filter-field { display: block; }
.filter-field-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.filter-field input[type="text"] { flex: none; width: 100%; min-width: 0; }
.filter-item { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; cursor: pointer; }
.filter-item input { accent-color: var(--accent); }
.filter-actions { margin-top: 10px; display: flex; gap: 8px; }
.sort-option { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; padding: 5px 8px; border-radius: 6px; font-size: 13px; }
.sort-option:hover { background: var(--surface-2); }
.sort-option.active { border-color: var(--accent); color: var(--accent); }
.row-run { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.row-run .row-meta { margin-top: 0; }
.empty { display: grid; gap: 10px; justify-items: start; }
/* Pipeline detail: tab strip, collapsible sections, source block. */
.detail-tabs { display: flex; gap: 4px; margin: 10px 0 12px; border-bottom: 1px solid var(--border); }
.detail-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); padding: 6px 10px; }
.detail-tab:hover { border-color: transparent; color: var(--text); }
.detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.detail-subtitle { font-size: 12px; margin-bottom: 10px; }
.monospace { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; }
.section-toggle { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; margin-top: 16px; border: 0; border-radius: 8px; background: var(--surface-2); padding: 8px 10px; font-weight: 600; }
.section-toggle .chevron { color: var(--muted); }
.section-body { padding: 8px 4px 0; display: grid; gap: 6px; }
.version-row { display: flex; gap: 12px; align-items: baseline; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.version-title { font-weight: 600; }
.source-code { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; overflow: auto; max-height: 60vh; }
.source-code code { background: transparent; padding: 0; font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.graph-note { margin: 0; max-width: 60ch; }
.chip-waiting { color: var(--warn); border-color: var(--warn); }
.chip-canceled { color: var(--muted); border-color: var(--muted); }
.chip-interrupted { color: var(--muted); border-color: var(--muted); }
.chip-unknown { color: var(--muted); border-color: var(--muted); }