chore(format): run prettier over src/ and scripts/
Formatting was configured but never enforced: `bun run format:check` reported 199 unformatted files and ran in no workflow and in no git hook, so .prettierrc (printWidth 100, trailing commas) described an intention rather than the tree. This is the one-time sweep that makes the check gateable. Whitespace and token-reflow only -- no behavioural change: `bun run check` reports 0 errors and all 1053 frontend tests pass before and after. Kept out of every other commit on purpose. A 199-file diff mixed with real changes is unreviewable, and the next commit turns format:check into a hard CI gate so this cannot silently accumulate again.
This commit is contained in:
+132
-119
@@ -115,7 +115,7 @@
|
||||
|
||||
// Playlist libraries live inside the Music landing page, not as top-level shortcuts.
|
||||
const shortcutLibraries = $derived(
|
||||
$libraries.filter((lib) => lib.collectionType !== "playlists")
|
||||
$libraries.filter((lib) => lib.collectionType !== "playlists"),
|
||||
);
|
||||
|
||||
// The shortcut strip is a mosaic row: one height, each tile as wide as its own
|
||||
@@ -124,7 +124,11 @@
|
||||
// TRACES: UR-075 | DR-174
|
||||
const LIBRARY_STRIP_HEIGHT = 132;
|
||||
const libraryTiles = $derived(
|
||||
shortcutLibraries.map((lib) => ({ key: lib.id, ratio: assumedLibraryRatio(lib), library: lib }))
|
||||
shortcutLibraries.map((lib) => ({
|
||||
key: lib.id,
|
||||
ratio: assumedLibraryRatio(lib),
|
||||
library: lib,
|
||||
})),
|
||||
);
|
||||
|
||||
function handleLibraryClick(lib: Library) {
|
||||
@@ -148,9 +152,9 @@
|
||||
}
|
||||
|
||||
const heroItems = $derived($home.heroItems);
|
||||
const resumeItems = $derived($home.resumeItems.filter(
|
||||
i => i.kind === "movie" || i.kind === "episode"
|
||||
));
|
||||
const resumeItems = $derived(
|
||||
$home.resumeItems.filter((i) => i.kind === "movie" || i.kind === "episode"),
|
||||
);
|
||||
const nextUpItems = $derived($home.nextUpItems);
|
||||
const latestItems = $derived($home.latestItems);
|
||||
const recentlyPlayedAudio = $derived($home.recentlyPlayedAudio);
|
||||
@@ -165,136 +169,145 @@
|
||||
|
||||
{#if isLoading}
|
||||
<div class="h-full flex justify-center items-center">
|
||||
<div class="w-8 h-8 border-2 border-[var(--color-jellyfin)] border-t-transparent rounded-full animate-spin"></div>
|
||||
<div
|
||||
class="w-8 h-8 border-2 border-[var(--color-jellyfin)] border-t-transparent rounded-full animate-spin"
|
||||
></div>
|
||||
</div>
|
||||
{:else}
|
||||
<div bind:this={homeScroller} class="h-full overflow-y-auto p-4 pb-16 md:pb-4 {isAndroid && $currentMedia && $currentMedia.type !== 'Movie' && $currentMedia.type !== 'Episode' ? 'pb-40' : ''}">
|
||||
<div
|
||||
bind:this={homeScroller}
|
||||
class="h-full overflow-y-auto p-4 pb-16 md:pb-4 {isAndroid &&
|
||||
$currentMedia &&
|
||||
$currentMedia.type !== 'Movie' &&
|
||||
$currentMedia.type !== 'Episode'
|
||||
? 'pb-40'
|
||||
: ''}"
|
||||
>
|
||||
<div class="space-y-8">
|
||||
<!-- Hero Banner -->
|
||||
{#if heroItems.length > 0}
|
||||
<HeroBanner items={heroItems} />
|
||||
{/if}
|
||||
|
||||
<!-- Hero Banner -->
|
||||
{#if heroItems.length > 0}
|
||||
<HeroBanner items={heroItems} />
|
||||
{/if}
|
||||
|
||||
<!-- Your Libraries: quick jump into each dedicated landing page -->
|
||||
{#if shortcutLibraries.length > 0}
|
||||
<div>
|
||||
<h2 class="text-xl font-bold text-white mb-4 px-4">Your Libraries</h2>
|
||||
<div class="px-4">
|
||||
<MosaicGrid
|
||||
items={libraryTiles}
|
||||
layout="strip"
|
||||
targetHeight={LIBRARY_STRIP_HEIGHT}
|
||||
gap={12}
|
||||
>
|
||||
{#snippet tile(entry)}
|
||||
<MosaicTile
|
||||
label={entry.library.name}
|
||||
width={entry.width}
|
||||
height={entry.height}
|
||||
itemId={entry.library.id}
|
||||
imageTag={entry.library.imageTag}
|
||||
onRatio={entry.reportRatio}
|
||||
onclick={() => handleLibraryClick(entry.library)}
|
||||
/>
|
||||
{/snippet}
|
||||
</MosaicGrid>
|
||||
<!-- Your Libraries: quick jump into each dedicated landing page -->
|
||||
{#if shortcutLibraries.length > 0}
|
||||
<div>
|
||||
<h2 class="text-xl font-bold text-white mb-4 px-4">Your Libraries</h2>
|
||||
<div class="px-4">
|
||||
<MosaicGrid
|
||||
items={libraryTiles}
|
||||
layout="strip"
|
||||
targetHeight={LIBRARY_STRIP_HEIGHT}
|
||||
gap={12}
|
||||
>
|
||||
{#snippet tile(entry)}
|
||||
<MosaicTile
|
||||
label={entry.library.name}
|
||||
width={entry.width}
|
||||
height={entry.height}
|
||||
itemId={entry.library.id}
|
||||
imageTag={entry.library.imageTag}
|
||||
onRatio={entry.reportRatio}
|
||||
onclick={() => handleLibraryClick(entry.library)}
|
||||
/>
|
||||
{/snippet}
|
||||
</MosaicGrid>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<!-- Next Movie -->
|
||||
{#if resumeMovies.length > 0}
|
||||
<Carousel
|
||||
title="Next Movie"
|
||||
items={resumeMovies}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
<!-- Next Movie -->
|
||||
{#if resumeMovies.length > 0}
|
||||
<Carousel
|
||||
title="Next Movie"
|
||||
items={resumeMovies}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Next Episode -->
|
||||
{#if nextUpItems.length > 0}
|
||||
<Carousel
|
||||
title="Next Episode"
|
||||
items={nextUpItems}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
<!-- Next Episode -->
|
||||
{#if nextUpItems.length > 0}
|
||||
<Carousel
|
||||
title="Next Episode"
|
||||
items={nextUpItems}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Recently Listened -->
|
||||
{#if recentlyPlayedAudio.length > 0}
|
||||
<Carousel
|
||||
title="Recently Listened"
|
||||
items={recentlyPlayedAudio}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
<!-- Recently Listened -->
|
||||
{#if recentlyPlayedAudio.length > 0}
|
||||
<Carousel
|
||||
title="Recently Listened"
|
||||
items={recentlyPlayedAudio}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Continue Watching -->
|
||||
{#if resumeItems.length > 0}
|
||||
<Carousel
|
||||
title="Continue Watching"
|
||||
items={resumeItems}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
<!-- Continue Watching -->
|
||||
{#if resumeItems.length > 0}
|
||||
<Carousel
|
||||
title="Continue Watching"
|
||||
items={resumeItems}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Recently Added -->
|
||||
{#if latestItems.length > 0}
|
||||
<Carousel
|
||||
title="Recently Added"
|
||||
items={latestItems}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
<!-- Recently Added -->
|
||||
{#if latestItems.length > 0}
|
||||
<Carousel
|
||||
title="Recently Added"
|
||||
items={latestItems}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Favourites. Hidden entirely when a category has nothing in it —
|
||||
<!-- Favourites. Hidden entirely when a category has nothing in it —
|
||||
empty rows on a fresh install read as broken. ux-flows §5C.2.
|
||||
TRACES: UR-067 | DR-118 -->
|
||||
{#if favoriteMovies.length > 0}
|
||||
<Carousel
|
||||
title="Favourite Movies"
|
||||
items={favoriteMovies}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
showAll={() => goto("/library/favorites?scope=movies")}
|
||||
/>
|
||||
{/if}
|
||||
{#if favoriteMovies.length > 0}
|
||||
<Carousel
|
||||
title="Favourite Movies"
|
||||
items={favoriteMovies}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
showAll={() => goto("/library/favorites?scope=movies")}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if favoriteShows.length > 0}
|
||||
<Carousel
|
||||
title="Favourite Shows"
|
||||
items={favoriteShows}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
showAll={() => goto("/library/favorites?scope=tv")}
|
||||
/>
|
||||
{/if}
|
||||
{#if favoriteShows.length > 0}
|
||||
<Carousel
|
||||
title="Favourite Shows"
|
||||
items={favoriteShows}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
showAll={() => goto("/library/favorites?scope=tv")}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if favoriteMusic.length > 0}
|
||||
<Carousel
|
||||
title="Favourite Music"
|
||||
items={favoriteMusic}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
showAll={() => goto("/library/favorites?scope=music")}
|
||||
/>
|
||||
{/if}
|
||||
{#if favoriteMusic.length > 0}
|
||||
<Carousel
|
||||
title="Favourite Music"
|
||||
items={favoriteMusic}
|
||||
onItemClick={handleItemClick}
|
||||
onItemLongPress={handleItemLongPress}
|
||||
showAll={() => goto("/library/favorites?scope=music")}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
<!-- Quick Access -->
|
||||
<div class="pt-4 px-4">
|
||||
<button
|
||||
onclick={() => goto("/library")}
|
||||
class="text-[var(--color-jellyfin)] hover:underline text-lg"
|
||||
>
|
||||
Browse all libraries →
|
||||
</button>
|
||||
</div>
|
||||
<!-- Quick Access -->
|
||||
<div class="pt-4 px-4">
|
||||
<button
|
||||
onclick={() => goto("/library")}
|
||||
class="text-[var(--color-jellyfin)] hover:underline text-lg"
|
||||
>
|
||||
Browse all libraries →
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user