Fix discover carousel scaling

This commit is contained in:
2026-06-02 01:36:29 +08:00
parent d078339288
commit 893fe47ace
2 changed files with 79 additions and 22 deletions

View File

@@ -136,6 +136,11 @@ assert.match(
/#discover_root\s+\.room-list-carousel\s+\.room_thumbnail_container\s+img/,
"discover carousel thumbnail images should fill enlarged items",
);
assert.match(
capturedCss,
/#discover_root\s+\.room-list-carousel\s+\.room_thumbnail_container[\s\S]*height:\s*var\(--tm-thumb-discover-height\)\s*!important/,
"discover carousel thumbnail containers should use detected scaled height",
);
assert.match(
capturedCss,
/height:\s*var\(--tm-thumb-discover-triple-ul\)\s*!important/,
@@ -176,6 +181,9 @@ assert.match(source, /detectAndApplySizes/, "script should detect original sizes
assert.match(source, /moduleReady/, "script should lock each module after detecting its original size");
assert.match(source, /CARD_HEIGHT_SCALE/, "script should use a separate scale for card heights");
assert.match(source, /setCardHeightVar/, "script should apply card height scaling separately from thumbnail scaling");
assert.match(source, /setDiscoverStackHeightVars/, "discover carousel stack heights should be derived from scaled card rows");
assert.match(source, /setCardHeightFromThumbVar\("--tm-thumb-discover-card-height"/, "discover card height should scale the thumbnail area and keep metadata height");
assert.match(source, /stackHeight == null\) return true/, "discover should not require every carousel row type to exist before enabling");
assert.doesNotMatch(source, /localStorage\.setItem/, "script should not write detected sizes to localStorage");
assert.match(source, /LEGACY_CACHE_PREFIX/, "script should only keep legacy cache cleanup support");
assert.match(source, /scheduleMeasure\("after-800ms"\)/, "script should delay the first page measurement until original layout can render");