fix: container padding (#19316)

This commit is contained in:
Jason Rasmussen 2025-06-19 22:33:12 -04:00 committed by GitHub
parent bce4f93c90
commit dd8969cb7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 35 additions and 34 deletions

View File

@ -35,7 +35,7 @@
children, children,
}: Props = $props(); }: Props = $props();
let scrollbarClass = $derived(scrollbar ? 'immich-scrollbar p-2' : 'scrollbar-hidden'); let scrollbarClass = $derived(scrollbar ? 'immich-scrollbar' : 'scrollbar-hidden');
let hasTitleClass = $derived(title ? 'top-16 h-[calc(100%-(--spacing(16)))]' : 'top-0 h-full'); let hasTitleClass = $derived(title ? 'top-16 h-[calc(100%-(--spacing(16)))]' : 'top-0 h-full');
</script> </script>
@ -60,7 +60,7 @@
{/if} {/if}
<main class="relative"> <main class="relative">
<div class="{scrollbarClass} absolute {hasTitleClass} w-full overflow-y-auto" use:useActions={use}> <div class="{scrollbarClass} absolute {hasTitleClass} w-full overflow-y-auto p-2" use:useActions={use}>
{@render children?.()} {@render children?.()}
</div> </div>

View File

@ -145,19 +145,19 @@
{#if !singleSelect && ((hoveredDayGroup === dayGroup.groupTitle && isMouseOverGroup) || assetInteraction.selectedGroup.has(dayGroup.groupTitle))} {#if !singleSelect && ((hoveredDayGroup === dayGroup.groupTitle && isMouseOverGroup) || assetInteraction.selectedGroup.has(dayGroup.groupTitle))}
<div <div
transition:fly={{ x: -24, duration: 200, opacity: 0.5 }} transition:fly={{ x: -24, duration: 200, opacity: 0.5 }}
class="inline-block px-2 hover:cursor-pointer" class="inline-block pe-2 hover:cursor-pointer"
onclick={() => handleSelectGroup(dayGroup.groupTitle, assetsSnapshot(dayGroup.getAssets()))} onclick={() => handleSelectGroup(dayGroup.groupTitle, assetsSnapshot(dayGroup.getAssets()))}
onkeydown={() => handleSelectGroup(dayGroup.groupTitle, assetsSnapshot(dayGroup.getAssets()))} onkeydown={() => handleSelectGroup(dayGroup.groupTitle, assetsSnapshot(dayGroup.getAssets()))}
> >
{#if assetInteraction.selectedGroup.has(dayGroup.groupTitle)} {#if assetInteraction.selectedGroup.has(dayGroup.groupTitle)}
<Icon path={mdiCheckCircle} size="24" color="#4250af" /> <Icon path={mdiCheckCircle} size="24" class="text-primary" />
{:else} {:else}
<Icon path={mdiCircleOutline} size="24" color="#757575" /> <Icon path={mdiCircleOutline} size="24" color="#757575" />
{/if} {/if}
</div> </div>
{/if} {/if}
<span class="w-full truncate first-letter:capitalize ms-2.5" title={dayGroup.groupTitle}> <span class="w-full truncate first-letter:capitalize" title={dayGroup.groupTitle}>
{dayGroup.groupTitle} {dayGroup.groupTitle}
</span> </span>
</div> </div>

View File

@ -39,7 +39,7 @@
<section <section
id="memory-lane" id="memory-lane"
bind:this={memoryLaneElement} bind:this={memoryLaneElement}
class="relative mt-5 mx-2 overflow-x-scroll overflow-y-hidden whitespace-nowrap transition-all" class="relative mt-3 overflow-x-scroll overflow-y-hidden whitespace-nowrap transition-all"
style="scrollbar-width:none" style="scrollbar-width:none"
use:resizeObserver={({ width }) => (offsetWidth = width)} use:resizeObserver={({ width }) => (offsetWidth = width)}
onscroll={onScroll} onscroll={onScroll}

View File

@ -80,15 +80,15 @@ describe('TimelineManager', () => {
expect(plainMonths).toEqual( expect(plainMonths).toEqual(
expect.arrayContaining([ expect.arrayContaining([
expect.objectContaining({ year: 2024, month: 3, height: 185.5 }), expect.objectContaining({ year: 2024, month: 3, height: 165.5 }),
expect.objectContaining({ year: 2024, month: 2, height: 12_016 }), expect.objectContaining({ year: 2024, month: 2, height: 11_996 }),
expect.objectContaining({ year: 2024, month: 1, height: 286 }), expect.objectContaining({ year: 2024, month: 1, height: 286 }),
]), ]),
); );
}); });
it('calculates timeline height', () => { it('calculates timeline height', () => {
expect(timelineManager.timelineHeight).toBe(12_487.5); expect(timelineManager.timelineHeight).toBe(12_447.5);
}); });
}); });

View File

@ -96,6 +96,7 @@ export function justifiedLayout(assets: (TimelineAsset | AssetResponseDto)[], op
containerWidth: options.rowWidth, containerWidth: options.rowWidth,
boxSpacing: options.spacing, boxSpacing: options.spacing,
targetRowHeightTolerange: options.heightTolerance, targetRowHeightTolerange: options.heightTolerance,
containerPadding: 0,
}; };
const result = createJustifiedLayout( const result = createJustifiedLayout(

View File

@ -443,7 +443,7 @@
<div class="flex overflow-hidden" use:scrollMemoryClearer={{ routeStartsWith: AppRoute.ALBUMS }}> <div class="flex overflow-hidden" use:scrollMemoryClearer={{ routeStartsWith: AppRoute.ALBUMS }}>
<div class="relative w-full shrink"> <div class="relative w-full shrink">
<main class="relative h-dvh overflow-hidden px-6 max-md:pt-(--navbar-height-md) pt-(--navbar-height)"> <main class="relative h-dvh overflow-hidden px-2 md:px-6 max-md:pt-(--navbar-height-md) pt-(--navbar-height)">
<AssetGrid <AssetGrid
enableRouting={viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : true} enableRouting={viewMode === AlbumPageViewMode.SELECT_ASSETS ? false : true}
{album} {album}

View File

@ -42,8 +42,9 @@
}; };
</script> </script>
<main class="grid h-dvh pt-18"> <main class="relative h-dvh overflow-hidden px-2 md:px-6 max-md:pt-(--navbar-height-md) pt-(--navbar-height)">
<AssetGrid enableRouting={true} {timelineManager} {assetInteraction} onEscape={handleEscape} /> <AssetGrid enableRouting={true} {timelineManager} {assetInteraction} onEscape={handleEscape} />
</main>
{#if assetInteraction.selectionActive} {#if assetInteraction.selectionActive}
<AssetSelectControlBar <AssetSelectControlBar
@ -66,4 +67,3 @@
{/snippet} {/snippet}
</ControlAppBar> </ControlAppBar>
{/if} {/if}
</main>

View File

@ -374,7 +374,7 @@
</script> </script>
<main <main
class="relative z-0 h-dvh overflow-hidden tall:ms-4 md:pt-(--navbar-height-md) pt-(--navbar-height)" class="relative z-0 h-dvh overflow-hidden px-2 md:px-6 md:pt-(--navbar-height-md) pt-(--navbar-height)"
use:scrollMemoryClearer={{ use:scrollMemoryClearer={{
routeStartsWith: AppRoute.PEOPLE, routeStartsWith: AppRoute.PEOPLE,
beforeClear: () => { beforeClear: () => {