web: put the work first and the audit evidence behind a door

- Turn files (input/memory/output/session) are system artifacts now: they are
  never tiles in the run or stage galleries. Shared public files are attributed
  to the visit that first recorded them, so a run counts 3 stage artifacts, not
  one copy of each per later stage.
- Audit & debug opens a dialog with vertical Input / Output / Memory / Session /
  Definition tabs, for a visit from the stage pane or the run Summary.
- Run tabs are Summary / Graph / Timeline; Input and Output are Summary sections
  with Artifacts, Files changed and Audit. Each stage pane gains Files changed.
- Artifacts gain a gallery/list switch (remembered) and full-name wrapping; the
  copy/share actions are hover-or-focus icon buttons.
- Status badge above the run title; no live badges on the run surfaces. The runs
  list leads with the pipeline name and the stored task title beneath it.
- Chat rows: title + coloured status word only, then directory, then model; no
  operator or closed chips, no dot. The more/star cluster is a hover/focus
  overlay so the title uses the row's width, and an open menu stacks above rows.
  Closed chats collapse behind a chevron. Sessions can be starred locally and
  sort in a Starred group. The chat header no longer repeats status/dir/model.
- A visible rail divider separates Search from the destinations; the page has a
  real favicon/apple-touch icon and the rail brand wears it.
- Smoke updated: no live badges, 3 detail tabs, field hits open Summary sections,
  closed chats expand for checks, the fixture viewer uses shot.png/missing.txt
  and the audit for markdown.
This commit is contained in:
2026-10-20 01:00:01 +01:00
parent ca28d08269
commit d130615fae
25 changed files with 1167 additions and 366 deletions
+100
View File
@@ -816,6 +816,105 @@ function openArtifactViewer(viewable, startIndex, trigger = null) {
});
}
/**
* The Audit & debug dialog: a stage's turn-owned evidence behind vertical tabs
* (Input, Output, Memory, Session, Stage definition), the chosen section's body
* on the right. It is the only place the system files are shown, so the artifact
* surfaces stay focused on what the stage actually produced.
*/
function openStageAudit({ title = "Audit", subtitle = "", tabs = [], trigger = null } = {}) {
const available = (tabs ?? []).filter((tab) => typeof tab?.body === "function");
if (!available.length) return;
const close = () => modal.close("stage-audit");
const overlay = h("div", {
class: "audit-viewer",
role: "dialog",
"aria-modal": "true",
"aria-label": title,
});
overlay.addEventListener("click", (event) => {
if (event.target === overlay) close();
});
const closeButton = h("button", {
class: "audit-close",
type: "button",
text: "Close",
onclick: close,
});
const panel = h("div", { class: "audit-panel" });
panel.append(
h(
"div",
{ class: "audit-head" },
h(
"div",
{ class: "audit-titles" },
h("h2", { class: "audit-title", text: title }),
subtitle ? h("p", { class: "audit-subtitle muted", text: subtitle }) : null,
),
closeButton,
),
);
const nav = h("nav", {
class: "audit-tabs",
role: "tablist",
"aria-orientation": "vertical",
"aria-label": "Audit sections",
});
const body = h("div", {
class: "audit-body",
id: "auditBody",
role: "tabpanel",
tabindex: "0",
});
panel.append(h("div", { class: "audit-layout" }, nav, body));
overlay.append(panel);
let active = available[0].key;
const renderTabs = () => {
nav.replaceChildren(
...available.map((tab) => {
const selected = tab.key === active;
return h("button", {
class: `audit-tab${selected ? " active" : ""}`,
type: "button",
role: "tab",
"aria-selected": selected ? "true" : "false",
"aria-controls": "auditBody",
"data-audit-tab": tab.key,
tabindex: selected ? "0" : "-1",
text: tab.label,
onclick: () => {
active = tab.key;
renderTabs();
},
onkeydown: (event) => {
const index = available.findIndex((entry) => entry.key === tab.key);
let next = -1;
if (event.key === "ArrowDown") next = (index + 1) % available.length;
else if (event.key === "ArrowUp") next = (index - 1 + available.length) % available.length;
else if (event.key === "Home") next = 0;
else if (event.key === "End") next = available.length - 1;
if (next < 0) return;
event.preventDefault();
active = available[next].key;
renderTabs();
nav.querySelector(`[data-audit-tab="${active}"]`)?.focus();
},
});
}),
);
const current = available.find((tab) => tab.key === active) ?? available[0];
body.replaceChildren(current.body());
};
renderTabs();
modal.open("stage-audit", overlay, {
onClose: () => close(),
trigger,
fallbackSelectors: ["#detailTitle", "#pane-main"],
});
}
return {
closeChangeViewer,
openChangeViewer,
@@ -831,5 +930,6 @@ function openArtifactViewer(viewable, startIndex, trigger = null) {
dismissActionError,
closeArtifactViewer,
openArtifactViewer,
openStageAudit,
};
}