Skip to content

Commit b95c51e

Browse files
committed
fixup! feat(summary): route episode cards to the episode drawer
1 parent 07f49be commit b95c51e

1 file changed

Lines changed: 48 additions & 31 deletions

File tree

projects/client/src/lib/sections/summary/components/episode-drawer/_internal/EpisodeInfoHeader.svelte

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -178,29 +178,35 @@
178178
</div>
179179

180180
<div class="episode-info-meta">
181-
{#if subtitle != null}
182-
<p class="secondary small" in:fade={fadeIn}>{subtitle}</p>
183-
{:else}
184-
<Skeleton width="var(--ni-220)" height="var(--ni-14)" />
185-
{/if}
181+
<div class="episode-info-meta-line">
182+
{#if subtitle != null}
183+
<p class="secondary small" in:fade={fadeIn}>{subtitle}</p>
184+
{:else}
185+
<Skeleton width="var(--ni-220)" height="var(--ni-14)" />
186+
{/if}
187+
</div>
186188

187-
{#if isCrewLoading}
188-
<Skeleton width="var(--ni-140)" height="var(--ni-14)" />
189-
{:else if mainCredit}
190-
<p class="small episode-main-credit" in:fade={fadeIn}>
191-
<MessageWithLink
192-
message={mainCredit.text}
193-
href={UrlBuilder.people(mainCredit.key, mainCredit.positions)}
194-
target="_self"
195-
/>{#if mainCredit.others?.[0]}{creditSeparator}<Link
196-
href={UrlBuilder.people(
197-
mainCredit.others[0].key,
198-
mainCredit.positions,
199-
)}
200-
target="_self">{mainCredit.others[0].name}</Link
201-
>{/if}
202-
</p>
203-
{/if}
189+
<!-- Always reserved: not every episode has a director, so the line keeps
190+
its height whether it holds a credit, a skeleton, or nothing. -->
191+
<div class="episode-info-meta-line">
192+
{#if isCrewLoading || !entry}
193+
<Skeleton width="var(--ni-140)" height="var(--ni-14)" />
194+
{:else if mainCredit}
195+
<p class="small episode-main-credit" in:fade={fadeIn}>
196+
<MessageWithLink
197+
message={mainCredit.text}
198+
href={UrlBuilder.people(mainCredit.key, mainCredit.positions)}
199+
target="_self"
200+
/>{#if mainCredit.others?.[0]}{creditSeparator}<Link
201+
href={UrlBuilder.people(
202+
mainCredit.others[0].key,
203+
mainCredit.positions,
204+
)}
205+
target="_self">{mainCredit.others[0].name}</Link
206+
>{/if}
207+
</p>
208+
{/if}
209+
</div>
204210
</div>
205211

206212
<div class="episode-info-actions">
@@ -215,9 +221,7 @@
215221
/>
216222
</RenderFor>
217223

218-
<div class="episode-info-rate-now">
219-
<RateNow type="episode" media={entry} {show} />
220-
</div>
224+
<RateNow type="episode" media={entry} {show} />
221225
</div>
222226
{:else}
223227
<Skeleton
@@ -237,7 +241,7 @@
237241
label={m.button_label_expand_media_overview({
238242
title: show.title,
239243
})}
240-
lineCount={6}
244+
lineCount={3}
241245
>
242246
{entry.overview}
243247
</ClampedText>
@@ -355,6 +359,15 @@
355359
text-align: center;
356360
}
357361
362+
// Each line keeps a fixed height so swapping skeleton <-> text, or having no
363+
// credit at all, never shifts the layout below.
364+
.episode-info-meta-line {
365+
display: flex;
366+
align-items: center;
367+
justify-content: center;
368+
min-height: var(--ni-16);
369+
}
370+
358371
.episode-main-credit {
359372
:global(.trakt-link) {
360373
text-decoration-thickness: var(--ni-1);
@@ -367,6 +380,10 @@
367380
display: flex;
368381
flex-direction: column;
369382
align-items: center;
383+
384+
// Match the skeleton / actions-bar height so the area never collapses
385+
// below it while the entry loads or when there are no actions to show.
386+
min-height: var(--ni-56);
370387
}
371388
372389
.episode-info-actions-content {
@@ -382,18 +399,18 @@
382399
}
383400
}
384401
385-
.episode-info-rate-now {
386-
display: flex;
387-
justify-content: center;
388-
}
389-
390402
.episode-info-overview {
391403
align-self: stretch;
392404
393405
margin-top: var(--gap-s);
394406
395407
text-align: start;
396408
409+
// Reserve exactly three lines (matching ClampedText's lineCount and 150%
410+
// line-height) so the skeleton and the loaded overview occupy the same
411+
// height and the tabs below never jump.
412+
min-height: calc(3 * var(--font-size-text) * 1.5);
413+
397414
:global(.trakt-collapsable-content-button) {
398415
width: 100%;
399416
box-sizing: border-box;

0 commit comments

Comments
 (0)