diff --git a/e2e/src/ui/mock-network/map-network.ts b/e2e/src/ui/mock-network/map-network.ts new file mode 100644 index 0000000000..812b472e67 --- /dev/null +++ b/e2e/src/ui/mock-network/map-network.ts @@ -0,0 +1,32 @@ +import type { MapMarkerResponseDto } from '@immich/sdk'; +import { BrowserContext } from '@playwright/test'; +import { TimelineData } from 'src/ui/generators/timeline'; + +export const setupMapMockApiRoutes = async (context: BrowserContext, timelineData: TimelineData) => { + await context.route('**/api/map/markers', async (route) => { + const markers: MapMarkerResponseDto[] = []; + + for (const bucket of timelineData.buckets.values()) { + for (const asset of bucket) { + // Only include assets with GPS coordinates + if (asset.latitude !== null && asset.longitude !== null) { + markers.push({ + id: asset.id, + lat: asset.latitude, + lon: asset.longitude, + city: asset.city, + state: null, + country: asset.country, + }); + } + } + } + markers.sort((a, b) => a.id.localeCompare(b.id)); + + return route.fulfill({ + status: 200, + contentType: 'application/json', + json: markers, + }); + }); +}; diff --git a/e2e/src/ui/specs/map/utils.ts b/e2e/src/ui/specs/map/utils.ts index cde5aa6359..80bd0a6f9c 100644 --- a/e2e/src/ui/specs/map/utils.ts +++ b/e2e/src/ui/specs/map/utils.ts @@ -72,8 +72,6 @@ export const mapUtils = { return page.getByLabel(/map settings/i); }, - - /** * Verify all standard map controls are visible */ diff --git a/web/src/lib/components/shared-components/map/Map.svelte b/web/src/lib/components/shared-components/map/Map.svelte index 3ad4d8554d..452ba3ee09 100644 --- a/web/src/lib/components/shared-components/map/Map.svelte +++ b/web/src/lib/components/shared-components/map/Map.svelte @@ -397,7 +397,7 @@ {#if onToggleTimeline} - onToggleTimeline?.()}> + onToggleTimeline?.()}> >(); - // Mobile Bottom Sheet State - let sheetHeight = $state(50); - let isDraggingSheet = $state(false); - let innerWidth = $state(1024); - let isMobile = $derived(innerWidth < 768); - const isSameBbox = (a: SelectionBBox | undefined, b: SelectionBBox) => { if (!a) { return false; @@ -50,7 +44,6 @@ selectedClusterBBox = undefined; selectedClusterIds = new Set(); visibleAssetIds = undefined; - sheetHeight = 50; // Reset for next open } function toggleTimeline() { diff --git a/web/src/routes/(user)/map/[[photos=photos]]/[[assetId=id]]/MapTimelinePanel.svelte b/web/src/routes/(user)/map/[[photos=photos]]/[[assetId=id]]/MapTimelinePanel.svelte index 6f01b8df45..2d9e4a2393 100644 --- a/web/src/routes/(user)/map/[[photos=photos]]/[[assetId=id]]/MapTimelinePanel.svelte +++ b/web/src/routes/(user)/map/[[photos=photos]]/[[assetId=id]]/MapTimelinePanel.svelte @@ -139,7 +139,7 @@

- {$t('assets_count', { values: { count: timelineManager?.assetsCount ?? 0 } })} + {$t('assets_count', { values: { count: timelineManager?.assetCount ?? 0 } })}