From d7763ec46645c3c339513787c5edb2cd35a8c34b Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Tue, 20 Oct 2026 01:41:51 +0100 Subject: [PATCH] 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. --- web/base.css | 29 ++++++++++++++++++ web/lists.css | 4 +++ web/src/app.js | 60 ++++++++++++++++++++++++++++++++++++++ web/src/views/pipelines.js | 1 + web/src/views/runs.js | 1 + web/test/ui-smoke.mjs | 2 ++ 6 files changed, 97 insertions(+) diff --git a/web/base.css b/web/base.css index 86506326..3214037b 100644 --- a/web/base.css +++ b/web/base.css @@ -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; } +} diff --git a/web/lists.css b/web/lists.css index 6946b8a6..3cbd08ce 100644 --- a/web/lists.css +++ b/web/lists.css @@ -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; } diff --git a/web/src/app.js b/web/src/app.js index f735594f..ba120973 100644 --- a/web/src/app.js +++ b/web/src/app.js @@ -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(); diff --git a/web/src/views/pipelines.js b/web/src/views/pipelines.js index 18c919f7..cc4f9651 100644 --- a/web/src/views/pipelines.js +++ b/web/src/views/pipelines.js @@ -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, diff --git a/web/src/views/runs.js b/web/src/views/runs.js index d49c7053..967acecb 100644 --- a/web/src/views/runs.js +++ b/web/src/views/runs.js @@ -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), }); diff --git a/web/test/ui-smoke.mjs b/web/test/ui-smoke.mjs index e70ecf30..f7164af5 100644 --- a/web/test/ui-smoke.mjs +++ b/web/test/ui-smoke.mjs @@ -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}`);