From fe5a0cf6d3bbffc4541ec55cf54210071b1f3495 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 11 Nov 2026 21:01:25 +0800 Subject: [PATCH] gui: the nav's groups and masking tabs fly with the rest as the layouts trade places (#5434, invzhi on X, patch by ggbdpq) The morph gives each nav tab a view-transition-name of its own (app.css .nav-morph), but the list stopped at the eight tabs that existed when it landed; Routing groups and Masking came later and only faded with the whole sidebar. Both are in the list now, in the nav's order (ggbdpq's analysis and patch on #5434, which sat without a PR since 11-08). side-toggle.test.cjs now holds the masking tab's group to animating and every tab drawn in the nav to a name of its own, all different, so the next tab can't be left out. Run on mote: red on the old CSS in chromium and webkit (no nav-masking group), 26 of 26 green after. Durations and curve are the morph's existing .32s strong ease-in-out, unchanged. Not tried: the live app; Routing groups is display:none in the header layout, so its group is a fade there, as before. --- internal/gui/assets/app.css | 2 ++ internal/gui/tests/side-toggle.test.cjs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 98b55685f..5f0babba2 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -595,8 +595,10 @@ body:not(.side-nav) .side-toggle .st-pane { opacity: 0; } .nav-morph #nav button[data-view="library"] { view-transition-name: nav-library; } .nav-morph #nav button[data-view="providers"] { view-transition-name: nav-providers; } .nav-morph #nav button[data-view="routing"] { view-transition-name: nav-routing; } +.nav-morph #nav button[data-view="groups"] { view-transition-name: nav-groups; } .nav-morph #nav button[data-view="gateway"] { view-transition-name: nav-gateway; } .nav-morph #nav button[data-view="usage"] { view-transition-name: nav-usage; } +.nav-morph #nav button[data-view="masking"] { view-transition-name: nav-masking; } .nav-morph #nav button[data-view="plugins"] { view-transition-name: nav-plugins; } ::view-transition-group(*) { z-index: 1; animation-duration: var(--morph-t); animation-timing-function: var(--morph-ease); } ::view-transition-old(*), ::view-transition-new(*) { inline-size: auto; block-size: auto; } diff --git a/internal/gui/tests/side-toggle.test.cjs b/internal/gui/tests/side-toggle.test.cjs index 79b552225..eb8051e22 100644 --- a/internal/gui/tests/side-toggle.test.cjs +++ b/internal/gui/tests/side-toggle.test.cjs @@ -210,6 +210,16 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.ok(p.anims.includes("::view-transition-old(side)"), `the sidebar slides away: ${p.anims}`); assert.ok(p.anims.includes("::view-transition-group(nav-usage)"), "each tab flies to the header"); assert.ok(p.anims.includes("::view-transition-group(page)"), "the page moves over"); + // no tab is left out (#5434, invzhi on X): every tab drawn in the nav + // has a name of its own while the morph plays, the masking tab's + // group animating like the rest + assert.ok(p.anims.includes("::view-transition-group(nav-masking)"), `the masking tab flies too: ${p.anims}`); + const names = await page.evaluate(() => [...document.querySelectorAll("#nav button[data-view]")] + .filter((b) => b.getClientRects().length) + .map((b) => [b.dataset.view, getComputedStyle(b).viewTransitionName])); + assert.ok(names.some(([v]) => v === "masking"), "the fixture draws the masking tab"); + for (const [v, n] of names) assert.ok(n && n !== "none", `${v} has a view-transition-name while morphing`); + assert.equal(new Set(names.map(([, n]) => n)).size, names.length, `each name differs: ${JSON.stringify(names)}`); // off from rest and settling, in a third of a second, as a Mac's // sidebar: a curve leaving at speed made a frame the webview drops at // the start a visible jerk (wangye1644294 on X), and every piece, the