Skip to content

Commit 9c96667

Browse files
committed
Default the detail carousel grid to the plain layout until content confirmed
The loading skeleton previously rendered inside #detail-carousel-wrap counted as "not empty," so the CSS :has() rule expanded into the risky carousel layout (full-width header, dead space beside the poster) on every page load, before the lazy fetch even resolved -- defeating the prior fix, which only handled the post-resolution empty case. - Drop the skeleton; the wrap starts truly empty so the safe, poster-beside-text layout (same as books) is what always renders first, for both TV/movie and season pages. The carousel layout only expands in once real trailer/photo content lands. - Removed the now-unused skeleton template.
1 parent a878d9c commit 9c96667

4 files changed

Lines changed: 45 additions & 39 deletions

File tree

src/static/css/input.css

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -644,39 +644,40 @@ html.light .theme-toggle-icon-moon {
644644
}
645645

646646
@media (min-width: 768px) {
647+
/* Default to the pre-carousel arrangement -- poster beside the
648+
title/chips/synopsis column, carousel pane hidden -- so a page whose
649+
carousel hasn't resolved yet (or never will) never shows the carousel's
650+
dead second column. Only once #detail-carousel-wrap is confirmed to
651+
hold a trailer/photos does the :has() rule below expand into the
652+
carousel's own two-row layout. */
647653
.detail-carousel-grid {
648654
column-gap: 2.5rem;
649655
grid-template-columns: 250px minmax(0, 1fr);
656+
grid-template-areas: "poster header" "poster chips" "poster synopsis";
657+
}
658+
659+
.detail-carousel-grid__header {
660+
margin-top: 0;
661+
}
662+
663+
/* Carousel confirmed non-empty: expand to the carousel's own two-row
664+
layout (title/actions spanning full width, carousel next to the
665+
poster) instead of the pre-carousel column arrangement above. */
666+
.detail-carousel-grid:has(#detail-carousel-wrap:not(:empty)) {
650667
grid-template-areas:
651668
"poster carousel"
652669
"header header"
653670
"chips chips"
654671
"synopsis synopsis";
655672
}
656673

657-
.detail-carousel-grid__carousel {
674+
.detail-carousel-grid:has(#detail-carousel-wrap:not(:empty)) .detail-carousel-grid__carousel {
658675
display: block;
659676
}
660677

661-
.detail-carousel-grid__header {
678+
.detail-carousel-grid:has(#detail-carousel-wrap:not(:empty)) .detail-carousel-grid__header {
662679
margin-top: 1.5rem;
663680
}
664-
665-
/* No trailer/photos to show (fragment swapped in empty): fall back to the
666-
pre-carousel arrangement, poster beside the title/chips/synopsis column
667-
instead of a carousel next to it, rather than stacking full-width rows
668-
below the poster and leaving its column dead. */
669-
.detail-carousel-grid:has(#detail-carousel-wrap:empty) {
670-
grid-template-areas: "poster header" "poster chips" "poster synopsis";
671-
}
672-
673-
.detail-carousel-grid:has(#detail-carousel-wrap:empty) .detail-carousel-grid__carousel {
674-
display: none;
675-
}
676-
677-
.detail-carousel-grid:has(#detail-carousel-wrap:empty) .detail-carousel-grid__header {
678-
margin-top: 0;
679-
}
680681
}
681682

682683
/* Mobile default: active playback card spans all columns on very small screens */

src/static/css/main.css

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2832,6 +2832,9 @@
28322832
.pl-10 {
28332833
padding-left: calc(var(--spacing) * 10);
28342834
}
2835+
.pl-12 {
2836+
padding-left: calc(var(--spacing) * 12);
2837+
}
28352838
.pl-\[37px\] {
28362839
padding-left: 37px;
28372840
}
@@ -3006,6 +3009,9 @@
30063009
.text-\[var\(--color-text-muted\)\] {
30073010
color: var(--color-text-muted);
30083011
}
3012+
.text-\[var\(--color-text-primary\)\] {
3013+
color: var(--color-text-primary);
3014+
}
30093015
.text-\[var\(--color-text-secondary\)\] {
30103016
color: var(--color-text-secondary);
30113017
}
@@ -4299,6 +4305,11 @@
42994305
--tw-ring-color: var(--color-accent);
43004306
}
43014307
}
4308+
.focus\:ring-amber-400 {
4309+
&:focus {
4310+
--tw-ring-color: var(--color-amber-400);
4311+
}
4312+
}
43024313
.focus\:ring-indigo-200 {
43034314
&:focus {
43044315
--tw-ring-color: var(--color-indigo-200);
@@ -6069,22 +6080,19 @@ html.light .theme-toggle-icon-moon {
60696080
.detail-carousel-grid {
60706081
column-gap: 2.5rem;
60716082
grid-template-columns: 250px minmax(0, 1fr);
6072-
grid-template-areas: "poster carousel" "header header" "chips chips" "synopsis synopsis";
6073-
}
6074-
.detail-carousel-grid__carousel {
6075-
display: block;
6083+
grid-template-areas: "poster header" "poster chips" "poster synopsis";
60766084
}
60776085
.detail-carousel-grid__header {
6078-
margin-top: 1.5rem;
6086+
margin-top: 0;
60796087
}
6080-
.detail-carousel-grid:has(#detail-carousel-wrap:empty) {
6081-
grid-template-areas: "poster header" "poster chips" "poster synopsis";
6088+
.detail-carousel-grid:has(#detail-carousel-wrap:not(:empty)) {
6089+
grid-template-areas: "poster carousel" "header header" "chips chips" "synopsis synopsis";
60826090
}
6083-
.detail-carousel-grid:has(#detail-carousel-wrap:empty) .detail-carousel-grid__carousel {
6084-
display: none;
6091+
.detail-carousel-grid:has(#detail-carousel-wrap:not(:empty)) .detail-carousel-grid__carousel {
6092+
display: block;
60856093
}
6086-
.detail-carousel-grid:has(#detail-carousel-wrap:empty) .detail-carousel-grid__header {
6087-
margin-top: 0;
6094+
.detail-carousel-grid:has(#detail-carousel-wrap:not(:empty)) .detail-carousel-grid__header {
6095+
margin-top: 1.5rem;
60886096
}
60896097
}
60906098
[data-active-playback-card] {

src/templates/app/components/detail_carousel_skeleton.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/templates/app/media_details.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,17 @@
2828
</div>
2929

3030
<div class="detail-carousel-grid__carousel relative min-w-0">
31+
{# Left empty (not a loading skeleton) so .detail-carousel-grid's
32+
:has(#detail-carousel-wrap:not(:empty)) rule in input.css only
33+
expands into the carousel layout once real content lands --
34+
a skeleton here would count as "not empty" and expand the
35+
grid immediately, showing the carousel's layout before we
36+
know whether there's anything to put in it. #}
3137
<div class="absolute inset-0"
3238
id="detail-carousel-wrap"
3339
hx-get="{{ detail_carousel_fragment_url }}"
3440
hx-trigger="load delay:100ms"
35-
hx-swap="innerHTML">{% include "app/components/detail_carousel_skeleton.html" %}</div>
41+
hx-swap="innerHTML"></div>
3642
</div>
3743

3844
<div class="detail-carousel-grid__header flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">

0 commit comments

Comments
 (0)