dark glass gets a surface ladder, and the 200-750ms stalls are dead - two sessions of uncommitted work landing together
SURFACES: panes add black, surfaces INSIDE panes add white. Every pane stands on 0.7075 black over the acrylic (.content 0.35 over .app 0.55), so a translucent black card nets 0.81 - darker than its own pane and inside the ~0.85 band already rejected once on the artist page. Solid mode's ladder is measured UPWARD from #121212 (+6/+18/+24), so glass elevates with WHITE: new --glass-surface/-hover/-press/-hairline/-well/-ring under :root.glass (0.03/0.08/0.11/0.10/0.18), which is independently the vocabulary .btn-ghost:hover and .ax-ghost:hover already shipped. The four solid tokens are NEVER redefined - they are consumed inside color-mix() and gradient stops where an alpha multiplies through and kills the call site (0.74 x 0.03 = an invisible chip; the album row's text-overflow fade works by BEING opaque), and they paint modal chrome that has to stay solid. 129 additive :global(:root.glass) declarations across 18 files, all 129 verified inside a glass block by walking the diff - solid mode byte-identical, confirmed structurally, by computed style with the class off, and visually. Three of them are not colour swaps: the album row's .rowbtns shim was OCCLUDING the last ~19px of the listeners bar and nothing translucent can occlude, so .tcount masks out just before the buttons instead; Playlist's banner scrim and the discography's pinned ambience both landed on opaque --bg-base and now dissolve like the album banner; and the 0.9 black hero tint on Home/CatalogSearch/Discography paints straight onto the pane when there is no artwork, so :first-child (the {#if} renders no element) flips it to white. Menus, dialogs, toasts and the import surfaces stay opaque deliberately, and the Settings copy for the mode now says so instead of claiming cards do. Measured with a known ground substituted behind the transparent window, since CDP never sees the acrylic: library toolbar chroma +2 as shipped, +16 with a white fill AND its backdrop-filter dropped, +30 for the bare pane beside it. RESIZE: Windows drops the legacy accent-policy acrylic for the whole of a live resize and the window stays transparent through it, so the desktop punches through sharp - measured by toggling window_glass alone, desktop icon labels readable through the titlebar. The blur cannot be kept (documented since Win10 2004, and the modern DWM backdrop was already rejected for the overlay-promotion blink), so armGlassResizeGuard grounds the canvas to --bg-sidebar for the length of the gesture. STALLS: "choppy but the FPS says 144" was 200-750ms MAIN-THREAD TASKS, not frame pacing - idle-scheduled work fires at scroll pauses by definition. Twin bake moved to display resolution and off the ready task (was a same-task 4K WebGL readback plus software blur, 100-170ms per rotation AND per artist entry); gl.finish() -> gl.flush() in buildMaster, which had been draining the whole 4K EASU/RCAS/grade chain on the main thread; copyCanvas realloc guarded; one app-wide scroll clock in scrollbar.js (markAppScroll/appScrollIdleFor) so all three periscopes stop cloning mid-gesture on ANY pane rather than only their own; bounded reclone with the querySelectorAll census deleted, the gate widened 250->1000ms, and the build/attach split across an idle callback and a rAF behind a generation guard; the hero rotation tick gated on scroll recency and its payload cache sized to the working set (2->4 entries, 24->32MiB, 32->64MiB); sessionTick no longer force-rewrites every 12s while merely PAUSED. Scroll storm went from 109-616ms long tasks to zero. Hover recalc and GC were measured innocent - do not re-chase them. 98/98 tests throughout.
This commit is contained in:
1 parent
7ab678fd22
commit
547cee6649
26 files changed
+1220
-144
No files matched your search
@@ -33,7 +33,7 @@
|
||||
import LyricsPane from "./LyricsPane.svelte";
|
||||
import PlaylistMenu from "./PlaylistMenu.svelte";
|
||||
import * as api from "../lib/api.js";
|
||||
import { floatScroll } from "../lib/scrollbar.js";
|
||||
import { floatScroll, markAppScroll, appScrollIdleFor } from "../lib/scrollbar.js";
|
||||
import { splitDescription } from "../lib/editions.js";
|
||||
import { accentFromImage } from "../lib/color.js";
|
||||
import {
|
||||
@@ -353,10 +353,10 @@
|
||||
const view = npScrollEl;
|
||||
const peri = npPeriEl;
|
||||
let pending = 0;
|
||||
let lastScroll = 0;
|
||||
let lastNodes = 500;
|
||||
let recloneGen = 0;
|
||||
let lastRecloneMs = 4;
|
||||
const sync = () => {
|
||||
lastScroll = performance.now();
|
||||
markAppScroll();
|
||||
const c = peri.firstElementChild?.firstElementChild;
|
||||
if (c) c.style.transform = `translateY(${-view.scrollTop}px)`;
|
||||
};
|
||||
@@ -370,6 +370,11 @@
|
||||
// its measured width, so layout and alignment are unchanged.
|
||||
// height 142 = overscan + band + overscan: the filter rasters
|
||||
// this box, never the full cloned scroller.
|
||||
// BUILD, detached, measured — the duration feeds the next
|
||||
// debounce delay (see GlassBar; the old node census existed
|
||||
// only to guess it).
|
||||
const t0 = performance.now();
|
||||
const gen = ++recloneGen;
|
||||
const wrap = document.createElement("div");
|
||||
wrap.style.cssText =
|
||||
"position:absolute;top:-48px;left:-48px;right:-48px;height:142px;" +
|
||||
@@ -382,7 +387,6 @@
|
||||
c.style.height = "auto";
|
||||
c.style.overflow = "visible";
|
||||
c.querySelectorAll("canvas").forEach((n) => n.remove());
|
||||
lastNodes = c.querySelectorAll("*").length;
|
||||
// The overscan clears the FILTER's falloff, but the blur still
|
||||
// mixes with emptiness wherever the CONTENT ends at the clip
|
||||
// line — and the wash is the one full-bleed layer, so its edges
|
||||
@@ -397,14 +401,22 @@
|
||||
bleed.style.right = "-48px";
|
||||
}
|
||||
wrap.appendChild(c);
|
||||
const fresh = !peri.firstElementChild;
|
||||
if (fresh) {
|
||||
wrap.style.opacity = "0";
|
||||
wrap.style.transition = "opacity 160ms ease";
|
||||
}
|
||||
peri.replaceChildren(wrap);
|
||||
if (fresh) requestAnimationFrame(() => (wrap.style.opacity = "1"));
|
||||
sync();
|
||||
lastRecloneMs = performance.now() - t0;
|
||||
// ATTACH in its own frame (see GlassBar): the style+layout
|
||||
// flush of the whole clone never shares a task with its
|
||||
// construction; stale builds and resumed scrolling requeue.
|
||||
requestAnimationFrame(() => {
|
||||
if (gen !== recloneGen) return;
|
||||
if (!appScrollIdleFor(1000)) return queueReclone();
|
||||
const fresh = !peri.firstElementChild;
|
||||
if (fresh) {
|
||||
wrap.style.opacity = "0";
|
||||
wrap.style.transition = "opacity 160ms ease";
|
||||
}
|
||||
peri.replaceChildren(wrap);
|
||||
if (fresh) requestAnimationFrame(() => (wrap.style.opacity = "1"));
|
||||
sync();
|
||||
});
|
||||
};
|
||||
// Trailing debounce; no `class` in the filter — hover flips were
|
||||
// re-cloning per mouse move, and the fog doesn't read hover states.
|
||||
@@ -412,13 +424,24 @@
|
||||
// GlassBar note: big pages were janking frames with reclone tasks).
|
||||
const queueReclone = () => {
|
||||
clearTimeout(pending);
|
||||
const delay = Math.min(600, 120 + lastNodes / 40);
|
||||
const delay = Math.min(600, 120 + lastRecloneMs * 3);
|
||||
pending = setTimeout(() => {
|
||||
// Never clone mid-scroll, never while hidden (see GlassBar).
|
||||
// APP-WIDE scroll recency (scrollbar.js note), a full second
|
||||
// of it, re-checked inside the idle callback with no forcing
|
||||
// timeout, and the callback yields on a thin idle slice:
|
||||
// this pane's playback churn (queue rows, lyric lines, art)
|
||||
// used to queue a full-pane clone gated only on the NP
|
||||
// scroller's own last-scroll time, so it landed exactly when
|
||||
// the user paused scrolling the CONTENT pane.
|
||||
if (document.hidden) return;
|
||||
if (performance.now() - lastScroll < 250) return queueReclone();
|
||||
if (!appScrollIdleFor(1000)) return queueReclone();
|
||||
if ("requestIdleCallback" in window) {
|
||||
requestIdleCallback(() => reclone(), { timeout: 800 });
|
||||
requestIdleCallback((deadline) => {
|
||||
if (!appScrollIdleFor(1000)) return queueReclone();
|
||||
if (deadline && deadline.timeRemaining() < 15) return queueReclone();
|
||||
reclone();
|
||||
});
|
||||
} else {
|
||||
reclone();
|
||||
}
|
||||
@@ -427,6 +450,8 @@
|
||||
const mo = new MutationObserver((records) => {
|
||||
for (const r of records) {
|
||||
if (r.target === view && (r.addedNodes.length || r.removedNodes.length)) {
|
||||
// Invalidate any built-but-unattached clone (GlassBar note).
|
||||
recloneGen++;
|
||||
peri.replaceChildren();
|
||||
break;
|
||||
}
|
||||
@@ -448,6 +473,7 @@
|
||||
view.addEventListener("scroll", sync, { passive: true });
|
||||
reclone();
|
||||
return () => {
|
||||
recloneGen++;
|
||||
mo.disconnect();
|
||||
ro.disconnect();
|
||||
document.removeEventListener("visibilitychange", onVis);
|
||||
@@ -1808,6 +1834,76 @@
|
||||
-webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 96%);
|
||||
}
|
||||
|
||||
/* ── the chrome standing ON the frost (2026-08-27) ──────────────────
|
||||
Below the wash's dissolve the panel is bare frost, and everything on
|
||||
it was still painting opaque --bg-highlight: the quality chips, every
|
||||
queue and release row, the icon buttons, the art wells. See the ladder
|
||||
in global.css for why these elevate with white rather than more black.
|
||||
Solid mode keeps every original recipe. */
|
||||
:global(:root.glass) .chip {
|
||||
background: var(--glass-surface);
|
||||
box-shadow: var(--glass-ring);
|
||||
}
|
||||
:global(:root.glass) .np-icon:hover,
|
||||
:global(:root.glass) .row:hover,
|
||||
:global(:root.glass) .np-head :global(.plm-trigger:hover) {
|
||||
background: var(--glass-hover);
|
||||
}
|
||||
/* Artwork wells: what is visible while a cover loads, or in place of one
|
||||
that never arrives. */
|
||||
:global(:root.glass) .cover,
|
||||
:global(:root.glass) .un-fallback,
|
||||
:global(:root.glass) .achip-ph,
|
||||
:global(:root.glass) .av2,
|
||||
:global(:root.glass) .rel-th,
|
||||
:global(:root.glass) .mini .art {
|
||||
background: var(--glass-surface);
|
||||
}
|
||||
/* The segmented control's thumb was `color-mix(--accent 28%,
|
||||
--bg-highlight)` — accent-tinted but fully OPAQUE, so the one piece of
|
||||
chrome that marks which tab you are on read as a solid brown slab on
|
||||
the frost. This is the artist page's own tab recipe (.disco-tab.on),
|
||||
copied deliberately: the two controls do the same job and should not
|
||||
have two vocabularies. Nets 0.34 + 0.66x0.5 = 0.67 alpha. */
|
||||
:global(:root.glass) .seg-thumb {
|
||||
background: color-mix(in srgb, var(--accent) 34%, rgba(10, 10, 12, 0.5));
|
||||
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
|
||||
}
|
||||
/* The COLLAPSED rail's header wears the same .glass recipe as .np-head and
|
||||
had the same flatten, but none of the periscope machinery — and it needs
|
||||
none: the rail is a fixed column (header, edge, cover, dots), nothing
|
||||
scrolls beneath this bar, so the filter had nothing to blur in the first
|
||||
place. Dropping it removes a flattened slab and a backdrop pass. */
|
||||
:global(:root.glass) .rail-bar {
|
||||
backdrop-filter: none;
|
||||
-webkit-backdrop-filter: none;
|
||||
}
|
||||
|
||||
/* Hairlines. --border is opaque #2a2a2a, which on frost reads as a drawn
|
||||
grey line rather than an edge. These five all pair it with a translucent
|
||||
fill they already had, so only the border was out of step. */
|
||||
:global(:root.glass) .upnext,
|
||||
:global(:root.glass) .achip,
|
||||
:global(:root.glass) .fan,
|
||||
:global(:root.glass) .showall,
|
||||
:global(:root.glass) .seg {
|
||||
border-color: var(--glass-hairline);
|
||||
}
|
||||
/* The queue-count badge punches a 2px ring of opaque --bg-player around
|
||||
itself to separate it from the icon underneath. On frost that ring is a
|
||||
solid dot of #181818; the same separation comes from the frost itself. */
|
||||
:global(:root.glass) .rail-badge {
|
||||
box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
/* NOTE, deliberately NOT changed: .segwrap keeps its backdrop-filter.
|
||||
It is a bar that has to hide the rows scrolling under it, and over
|
||||
frost a backdrop sample black-flattens (the measurement lives in
|
||||
Sidebar.svelte). The shipped answer for a bar in that position is a
|
||||
periscope clone, not a thinner fill — three of those exist already and
|
||||
a fourth is a structural change, not a paint one. Left as a known
|
||||
slab; revisit with the periscope pattern if it starts to grate. */
|
||||
|
||||
/* ── the head periscope, dark glass only (see the script note) ──────
|
||||
The head drops its backdrop-filter (over frost it black-flattens
|
||||
into a slab — Sidebar.svelte holds the measurements), the scroller's
|
||||
|
||||
Reference in new issue
Block a user