web: motion across panes and rows, and the last polish

- Panes fade in on a destination/tab/selection change only; list rows FLIP when
  they move (sort, star, filter) and fade in when they appear; removals close the
  gap through the same move. Reduced-motion users get none of it.
- Modal panels (audit, viewers, diff, tool calls, confirmations) arrive with a
  short scale/fade.
- A collapsed list hides its filter/sort toolbars; the Refresh tooltip is stamped
  as soon as a populated list first paints.
- The smoke settles after a sort before measuring a row for a click.
This commit is contained in:
2026-10-20 01:41:51 +01:00
parent 5faae8f896
commit d7763ec466
6 changed files with 97 additions and 0 deletions
+29
View File
@@ -336,3 +336,32 @@ code {
scroll-behavior: auto !important;
}
}
/* Motion: a pane change and newly appearing rows arrive; moved rows FLIP in JS.
Everything is disabled for a reader who asks for reduced motion. */
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes row-in { from { opacity: 0; transform: translateY(3px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(0.995); } }
.view-enter { animation: view-in 180ms ease-out; }
.row-enter { animation: row-in 160ms ease-out; }
.audit-panel,
.viewer-panel,
.change-viewer-panel,
.chat-tools-modal-panel,
.stage-pane-sheet,
.confirm-dialog,
.attention-sheet-panel { animation: modal-in 150ms ease-out; }
.row,
.rail-tab,
.strip-tab,
.dock-item,
.chat-star,
.chat-menu-button,
button { transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out; }
@media (prefers-reduced-motion: reduce) {
.view-enter, .row-enter,
.audit-panel, .viewer-panel, .change-viewer-panel, .chat-tools-modal-panel,
.stage-pane-sheet, .confirm-dialog, .attention-sheet-panel { animation: none; }
.row, .rail-tab, .strip-tab, .dock-item, .chat-star, .chat-menu-button, button { transition: none; }
}
+4
View File
@@ -344,6 +344,10 @@
.list-collapsed .list-pane .pane-head-actions { margin: 0; }
.list-collapsed .list-pane .list,
.list-collapsed .list-pane .list-scroll { padding-left: 2px; padding-right: 2px; }
.list-collapsed .list-pane .run-toolbar,
.list-collapsed .list-pane .list-controls,
.list-collapsed .list-pane .chat-toolbar,
.list-collapsed .list-pane .list-toolbar { display: none; }
/* Run rows: a single status glyph. */
.list-collapsed .run-row > *:not(.run-row-head) { display: none; }
.list-collapsed .run-row .run-row-head > *:not(.status-icon) { display: none; }
+60
View File
@@ -720,6 +720,18 @@ function renderHeader() {
if (active) control.setAttribute("aria-current", "page");
else control.removeAttribute("aria-current");
}
// The list's data may have arrived before its first paint (the run watch's
// snapshot); stamp it so the Refresh tooltip is never "Not refreshed yet"
// while the list is visibly populated.
const loaded =
state.view === "runs"
? state.runsLoaded
: state.view === "pipelines"
? state.pipelinesLoaded
: state.view === "chat"
? state.chatLoaded
: true;
if (loaded && !(Number(state.lastUpdated?.[state.view]) > 0)) touchView(state.view);
railSearch.setAttribute("aria-expanded", state.searchOpen ? "true" : "false");
dockSearch.setAttribute("aria-expanded", state.searchOpen ? "true" : "false");
// aria-controls points at #searchPanel only while that panel exists.
@@ -1189,7 +1201,55 @@ function renderContent() {
// next render can put the operator back exactly where they were (a dialog, a
// refresh or a paging frame must not move them).
captureChatPosition();
// A list re-render is animated, never jump-cut: rows that moved keep their
// visual place with a FLIP, new rows fade in, and a destination/tab/selection
// change fades the pane in once (the same view's live updates do not replay it).
const reduceMotion =
typeof window.matchMedia === "function" &&
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const before = new Map();
if (!reduceMotion) {
for (const node of content.querySelectorAll("[data-animate-key]")) {
before.set(node.getAttribute("data-animate-key"), node.getBoundingClientRect());
}
}
content.replaceChildren(...nodes);
if (!reduceMotion) {
for (const node of content.querySelectorAll("[data-animate-key]")) {
const key = node.getAttribute("data-animate-key");
const prior = before.get(key);
if (prior) {
const rect = node.getBoundingClientRect();
const dx = prior.left - rect.left;
const dy = prior.top - rect.top;
if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {
node.animate(
[{ transform: `translate(${dx}px, ${dy}px)` }, { transform: "translate(0, 0)" }],
{ duration: 180, easing: "ease-out" },
);
}
} else {
node.classList.add("row-enter");
node.addEventListener("animationend", () => node.classList.remove("row-enter"), {
once: true,
});
}
}
const key = [
state.view,
state.selectedPipelineId ?? "",
state.selectedRunId ?? "",
state.runTab ?? "",
state.pipelineTab ?? "",
state.chatActiveId ?? "",
].join("|");
if (state.lastRenderKey !== key) {
state.lastRenderKey = key;
content.classList.remove("view-enter");
void content.offsetWidth;
content.classList.add("view-enter");
}
}
if (state.view === "chat") {
afterChatRender();
modal.reconcile();
+1
View File
@@ -269,6 +269,7 @@ function renderPipelineRow(pipeline, latestRuns, runsKnown, now) {
{
class: `row${state.selectedPipelineId === pipeline.id ? " selected" : ""}`,
"data-pipeline-id": String(pipeline.id),
"data-animate-key": `pipeline:${pipeline.id}`,
onclick: () => selectPipeline(pipeline),
},
...children,
+1
View File
@@ -119,6 +119,7 @@ function renderRunRow(run, now) {
const row = h("button", {
class: `row run-row${state.selectedRunId === run.id ? " selected" : ""}`,
"data-run-id": String(run.id),
"data-animate-key": `run:${run.id}`,
onclick: () => selectRun(run.id),
});
+2
View File
@@ -3070,6 +3070,8 @@ try {
throw new Error(`the sort control did not change: ${sortLabel}`);
}
await page.waitForSelector(".list.runs .run-row", { timeout: 25000 });
// Let the list's FLIP settle before measuring a row for a click.
await settle(250);
shots.push(await page.screenshot(`${out}/15-runs-sorted.png`));
console.log(` sort control now: ${sortLabel}`);