Fix two album art bugs found in manual browser testing
CI / validate-monitoring (push) Successful in 9s
CI / lint (push) Successful in 11s
CI / federation-interop (push) Successful in 1m37s
CI / test (push) Successful in 3m24s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 6s
CI / validate-monitoring (push) Successful in 9s
CI / lint (push) Successful in 11s
CI / federation-interop (push) Successful in 1m37s
CI / test (push) Successful in 3m24s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 6s
- art.js revoked each thumbnail's blob: URL on its own "load" event, but the same URL is shared (via the lookup cache) by every thumbnail for that album on the page - revoking after the first one loaded broke every other <img> still using it. Stop revoking; this is a full-page-reload site, so the browser releases the memory on navigation anyway. - .ranking-art/.log-art thumbnails inherited their row's default cross-axis alignment (baseline for .ranking, stretch for .log), which suits text but left the art sitting high against two-line name+artist text. Center them explicitly instead. Verified in-browser across all four surfaces (song page hero, dashboard Albums ranking, Recently played, History) with real MusicBrainz/Cover Art Archive artwork. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Hn2QwS1HRT8tFAzo8ew63
This commit is contained in:
1 parent
dfd2ef868b
commit
f106d68921
2 files changed
+5
-1
No files matched your search
@@ -1128,6 +1128,7 @@ input {
|
||||
.ranking-art .art-thumb {
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
align-self: center; /* .ranking li aligns its other cells to baseline, which suits text, not art */
|
||||
}
|
||||
|
||||
.ranking-art .meter {
|
||||
@@ -1146,4 +1147,5 @@ input {
|
||||
.log-art .art-thumb {
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
align-self: center; /* .log li items default to stretch/start, which suits text, not art */
|
||||
}
|
||||
+3
-1
@@ -20,8 +20,10 @@ export function artThumb(artist, album, extraClass) {
|
||||
}
|
||||
cache.get(key).then((url) => {
|
||||
if (!url) return; // miss or failed fetch: leave the placeholder
|
||||
// Not revoked: the same URL is shared by every thumbnail for this album on the page
|
||||
// (see `cache` above), and this is a full-page-reload site, so the browser releases it
|
||||
// on navigation anyway.
|
||||
const img = h("img", { class: classes, alt: "", loading: "lazy" });
|
||||
img.addEventListener("load", () => URL.revokeObjectURL(url), { once: true });
|
||||
img.src = url;
|
||||
el.replaceWith(img);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user