π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Remove trip layout from photos app
Anand Baburajan585899d588d1
diff --git a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsxindex 94f083205f..4386c71ac7 100644--- a/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx+++ b/web/apps/photos/src/components/Collections/CollectionMapDialog.tsx@@ -55,8 +55,6 @@ import Supercluster from "supercluster";import type { SelectedState } from "utils/file";import type { FileListWithViewerProps } from "../FileListWithViewer";import { FileListWithViewer } from "../FileListWithViewer";-import { calculateOptimalZoom } from "../TripLayout/mapHelpers";-import type { JourneyPoint } from "../TripLayout/types";interface CollectionMapDialogPropsextends ModalVisibilityProps,@@ -147,6 +145,16 @@ interface MapIndexPoint {timestamp: number;}+interface MapPhotoPoint {+ lat: number;+ lng: number;+ name: string;+ country: string;+ timestamp: string;+ image: string;+ fileId: number;+}+/*** Along with the GeoTagged photos we are also storing a metadata, which changes* only when there is change in the stored values, to prevent this from updating@@ -245,6 +253,7 @@ type SuperclusterConstructor = new (options?: MapClusterOptions) => MapIndex;//OpenStreetMap only supports clustering till this zoom level and this tell the supercluster what the max limit is for the zoom.const MAX_MAP_ZOOM = 19;+const DEFAULT_MAP_ZOOM = 10;//Instead of loading just the tiles which are in view, we're actually loading the 15% of the surrounding zone as well for smoother experience.//Leaflet LatLngBounds.pad expects a ratio (0.15 = 15%).const PREFETCH_BOUNDS_PADDING = 0.15;@@ -932,7 +941,7 @@ function useFavorites(* @returns An object containing the visible photos array and setter.*/function useVisiblePhotos() {- const [visiblePhotos, setVisiblePhotos] = useState<JourneyPoint[]>([]);+ const [visiblePhotos, setVisiblePhotos] = useState<MapPhotoPoint[]>([]);const [isVisiblePhotosUpdating, setIsVisiblePhotosUpdating] =useState(false);@@ -957,12 +966,11 @@ function createMarkerIcon(// eslint-disable-next-line @typescript-eslint/no-require-importsconst leaflet = require("leaflet") as typeof import("leaflet");- const pinSize = size + 16; // Add padding for consistent sizing with TripLayout+ const pinSize = size + 16;const triangleHeight = 10;const pinHeight = pinSize + triangleHeight + 2;const hasImage = imageSrc && imageSrc.trim() !== "";- // Border radius matching TripLayout styleconst outerBorderRadius = 16;const innerBorderRadius = 12;@@ -1033,13 +1041,12 @@ function createClusterIcon(// eslint-disable-next-line @typescript-eslint/no-require-importsconst leaflet = require("leaflet") as typeof import("leaflet");- const pinSize = size + 16; // Add padding for consistent sizing with TripLayout+ const pinSize = size + 16;const triangleHeight = 10;const pinHeight = pinSize + triangleHeight + 2;const hasImage = imageSrc && imageSrc.trim() !== "";const badgeOverflow = 6;- // Border radius matching TripLayout styleconst outerBorderRadius = 16;const innerBorderRadius = 12;@@ -1223,7 +1230,7 @@ export const CollectionMapDialog: React.FC<CollectionMapDialogProps> = ({const mapComponents = useMapComponents();const user = useCurrentUser();const [isFileViewerOpen, setIsFileViewerOpen] = useState(false);- const optimalZoom = calculateOptimalZoom();+ const optimalZoom = DEFAULT_MAP_ZOOM;const {mapCenter,@@ -1272,7 +1279,7 @@ export const CollectionMapDialog: React.FC<CollectionMapDialogProps> = ({[isFileViewerOpen],);- // Convert visible JourneyPoints to EnteFiles for FileListWithViewer+ // Convert visible map photo points to EnteFiles for FileListWithViewerconst visibleFiles = useMemo(() => {return visiblePhotos.map((p) => filesByID.get(p.fileId))@@ -1498,7 +1505,7 @@ export const CollectionMapDialog: React.FC<CollectionMapDialogProps> = ({*/interface MapLayoutProps {collectionSummary: CollectionSummary;- visiblePhotos: JourneyPoint[];+ visiblePhotos: MapPhotoPoint[];visibleFiles: EnteFile[];visiblePhotosUpdating: boolean;mapIndex: MapIndex | null;@@ -1508,7 +1515,7 @@ interface MapLayoutProps {mapCenter: [number, number];optimalZoom: number;onClose: () => void;- onVisiblePhotosChange: (photosInView: JourneyPoint[]) => void;+ onVisiblePhotosChange: (photosInView: MapPhotoPoint[]) => void;onVisiblePhotosLoadingChange: (loading: boolean) => void;onPrefetchThumbnails: (fileIDs: number[]) => void;user: ReturnType<typeof useCurrentUser>;@@ -1885,7 +1892,7 @@ interface MapCanvasProps {mapIndex: MapIndex | null;optimalZoom: number;thumbByFileID: Map<number, string>;- onVisiblePhotosChange: (photosInView: JourneyPoint[]) => void;+ onVisiblePhotosChange: (photosInView: MapPhotoPoint[]) => void;onVisiblePhotosLoadingChange: (loading: boolean) => void;onPrefetchThumbnails: (fileIDs: number[]) => void;}@@ -2025,7 +2032,7 @@ interface MapClustersProps {useMap: typeof import("react-leaflet").useMap;mapIndex: MapIndex;thumbByFileID: Map<number, string>;- onVisiblePhotosChange: (photosInView: JourneyPoint[]) => void;+ onVisiblePhotosChange: (photosInView: MapPhotoPoint[]) => void;onVisiblePhotosLoadingChange: (loading: boolean) => void;onPrefetchThumbnails: (fileIDs: number[]) => void;Marker: typeof import("react-leaflet").Marker;diff --git a/web/apps/photos/src/components/TripLayout/MapEvents.tsx b/web/apps/photos/src/components/TripLayout/MapEvents.tsxdeleted file mode 100644index c85b8f5fad..0000000000--- a/web/apps/photos/src/components/TripLayout/MapEvents.tsx+++ /dev/null@@ -1,31 +0,0 @@-import { memo, useEffect } from "react";-import { useMap } from "react-leaflet";--interface MapEventsProps {- setMapRef: (map: import("leaflet").Map) => void;- setCurrentZoom: (zoom: number) => void;- setTargetZoom: (zoom: number | null) => void;-}--export const MapEvents = memo<MapEventsProps>(- ({ setMapRef, setCurrentZoom, setTargetZoom }) => {- const map = useMap();-- useEffect(() => {- setMapRef(map);-- const handleZoomEnd = () => {- setCurrentZoom(map.getZoom());- setTargetZoom(null);- };-- map.on("zoomend", handleZoomEnd);-- return () => {- map.off("zoomend", handleZoomEnd);- };- }, [map, setMapRef, setCurrentZoom, setTargetZoom]);-- return null;- },-);diff --git a/web/apps/photos/src/components/TripLayout/MobileCover.tsx b/web/apps/photos/src/components/TripLayout/MobileCover.tsxdeleted file mode 100644index afe825a711..0000000000--- a/web/apps/photos/src/components/TripLayout/MobileCover.tsx+++ /dev/null@@ -1,138 +0,0 @@-import { Box, Skeleton, styled, Typography } from "@mui/material";-import { memo } from "react";-import type { JourneyPoint } from "./types";--interface MobileCoverProps {- journeyData: JourneyPoint[];- albumTitle?: string;- coverImageUrl?: string | null;-}--export const MobileCover = memo<MobileCoverProps>(- ({ journeyData, albumTitle, coverImageUrl }) => {- const sortedData = [...journeyData].sort(- (a, b) =>- new Date(a.timestamp).getTime() -- new Date(b.timestamp).getTime(),- );- const firstData = sortedData[0];- const lastData = sortedData[sortedData.length - 1];- if (!firstData || !lastData) {- return null;- }- const firstDate = new Date(firstData.timestamp);- const lastDate = new Date(lastData.timestamp);- const diffTime = Math.abs(lastDate.getTime() - firstDate.getTime());- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));- const monthYear = firstDate.toLocaleDateString("en-US", {- month: "long",- year: "numeric",- });-- // Count unique locations based on unique name+country combinations- const uniqueLocations = new Set(- journeyData- .filter((point) => point.name && point.country)- .map((point) => `${point.name}, ${point.country}`),- );- const locationCount = uniqueLocations.size;-- return (- <MobileCoverContainer>- {coverImageUrl ? (- <>- <img- src={coverImageUrl}- alt="Trip Cover"- style={{- position: "absolute",- inset: 0,- width: "100%",- height: "100%",- objectFit: "cover",- }}- />- <GradientOverlay />- </>- ) : (- <Skeleton- variant="rectangular"- width="100%"- height="100%"- sx={{ bgcolor: "#f5f5f5" }}- />- )}-- <ContentContainer>- {coverImageUrl ? (- <>- <TripTitle>{albumTitle || "Trip"}</TripTitle>- <TripSubtitle>- {monthYear} β’ {diffDays} days β’ {locationCount}{" "}- locations- </TripSubtitle>- </>- ) : (- <>- <Skeleton- variant="text"- width="200px"- height="40px"- sx={{- mb: "5px",- bgcolor: "rgba(255,255,255,0.95)",- }}- />- <Skeleton- variant="text"- width="270px"- height="24px"- sx={{- mb: "20px",- bgcolor: "rgba(255,255,255,0.7)",- }}- />- </>- )}- </ContentContainer>- </MobileCoverContainer>- );- },-);--const MobileCoverContainer = styled(Box)({- position: "relative",- width: "100%",- height: "100%",- backgroundColor: "#e0e0e0",-});--const GradientOverlay = styled(Box)({- position: "absolute",- inset: 0,- background:- "linear-gradient(to bottom, rgba(0,0,0,0.3), transparent 30%, transparent 65%, rgba(0,0,0,0.9))",-});--const ContentContainer = styled(Box)({- position: "absolute",- bottom: "20px",- left: "20px",- right: "20px",- color: "white",-});--const TripTitle = styled(Typography)({- fontSize: "28px",- fontWeight: "bold",- marginBottom: "8px",- lineHeight: 1.2,- component: "h1",-});--const TripSubtitle = styled(Typography)({- color: "rgba(255, 255, 255, 0.8)",- fontSize: "15px",- fontWeight: "600",- paddingBottom: "20px",-});diff --git a/web/apps/photos/src/components/TripLayout/MobileNavBar.tsx b/web/apps/photos/src/components/TripLayout/MobileNavBar.tsxdeleted file mode 100644index d9f0c41916..0000000000--- a/web/apps/photos/src/components/TripLayout/MobileNavBar.tsx+++ /dev/null@@ -1,206 +0,0 @@-import AddPhotoAlternateOutlinedIcon from "@mui/icons-material/AddPhotoAlternateOutlined";-import CheckIcon from "@mui/icons-material/Check";-import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";-import ShareIcon from "@mui/icons-material/Share";-import { Box, Button, IconButton, styled } from "@mui/material";-import { FeedIcon } from "components/Collections/CollectionHeader";-import { EnteLogo } from "ente-base/components/EnteLogo";-import type { PublicAlbumsCredentials } from "ente-base/http";-import type { Collection } from "ente-media/collection";-import { Notification } from "ente-new/photos/components/Notification";-import { useJoinAlbum } from "hooks/useJoinAlbum";-import { t } from "i18next";-import { useState } from "react";-import { getEnteURL } from "utils/public-album";--interface MobileNavBarProps {- onAddPhotos?: () => void;- downloadAllFiles: () => void;- enableDownload?: boolean;- onShowFeed?: () => void;- collectionTitle?: string;- publicCollection?: Collection;- accessToken?: string;- collectionKey?: string;- credentials?: React.RefObject<PublicAlbumsCredentials | undefined>;-}--export const MobileNavBar: React.FC<MobileNavBarProps> = ({- onAddPhotos,- downloadAllFiles,- enableDownload,- onShowFeed,- collectionTitle,- publicCollection,- accessToken,- collectionKey,- credentials,-}) => {- const [showCopiedMessage, setShowCopiedMessage] = useState(false);-- const enableJoin = publicCollection?.publicURLs[0]?.enableJoin;- const { handleJoinAlbum } = useJoinAlbum({- publicCollection,- accessToken,- collectionKey,- credentials,- });-- const handleShare = async () => {- if (typeof window !== "undefined") {- const albumName = collectionTitle || "Trip";- const shareUrl = window.location.href;- const shareText = `${albumName}\n${shareUrl}`;-- try {- await navigator.share({ text: shareText });- } catch (error) {- if (- !error ||- (error instanceof Error && error.name !== "AbortError")- ) {- void navigator.clipboard.writeText(shareText);- setShowCopiedMessage(true);- setTimeout(() => setShowCopiedMessage(false), 2000);- }- }- }- };-- return (- <>- <MobileNavContainer>- <LogoContainer>- <EnteLogo />- </LogoContainer>-- <ButtonGroup>- <MobileNavButton onClick={handleShare}>- <ShareIcon sx={{ fontSize: "15px" }} />- </MobileNavButton>-- {onShowFeed && (- <MobileNavButton onClick={onShowFeed}>- <Box- sx={{- width: 16,- height: 16,- display: "flex",- alignItems: "center",- justifyContent: "center",- "& svg": { width: "100%", height: "100%" },- }}- >- <FeedIcon />- </Box>- </MobileNavButton>- )}-- {onAddPhotos && (- <MobileNavButton onClick={onAddPhotos}>- <AddPhotoAlternateOutlinedIcon- sx={{ fontSize: "16px" }}- />- </MobileNavButton>- )}-- {enableDownload && (- <MobileNavButton onClick={downloadAllFiles}>- <FileDownloadOutlinedIcon- sx={{ fontSize: "18px" }}- />- </MobileNavButton>- )}-- <MobileSignUpButton- onClick={- enableJoin- ? handleJoinAlbum- : () => {- window.location.href = getEnteURL();- }- }- >- {enableJoin ? t("join_album") : t("try_ente")}- </MobileSignUpButton>- </ButtonGroup>- </MobileNavContainer>-- <Notification- open={showCopiedMessage}- onClose={() => setShowCopiedMessage(false)}- horizontal="left"- attributes={{- color: "secondary",- startIcon: <CheckIcon />,- title: "Copied!",- }}- />- </>- );-};--const MobileNavContainer = styled(Box)({- position: "fixed",- top: 0,- left: 0,- right: 0,- height: "60px",- display: "flex",- alignItems: "center",- justifyContent: "space-between",- padding: "0 16px",- backgroundColor: "transparent",- zIndex: 2000,- "&::after": {- content: '""',- position: "absolute",- top: 0,- left: 0,- right: 0,- height: "90px",- background:- "linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, transparent 100%)",- zIndex: -1,- pointerEvents: "none",- },-});--const LogoContainer = styled(Box)({- display: "flex",- alignItems: "center",- "& svg": { height: "20px", width: "auto" },-});--const ButtonGroup = styled(Box)({- display: "flex",- alignItems: "center",- gap: "8px",-});--const MobileNavButton = styled(IconButton)({- padding: "6px",- backgroundColor: "rgba(255, 255, 255, 0.9)",- borderRadius: "6px",- color: "#000000",- transition: "background-color 0.2s",- backdropFilter: "blur(10px)",- width: "32px",- height: "32px",- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",- "&:hover": { backgroundColor: "rgba(255, 255, 255, 1)" },-});--const MobileSignUpButton = styled(Button)({- padding: "6px 10px",- fontSize: "13px",- fontWeight: "600",- whiteSpace: "nowrap",- backgroundColor: "rgba(255, 255, 255, 0.9)",- borderRadius: "6px",- color: "#000000",- transition: "background-color 0.2s",- backdropFilter: "blur(10px)",- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",- "&:hover": { backgroundColor: "rgba(255, 255, 255, 1)" },-});diff --git a/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsx b/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsxdeleted file mode 100644index 32e32cab91..0000000000--- a/web/apps/photos/src/components/TripLayout/MobileTimelineLocation.tsx+++ /dev/null@@ -1,158 +0,0 @@-import { Box, Typography, styled } from "@mui/material";-import { memo } from "react";-import { PhotoFan } from "./PhotoFan";-import type { JourneyPoint } from "./types";--interface MobileTimelineLocationProps {- cluster: JourneyPoint[];- index: number;- journeyData: JourneyPoint[];- onRef: (el: HTMLDivElement | null) => void;- onPhotoClick?: (cluster: JourneyPoint[], fileId: number) => void;-}--export const MobileTimelineLocation = memo<MobileTimelineLocationProps>(- ({ cluster, index, journeyData, onRef, onPhotoClick }) => {- const firstPhoto = cluster[0];- if (!firstPhoto) return null;-- const sortedData = [...journeyData].sort(- (a, b) =>- new Date(a.timestamp).getTime() -- new Date(b.timestamp).getTime(),- );- const firstData = sortedData[0];- if (!firstData) return null;- const firstDate = new Date(firstData.timestamp);- const photoDate = new Date(firstPhoto.timestamp);-- const firstDateOnly = new Date(- firstDate.getFullYear(),- firstDate.getMonth(),- firstDate.getDate(),- );- const photoDateOnly = new Date(- photoDate.getFullYear(),- photoDate.getMonth(),- photoDate.getDate(),- );- const diffTime = photoDateOnly.getTime() - firstDateOnly.getTime();- const dayNumber = Math.floor(diffTime / (1000 * 60 * 60 * 24)) + 1;-- return (- <MobileLocationContainer- ref={onRef}- id={`location-${index}`}- className="timeline-location"- >- {/* Centered Photo Fan Container */}- <CenteredPhotoContainer>- <PhotoFanWrapper>- <PhotoFan- cluster={cluster}- onPhotoClick={onPhotoClick}- />-- {/* Overlay text on top of main photo */}- <PhotoOverlay>- <DayBadge>- DAY {dayNumber} β’{" "}- {new Date(firstPhoto.timestamp)- .toLocaleDateString("en-US", {- month: "short",- day: "numeric",- })- .toUpperCase()}- </DayBadge>- <LocationTitle>- {firstPhoto.name && firstPhoto.name.length > 17- ? firstPhoto.name.substring(0, 14) + "..."- : firstPhoto.name}- </LocationTitle>- <LocationCountry>- {firstPhoto.country}- </LocationCountry>- </PhotoOverlay>- </PhotoFanWrapper>- </CenteredPhotoContainer>- </MobileLocationContainer>- );- },-);--// Styled components-const MobileLocationContainer = styled(Box)({- position: "relative",- display: "flex",- flexDirection: "column",- alignItems: "center",- justifyContent: "center",- width: "100%",- height: "40svh",- scrollSnapAlign: "start",- scrollSnapStop: "always",- padding: "0",-});--const CenteredPhotoContainer = styled(Box)({- position: "relative",- display: "flex",- justifyContent: "center",-});--const PhotoFanWrapper = styled(Box)({- position: "relative",- width: "180px",- height: "240px",- transition: "transform 0.3s ease-in-out",- cursor: "pointer",- "&:hover": { transform: "scale(1.05)" },-});--const PhotoOverlay = styled(Box)({- position: "absolute",- bottom: "2px",- left: "2px",- right: "2px",- zIndex: 30,- pointerEvents: "none",- background:- "linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%)",- borderRadius: "0 0 12px 12px",- padding: "16px",- minHeight: "fit-content",-});--const DayBadge = styled(Box)({- display: "inline-flex",- alignItems: "center",- backgroundColor: "transparent",- border: "none",- borderRadius: "0",- padding: "0",- marginBottom: "4px",- fontSize: "10px",- fontWeight: "600",- color: "white",- textTransform: "uppercase",- letterSpacing: "0.15em",- textShadow: "0 2px 8px rgba(0, 0, 0, 0.8)",-});--const LocationTitle = styled(Typography)(() => ({- fontSize: "18px",- fontWeight: "600",- color: "white",- margin: "0 0 2px 0",- lineHeight: "1.2",- textShadow: "0 2px 8px rgba(0, 0, 0, 0.5)",- component: "h3",-}));--const LocationCountry = styled(Typography)(() => ({- fontSize: "13px",- color: "rgba(200, 200, 200, 0.9)",- margin: "0",- textShadow: "0 1px 4px rgba(0, 0, 0, 0.5)",- component: "p",-}));diff --git a/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsx b/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsxdeleted file mode 100644index 9273bb29fb..0000000000--- a/web/apps/photos/src/components/TripLayout/MobileTripStarted.tsx+++ /dev/null@@ -1,107 +0,0 @@-import { Box, styled, Typography } from "@mui/material";-import { memo } from "react";-import type { JourneyPoint } from "./types";--interface MobileTripStartedProps {- onRef: (el: HTMLDivElement | null) => void;- journeyData: JourneyPoint[];-}--export const MobileTripStarted = memo<MobileTripStartedProps>(- ({ onRef, journeyData }) => {- // Get the first photo's date- const sortedData = [...journeyData].sort(- (a, b) =>- new Date(a.timestamp).getTime() -- new Date(b.timestamp).getTime(),- );- const firstPhoto = sortedData[0];- const firstPhotoDate = firstPhoto- ? new Date(firstPhoto.timestamp).toLocaleDateString("en-US", {- year: "numeric",- month: "long",- day: "numeric",- })- : "";-- return (- <MobileTripStartedContainer ref={onRef}>- <MobileTripStartedContent>- <MobileTripStartedText>- <TripStartedTitle>Trip started</TripStartedTitle>- {firstPhotoDate && (- <>- <br />- <TripStartedDate>- {firstPhotoDate}- </TripStartedDate>- </>- )}- </MobileTripStartedText>- </MobileTripStartedContent>- <MobileTripStartedDot />- <MobileTripStartedLine />- </MobileTripStartedContainer>- );- },-);--const MobileTripStartedContainer = styled(Box)({- position: "relative",- display: "flex",- flexDirection: "column",- alignItems: "center",- justifyContent: "center",- height: "40svh",- scrollSnapAlign: "start",- scrollSnapStop: "always",- padding: "0",- overflow: "visible",-});--const MobileTripStartedContent = styled(Box)({- display: "flex",- alignItems: "center",- justifyContent: "center",- marginBottom: "20px",-});--const MobileTripStartedText = styled(Typography)(({ theme }) => ({- fontSize: "16px",- fontWeight: "500",- color: theme.palette.text.secondary,- textAlign: "center",-}));--const MobileTripStartedLine = styled(Box)(({ theme }) => ({- position: "absolute",- left: "50%",- bottom: "-100px",- height: "200px",- width: "3px",- backgroundColor: theme.palette.grey[300],- transform: "translateX(-1.5px)",- zIndex: 0,-}));--const TripStartedTitle = styled("span")(({ theme }) => ({- fontSize: "14px",- fontWeight: 500,- color: theme.palette.text.primary,-}));--const TripStartedDate = styled("span")(({ theme }) => ({- fontSize: "12px",- fontWeight: "normal",- color: theme.palette.text.secondary,-}));--const MobileTripStartedDot = styled(Box)(({ theme }) => ({- width: "8px",- height: "8px",- backgroundColor: theme.palette.grey[500],- borderRadius: "50%",- margin: "10px auto 0 auto",- position: "relative",- zIndex: 1,-}));diff --git a/web/apps/photos/src/components/TripLayout/PhotoFan.tsx b/web/apps/photos/src/components/TripLayout/PhotoFan.tsxdeleted file mode 100644index 290f9b860b..0000000000--- a/web/apps/photos/src/components/TripLayout/PhotoFan.tsx+++ /dev/null@@ -1,207 +0,0 @@-import { Box, styled } from "@mui/material";-import { memo } from "react";-import type { JourneyPoint } from "./types";--interface PhotoFanProps {- cluster: JourneyPoint[];- onPhotoClick?: (cluster: JourneyPoint[], fileId: number) => void;-}--export const PhotoFan = memo<PhotoFanProps>(({ cluster, onPhotoClick }) => {- if (cluster.length === 0) {- return null;- }-- return (- <PhotoFanContainer>- {cluster.length >= 3 && (- <>- {cluster[1] && (- <PhotoFrameLeft- onClick={() =>- cluster[1] &&- onPhotoClick?.(cluster, cluster[1].fileId)- }- >- <BackgroundLoadingBox />- <ImageWrapper- sx={{ transform: "skewY(8deg) scale(1.1)" }}- >- {cluster[1].image &&- cluster[1].image.trim() !== "" && (- <img- src={cluster[1].image}- alt={cluster[1].name}- style={{- position: "absolute",- inset: 0,- width: "100%",- height: "100%",- objectFit: "cover",- zIndex: 1,- }}- />- )}- </ImageWrapper>- </PhotoFrameLeft>- )}- {cluster[2] && (- <PhotoFrameRight- onClick={() =>- cluster[2] &&- onPhotoClick?.(cluster, cluster[2].fileId)- }- >- <BackgroundLoadingBox />- <ImageWrapper- sx={{ transform: "skewY(-8deg) scale(1.1)" }}- >- {cluster[2].image &&- cluster[2].image.trim() !== "" && (- <img- src={cluster[2].image}- alt={cluster[2].name}- style={{- position: "absolute",- inset: 0,- width: "100%",- height: "100%",- objectFit: "cover",- zIndex: 1,- }}- />- )}- </ImageWrapper>- </PhotoFrameRight>- )}- </>- )}-- {cluster[0] && (- <MainPhotoFrame- onClick={() =>- cluster[0] && onPhotoClick?.(cluster, cluster[0].fileId)- }- >- {cluster[0].image && cluster[0].image.trim() !== "" ? (- <img- src={cluster[0].image}- alt={cluster[0].name}- style={{- position: "absolute",- inset: 0,- width: "100%",- height: "100%",- objectFit: "cover",- }}- />- ) : (- <LoadingBox />- )}-- {cluster.length === 2 && <CountBadge>+1</CountBadge>}- {cluster.length > 3 && (- <CountBadge>+{cluster.length - 3}</CountBadge>- )}- </MainPhotoFrame>- )}- </PhotoFanContainer>- );-});--// Styled components-const PhotoFanContainer = styled(Box)(({ theme }) => ({- position: "relative",- width: "180px",- height: "240px",- [theme.breakpoints.up("md")]: {- transition: "transform 0.3s ease-in-out",- cursor: "pointer",- "&:hover": { transform: "scale(1.05)" },- },-}));--const PhotoFrame = styled(Box)(() => ({- position: "absolute",- border: "2px solid white",- zIndex: 10,- width: "180px",- height: "207px",- borderRadius: "14px",- overflow: "hidden",- cursor: "pointer",-}));--const PhotoFrameLeft = styled(PhotoFrame)({- transform: "translateX(-33px) skewY(-8deg)",- top: "16.5px",- left: "0",-});--const PhotoFrameRight = styled(PhotoFrame)({- transform: "translateX(33px) skewY(8deg)",- top: "16.5px",- left: "0",-});--const MainPhotoFrame = styled(Box)(() => ({- position: "relative",- width: "100%",- height: "100%",- border: "2px solid white",- zIndex: 20,- borderRadius: "14px",- overflow: "hidden",- cursor: "pointer",-}));--const ImageWrapper = styled(Box)({- position: "relative",- width: "100%",- height: "100%",-});--const CountBadge = styled(Box)({- position: "absolute",- top: "6px",- right: "6px",- background: "white",- color: "black",- borderRadius: "6px",- padding: "4px 6px",- minHeight: "20px",- display: "inline-flex",- alignItems: "center",- justifyContent: "center",- fontSize: "11px",- fontWeight: "600",- boxShadow: "0 1px 3px rgba(0,0,0,0.3)",-});--const LoadingBox = styled(Box)({- width: "100%",- height: "100%",- borderRadius: "12px",- animation: "skeleton-pulse 1.5s ease-in-out infinite",- "@keyframes skeleton-pulse": {- "0%": { backgroundColor: "#ffffff" },- "50%": { backgroundColor: "#f0f0f0" },- "100%": { backgroundColor: "#ffffff" },- },-});--const BackgroundLoadingBox = styled(Box)({- position: "absolute",- top: 0,- left: 0,- right: 0,- bottom: 0,- borderRadius: "12px",- zIndex: 0,- animation: "skeleton-pulse 1.5s ease-in-out infinite",- "@keyframes skeleton-pulse": {- "0%": { backgroundColor: "#ffffff" },- "50%": { backgroundColor: "#f0f0f0" },- "100%": { backgroundColor: "#ffffff" },- },-});diff --git a/web/apps/photos/src/components/TripLayout/TimelineBaseLine.tsx b/web/apps/photos/src/components/TripLayout/TimelineBaseLine.tsxdeleted file mode 100644index 9aed539515..0000000000--- a/web/apps/photos/src/components/TripLayout/TimelineBaseLine.tsx+++ /dev/null@@ -1,52 +0,0 @@-import { Box, styled } from "@mui/material";-import { memo } from "react";--interface TimelineBaseLineProps {- locationPositions: { top: number; center: number }[];-}--export const TimelineBaseLine = memo<TimelineBaseLineProps>(- ({ locationPositions }) => {- const timelineContainer = document.querySelector("#timeline-container");- if (!timelineContainer || locationPositions.length === 0) {- return null;- }-- const locationElements =- timelineContainer.querySelectorAll(".timeline-location");- if (locationElements.length === 0) {- return null;- }-- const lastLocation = locationElements[- locationElements.length - 1- ] as HTMLElement;- const lastLocationRect = lastLocation.getBoundingClientRect();- const heightToLastDot =- lastLocation.offsetTop + lastLocationRect.height / 2;-- const firstLocationCenter = locationPositions[0]?.center || 0;-- return (- <SolidLine- sx={{- top: `${firstLocationCenter}px`,- height: `${heightToLastDot - firstLocationCenter}px`,- }}- />- );- },-);--// Styled components-const BaseLine = styled(Box)(() => ({- position: "absolute",- left: "50%",- transform: "translateX(-1.5px)",- width: "3px",- zIndex: 0,-}));--const SolidLine = styled(BaseLine)(({ theme }) => ({- backgroundColor: theme.palette.grey[300],-}));diff --git a/web/apps/photos/src/components/TripLayout/TimelineLocation.tsx b/web/apps/photos/src/components/TripLayout/TimelineLocation.tsxdeleted file mode 100644index 371a660523..0000000000--- a/web/apps/photos/src/components/TripLayout/TimelineLocation.tsx+++ /dev/null@@ -1,229 +0,0 @@-import { Box, Typography, styled } from "@mui/material";-import { memo } from "react";-import { PhotoFan } from "./PhotoFan";-import type { JourneyPoint } from "./types";--interface TimelineLocationProps {- cluster: JourneyPoint[];- index: number;- photoClusters: JourneyPoint[][];- scrollProgress: number;- journeyData: JourneyPoint[];- onRef: (el: HTMLDivElement | null) => void;- onPhotoClick?: (cluster: JourneyPoint[], fileId: number) => void;-}--// Component for timeline location item-export const TimelineLocation = memo<TimelineLocationProps>(- ({- cluster,- index,- photoClusters,- scrollProgress,- journeyData,- onRef,- onPhotoClick,- }) => {- const isLeft = index % 2 === 0;- const firstPhoto = cluster[0];- if (!firstPhoto) return null;- const sortedData = [...journeyData].sort(- (a, b) =>- new Date(a.timestamp).getTime() -- new Date(b.timestamp).getTime(),- );- const firstData = sortedData[0];- if (!firstData) return null;- const firstDate = new Date(firstData.timestamp);- const photoDate = new Date(firstPhoto.timestamp);-- const firstDateOnly = new Date(- firstDate.getFullYear(),- firstDate.getMonth(),- firstDate.getDate(),- );- const photoDateOnly = new Date(- photoDate.getFullYear(),- photoDate.getMonth(),- photoDate.getDate(),- );- const diffTime = photoDateOnly.getTime() - firstDateOnly.getTime();- const dayNumber = Math.floor(diffTime / (1000 * 60 * 60 * 24)) + 1;-- // Show green only for the active location- const currentLocationIndex = Math.round(- scrollProgress * Math.max(0, photoClusters.length - 1),- );- const isActive = index === currentLocationIndex;-- return (- <LocationContainer- ref={onRef}- id={`location-${index}`}- className="timeline-location"- sx={{- marginBottom:- index === photoClusters.length - 1 ? "48px" : "96px",- }}- >- <DotBackground />- <TimelineDot isReached={isActive} />-- {isLeft ? (- <>- <LeftContent>- <DayBadge>- DAY {dayNumber} β’{" "}- {new Date(firstPhoto.timestamp)- .toLocaleDateString("en-US", {- month: "long",- day: "numeric",- })- .toUpperCase()}- </DayBadge>- <LocationTitle sx={{ textAlign: "right" }}>- {firstPhoto.name}- </LocationTitle>- <LocationCountry sx={{ textAlign: "right" }}>- {firstPhoto.country}- </LocationCountry>- </LeftContent>- <RightPhotoContainer- sx={{- paddingLeft:- cluster.length >= 3 ? "72px" : "40px",- }}- >- <PhotoFan- cluster={cluster}- onPhotoClick={onPhotoClick}- />- </RightPhotoContainer>- </>- ) : (- <>- <LeftPhotoContainer- sx={{- paddingRight:- cluster.length >= 3 ? "72px" : "40px",- }}- >- <PhotoFan- cluster={cluster}- onPhotoClick={onPhotoClick}- />- </LeftPhotoContainer>- <RightContent>- <DayBadge>- DAY {dayNumber} β’{" "}- {new Date(firstPhoto.timestamp)- .toLocaleDateString("en-US", {- month: "long",- day: "numeric",- })- .toUpperCase()}- </DayBadge>- <LocationTitle sx={{ textAlign: "left" }}>- {firstPhoto.name}- </LocationTitle>- <LocationCountry sx={{ textAlign: "left" }}>- {firstPhoto.country}- </LocationCountry>- </RightContent>- </>- )}- </LocationContainer>- );- },-);--// Styled components-const LocationContainer = styled(Box)({- position: "relative",- display: "flex",- alignItems: "center",-});--const DotBackground = styled(Box)(({ theme }) => ({- position: "absolute",- left: "50%",- top: "50%",- transform: "translate(-50%, -50%)",- width: "24px",- height: "40px",- borderRadius: "50%",- zIndex: 10,- backgroundColor: theme.palette.background.paper,-}));--const TimelineDot = styled(Box, {- shouldForwardProp: (prop) => prop !== "isReached",-})<{ isReached: boolean }>(({ theme, isReached }) => ({- position: "absolute",- left: "50%",- top: "50%",- transform: "translate(-50%, -50%)",- borderRadius: "50%",- border: `2px solid ${theme.palette.background.paper}`,- zIndex: 20,- width: "12px",- height: "12px",- transition: "all 0.3s",- backgroundColor: isReached- ? theme.palette.success.main- : theme.palette.text.primary,- boxShadow: isReached- ? `0 0 0 3px ${theme.palette.success.main}30, 0 0 0 6px ${theme.palette.success.main}15`- : "none",-}));--const ContentContainer = styled(Box)({ width: "50%", paddingTop: "58px" });--const LeftContent = styled(ContentContainer)({- paddingRight: "32px",- textAlign: "right",-});--const RightContent = styled(ContentContainer)({- paddingLeft: "32px",- textAlign: "left",-});--const PhotoContainer = styled(Box)({ width: "50%" });--const LeftPhotoContainer = styled(PhotoContainer)({- display: "flex",- justifyContent: "flex-end",-});--const RightPhotoContainer = styled(PhotoContainer)({});--const DayBadge = styled(Box)(({ theme }) => ({- display: "inline-flex",- alignItems: "center",- border: `1px solid ${theme.palette.grey[300]}`,- borderRadius: "8px",- padding: "4px 12px",- marginBottom: "10px",- fontSize: "11px",- fontWeight: "600",- color: theme.palette.text.secondary,- textTransform: "uppercase",- letterSpacing: "0.15em",-}));--const LocationTitle = styled(Typography)(({ theme }) => ({- fontSize: "20px",- fontWeight: "600",- color: theme.palette.text.primary,- margin: "0",- lineHeight: "1.2",- component: "h3",-}));--const LocationCountry = styled(Typography)(({ theme }) => ({- fontSize: "14px",- color: theme.palette.text.secondary,- margin: "4px 0 0 0",- component: "p",-}));diff --git a/web/apps/photos/src/components/TripLayout/TimelineProgressLine.tsx b/web/apps/photos/src/components/TripLayout/TimelineProgressLine.tsxdeleted file mode 100644index 9e5c40a2c2..0000000000--- a/web/apps/photos/src/components/TripLayout/TimelineProgressLine.tsx+++ /dev/null@@ -1,14 +0,0 @@-import { memo } from "react";-import type { JourneyPoint } from "./types";--interface TimelineProgressLineProps {- locationPositions: { top: number; center: number }[];- scrollProgress: number;- hasUserScrolled: boolean;- photoClusters: JourneyPoint[][];-}--export const TimelineProgressLine = memo<TimelineProgressLineProps>(() => {- // No longer showing progressive green line - green indicators only for current location- return null;-});diff --git a/web/apps/photos/src/components/TripLayout/TopNavButtons.tsx b/web/apps/photos/src/components/TripLayout/TopNavButtons.tsxdeleted file mode 100644index 9e03cb274e..0000000000--- a/web/apps/photos/src/components/TripLayout/TopNavButtons.tsx+++ /dev/null@@ -1,144 +0,0 @@-import AddPhotoAlternateOutlinedIcon from "@mui/icons-material/AddPhotoAlternateOutlined";-import CheckIcon from "@mui/icons-material/Check";-import FileDownloadOutlinedIcon from "@mui/icons-material/FileDownloadOutlined";-import ShareIcon from "@mui/icons-material/Share";-import { Box, Button, IconButton, styled } from "@mui/material";-import { FeedIcon } from "components/Collections/CollectionHeader";-import type { PublicAlbumsCredentials } from "ente-base/http";-import type { Collection } from "ente-media/collection";-import { Notification } from "ente-new/photos/components/Notification";-import { useJoinAlbum } from "hooks/useJoinAlbum";-import { t } from "i18next";-import { useState } from "react";-import { getEnteURL } from "utils/public-album";--interface TopNavButtonsProps {- onAddPhotos?: () => void;- downloadAllFiles: () => void;- enableDownload?: boolean;- onShowFeed?: () => void;- publicCollection?: Collection;- accessToken?: string;- collectionKey?: string;- credentials?: React.RefObject<PublicAlbumsCredentials | undefined>;-}--export const TopNavButtons: React.FC<TopNavButtonsProps> = ({- onAddPhotos,- downloadAllFiles,- enableDownload,- onShowFeed,- publicCollection,- accessToken,- collectionKey,- credentials,-}) => {- const [showCopiedMessage, setShowCopiedMessage] = useState(false);-- const enableJoin = publicCollection?.publicURLs[0]?.enableJoin;- const { handleJoinAlbum } = useJoinAlbum({- publicCollection,- accessToken,- collectionKey,- credentials,- });-- const handleShare = () => {- if (typeof window !== "undefined") {- void navigator.clipboard.writeText(window.location.href);- setShowCopiedMessage(true);- setTimeout(() => setShowCopiedMessage(false), 2000);- }- };-- return (- <>- <ButtonContainer>- <NavButton onClick={handleShare}>- <ShareIcon sx={{ fontSize: "20px" }} />- </NavButton>-- {onShowFeed && (- <NavButton onClick={onShowFeed}>- <FeedIcon />- </NavButton>- )}-- {onAddPhotos && (- <NavButton onClick={onAddPhotos}>- <AddPhotoAlternateOutlinedIcon- sx={{ fontSize: "22px" }}- />- </NavButton>- )}-- {enableDownload && (- <NavButton onClick={downloadAllFiles}>- <FileDownloadOutlinedIcon sx={{ fontSize: "23px" }} />- </NavButton>- )}-- <SignUpButton- onClick={- enableJoin- ? handleJoinAlbum- : () => {- window.location.href = getEnteURL();- }- }- >- {enableJoin ? t("join_album") : t("try_ente")}- </SignUpButton>- </ButtonContainer>-- <Notification- open={showCopiedMessage}- onClose={() => setShowCopiedMessage(false)}- horizontal="left"- attributes={{- color: "secondary",- startIcon: <CheckIcon />,- title: "Copied!",- }}- />- </>- );-};--// Styled components-const ButtonContainer = styled(Box)({- position: "fixed",- top: "58px",- right: "58px",- display: "flex",- gap: "8px",- zIndex: 2000,-});--const NavButton = styled(IconButton)({- padding: "12px",- backgroundColor: "rgba(255, 255, 255, 0.9)",- borderRadius: "8px",- color: "#1f2937",- transition: "background-color 0.2s",- backdropFilter: "blur(10px)",- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",- width: "44px",- height: "44px",- "&:hover": { backgroundColor: "rgba(255, 255, 255, 1)" },-});--const SignUpButton = styled(Button)({- padding: "12px 16px",- marginLeft: "12px",- fontSize: "16px",- fontWeight: "600",- whiteSpace: "nowrap",- backgroundColor: "rgba(255, 255, 255, 0.9)",- borderRadius: "8px",- color: "#1f2937",- transition: "background-color 0.2s",- backdropFilter: "blur(10px)",- boxShadow: "0 2px 8px rgba(0, 0, 0, 0.1)",- "&:hover": { backgroundColor: "rgba(255, 255, 255, 1)" },-});diff --git a/web/apps/photos/src/components/TripLayout/TripCover.tsx b/web/apps/photos/src/components/TripLayout/TripCover.tsxdeleted file mode 100644index 9f8d65dbe0..0000000000--- a/web/apps/photos/src/components/TripLayout/TripCover.tsx+++ /dev/null@@ -1,156 +0,0 @@-import { Box, Skeleton, styled, Typography } from "@mui/material";-import { EnteLogo } from "ente-base/components/EnteLogo";-import { memo } from "react";-import type { JourneyPoint } from "./types";--interface TripCoverProps {- journeyData: JourneyPoint[];- albumTitle?: string;- coverImageUrl?: string | null;-}--export const TripCover = memo<TripCoverProps>(- ({ journeyData, albumTitle, coverImageUrl }) => {- const sortedData = [...journeyData].sort(- (a, b) =>- new Date(a.timestamp).getTime() -- new Date(b.timestamp).getTime(),- );- const firstData = sortedData[0];- const lastData = sortedData[sortedData.length - 1];- if (!firstData || !lastData) {- return null;- }- const firstDate = new Date(firstData.timestamp);- const lastDate = new Date(lastData.timestamp);- const diffTime = Math.abs(lastDate.getTime() - firstDate.getTime());- const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));- const monthYear = firstDate.toLocaleDateString("en-US", {- month: "long",- year: "numeric",- });-- // Count unique locations based on unique name+country combinations- const uniqueLocations = new Set(- journeyData- .filter((point) => point.name && point.country)- .map((point) => `${point.name}, ${point.country}`),- );- const locationCount = uniqueLocations.size;-- return (- <CoverContainer>- <CoverImageContainer>- {coverImageUrl ? (- <>- <img- src={coverImageUrl}- alt="Trip Cover"- style={{- position: "absolute",- inset: 0,- width: "100%",- height: "100%",- objectFit: "cover",- }}- />- <GradientOverlay />- </>- ) : (- <Skeleton- variant="rectangular"- width="100%"- height="100%"- sx={{ bgcolor: "#f5f5f5" }}- />- )}-- <LogoContainer>- <EnteLogo height={20} />- </LogoContainer>-- <ContentContainer>- {coverImageUrl ? (- <>- <TripTitle>{albumTitle || "Trip"}</TripTitle>- <TripSubtitle>- {monthYear} β’ {diffDays} days β’{" "}- {locationCount} locations- </TripSubtitle>- </>- ) : (- <>- <Skeleton- variant="text"- width="200px"- height="40px"- sx={{- mb: "5px",- bgcolor: "rgba(255,255,255,0.95)",- }}- />- <Skeleton- variant="text"- width="270px"- height="24px"- sx={{ bgcolor: "rgba(255,255,255,0.7)" }}- />- </>- )}- </ContentContainer>- </CoverImageContainer>- </CoverContainer>- );- },-);--// Styled components-const CoverContainer = styled(Box)({ marginBottom: "48px" });--const CoverImageContainer = styled(Box)(({ theme }) => ({- aspectRatio: "16/8",- position: "relative",- marginBottom: "12px",- borderRadius: "24px",- overflow: "hidden",- backgroundColor: "#e0e0e0",- [theme.breakpoints.down(1440)]: { aspectRatio: "16/6" },-}));--const GradientOverlay = styled(Box)({- position: "absolute",- inset: 0,- background:- "linear-gradient(to bottom, rgba(0,0,0,0.4), transparent 30%, transparent 70%, rgba(0,0,0,0.7))",-});--const LogoContainer = styled(Box)(() => ({- position: "absolute",- top: "20px",- left: "20px",- color: "white",-}));--const ContentContainer = styled(Box)({- position: "absolute",- bottom: 0,- left: 0,- right: 0,- padding: "24px",- color: "white",-});--const TripTitle = styled(Typography)({- fontSize: "30px",- fontWeight: "bold",- marginBottom: "10px",- lineHeight: 1.2,- component: "h1",-});--const TripSubtitle = styled(Typography)({- color: "rgba(255, 255, 255, 0.8)",- fontSize: "16px",- fontWeight: "600",- margin: "0",-});diff --git a/web/apps/photos/src/components/TripLayout/TripMap.tsx b/web/apps/photos/src/components/TripLayout/TripMap.tsxdeleted file mode 100644index 4279c60241..0000000000--- a/web/apps/photos/src/components/TripLayout/TripMap.tsx+++ /dev/null@@ -1,191 +0,0 @@-import { Box, styled, useMediaQuery, useTheme } from "@mui/material";-import { useEffect, useState } from "react";--import { MapEvents } from "./MapEvents";-import { createIcon, getMapCenter } from "./mapHelpers";-import type { JourneyPoint } from "./types";--interface MapComponentsType {- MapContainer: typeof import("react-leaflet").MapContainer;- TileLayer: typeof import("react-leaflet").TileLayer;- Marker: typeof import("react-leaflet").Marker;-}--interface TripMapProps {- journeyData: JourneyPoint[];- photoClusters: JourneyPoint[][];- hasPhotoData: boolean;- optimalZoom: number;- scrollProgress: number;- setMapRef: (map: import("leaflet").Map | null) => void;- setCurrentZoom: (zoom: number) => void;- setTargetZoom: (zoom: number | null) => void;- onMarkerClick: (- clusterIndex: number,- clusterLat: number,- clusterLng: number,- ) => void;-}--export const TripMap: React.FC<TripMapProps> = ({- journeyData,- photoClusters,- hasPhotoData,- optimalZoom,- scrollProgress,- setMapRef,- setCurrentZoom,- setTargetZoom,- onMarkerClick,-}) => {- const theme = useTheme();- const isMobileOrTablet = useMediaQuery(theme.breakpoints.down("md")); // 960px breakpoint for mobile and tablet-- // Load react-leaflet components client-side only to prevent SSR issues- const [mapComponents, setMapComponents] =- useState<MapComponentsType | null>(null);-- useEffect(() => {- void import("react-leaflet")- .then((mod) => {- setMapComponents({- MapContainer: mod.MapContainer,- TileLayer: mod.TileLayer,- Marker: mod.Marker,- });- })- .catch((error: unknown) => {- console.error("Failed to load react-leaflet:", error);- });- }, []);-- // Calculate current active location index based on scroll progress (same logic as in scrollUtils)- let currentActiveLocationIndex = -1;- if (photoClusters.length > 0) {- if (isMobileOrTablet) {- // Mobile: Slower progression - stay on each location longer- currentActiveLocationIndex = Math.floor(- scrollProgress * (photoClusters.length - 0.5),- );- } else {- // Desktop: Use original logic- currentActiveLocationIndex = Math.round(- scrollProgress * Math.max(0, photoClusters.length - 1),- );- }- }-- // Super clusters disabled - show all clusters individually- const visibleClustersWithIndices = photoClusters.map(- (cluster, originalIndex) => ({ cluster, originalIndex }),- );-- // Return loading state if map components haven't loaded yet- if (!mapComponents) {- return <MapContainerWrapper hasPhotoData={false} />;- }-- const { MapContainer, TileLayer, Marker } = mapComponents;-- return (- <MapContainerWrapper hasPhotoData={hasPhotoData}>- {hasPhotoData ? (- <MapContainer- center={getMapCenter(photoClusters, journeyData)}- zoom={- isMobileOrTablet- ? Math.max(1, optimalZoom - 2)- : optimalZoom- }- scrollWheelZoom={true}- zoomControl={false}- attributionControl={!isMobileOrTablet}- style={{ width: "100%", height: "100%" }}- >- <MapEvents- setMapRef={setMapRef}- setCurrentZoom={setCurrentZoom}- setTargetZoom={setTargetZoom}- />- {/* Stadia Alidade Satellite - includes both imagery and labels */}- <TileLayer- attribution={- isMobileOrTablet- ? ""- : '© <a href="https://stadiamaps.com/" target="_blank" rel="noopener noreferrer">Stadia Maps</a>, © <a href="https://openmaptiles.org/" target="_blank" rel="noopener noreferrer">OpenMapTiles</a> © <a href="http://openstreetmap.org" target="_blank" rel="noopener noreferrer">OpenStreetMap</a> contributors'- }- url="https://tiles.stadiamaps.com/tiles/alidade_satellite/{z}/{x}/{y}{r}.jpg"- maxZoom={20}- updateWhenZooming={true}- keepBuffer={isMobileOrTablet ? 3 : 1}- />-- {/* Draw visible clusters */}- {visibleClustersWithIndices.map((item, index) => {- const { cluster, originalIndex } = item;- const firstPhoto = cluster[0];- if (!firstPhoto) return null;- const avgLat =- cluster.reduce((sum, p) => sum + p.lat, 0) /- cluster.length;- const avgLng =- cluster.reduce((sum, p) => sum + p.lng, 0) /- cluster.length;-- // Use the preserved original index- const originalClusterIndex = originalIndex;- // Show green only for active locations- const isActive =- originalClusterIndex === currentActiveLocationIndex;-- const icon = createIcon(- firstPhoto.image,- isMobileOrTablet ? 30 : 55,- "#ffffff",- cluster.length,- isActive,- );-- return icon ? (- <Marker- key={`cluster-${index}`}- position={[avgLat, avgLng]}- icon={icon}- zIndexOffset={isActive ? 1000 : 0}- eventHandlers={{- click: () => {- // Calculate cluster center- const avgLat =- cluster.reduce(- (sum, p) => sum + p.lat,- 0,- ) / cluster.length;- const avgLng =- cluster.reduce(- (sum, p) => sum + p.lng,- 0,- ) / cluster.length;- onMarkerClick(- originalClusterIndex,- avgLat,- avgLng,- );- },- }}- />- ) : null;- })}- </MapContainer>- ) : null}- </MapContainerWrapper>- );-};--// Styled components-const MapContainerWrapper = styled(Box, {- shouldForwardProp: (prop) => prop !== "hasPhotoData",-})<{ hasPhotoData: boolean }>(({ hasPhotoData }) => ({- width: "100%",- height: "100%",- backgroundColor: hasPhotoData ? "transparent" : "#000000",-}));diff --git a/web/apps/photos/src/components/TripLayout/TripStartedSection.tsx b/web/apps/photos/src/components/TripLayout/TripStartedSection.tsxdeleted file mode 100644index c617f02138..0000000000--- a/web/apps/photos/src/components/TripLayout/TripStartedSection.tsx+++ /dev/null@@ -1,81 +0,0 @@-import { Box, styled } from "@mui/material";-import { memo } from "react";-import type { JourneyPoint } from "./types";--interface TripStartedSectionProps {- journeyData: JourneyPoint[];-}--export const TripStartedSection = memo<TripStartedSectionProps>(- ({ journeyData }) => {- const sortedData = [...journeyData].sort(- (a, b) =>- new Date(a.timestamp).getTime() -- new Date(b.timestamp).getTime(),- );- const firstData = sortedData[0];- if (!firstData) {- return null;- }- const firstDate = new Date(firstData.timestamp);-- return (- <SectionContainer>- <TripStartedLabel>Trip started</TripStartedLabel>- <br />- <DateLabel>- {firstDate.toLocaleDateString("en-US", {- month: "long",- day: "2-digit",- })}- </DateLabel>-- <StartingDot />- </SectionContainer>- );- },-);--// Styled components-const SectionContainer = styled(Box)({- position: "relative",- marginTop: "32px",- marginBottom: "100px",- textAlign: "center",- zIndex: 1,-});--const TripStartedLabel = styled(Box)(({ theme }) => ({- fontSize: "20px",- fontWeight: "600",- color: theme.palette.text.primary,- marginBottom: "2px",- lineHeight: "1.2",- backgroundColor: theme.palette.background.paper,- padding: "4px 8px",- borderRadius: "4px",- display: "inline-block",-}));--const DateLabel = styled(Box)(({ theme }) => ({- fontSize: "14px",- color: theme.palette.text.secondary,- backgroundColor: theme.palette.background.paper,- padding: "2px 6px",- borderRadius: "4px",- display: "inline-block",- marginTop: "0px",-}));--const StartingDot = styled(Box)(({ theme }) => ({- position: "absolute",- left: "50%",- top: "80px",- transform: "translate(-50%, 0)",- borderRadius: "50%",- border: `2px solid ${theme.palette.background.paper}`,- zIndex: 20,- width: "12px",- height: "12px",- backgroundColor: theme.palette.grey[300],-}));diff --git a/web/apps/photos/src/components/TripLayout/hooks/useDataProcessing.ts b/web/apps/photos/src/components/TripLayout/hooks/useDataProcessing.tsdeleted file mode 100644index 40625e1f0f..0000000000--- a/web/apps/photos/src/components/TripLayout/hooks/useDataProcessing.ts+++ /dev/null@@ -1,85 +0,0 @@-import { type Collection } from "ente-media/collection";-import { type EnteFile } from "ente-media/file";-import { useEffect } from "react";--import type { JourneyPoint } from "../types";-import { loadCoverImage, processPhotosData } from "../utils/dataProcessing";--export interface UseDataProcessingParams {- files: EnteFile[];- collection?: Collection;- journeyData: JourneyPoint[];- thumbnailsGeneratedRef: React.RefObject<boolean>;- filesCountRef: React.RefObject<number>;- locationDataRef: React.RefObject<- Map<number, { name: string; country: string }>- >;- setJourneyData: (- data: JourneyPoint[] | ((prev: JourneyPoint[]) => JourneyPoint[]),- ) => void;- setIsInitialLoad: (loading: boolean) => void;- setIsLoadingLocations: (loading: boolean) => void;- setCoverImageUrl: (url: string | null) => void;-}--export const useDataProcessing = ({- files,- collection,- journeyData,- thumbnailsGeneratedRef,- filesCountRef,- locationDataRef,- setJourneyData,- setIsInitialLoad,- setIsLoadingLocations,- setCoverImageUrl,-}: UseDataProcessingParams) => {- // Process photos data when files change- useEffect(() => {- const hasFilesCountChanged = files.length !== filesCountRef.current;- filesCountRef.current = files.length;-- if (!hasFilesCountChanged && journeyData.length > 0) {- return;- }-- thumbnailsGeneratedRef.current = false;-- const { photoData, hasLocationData } = processPhotosData({- files,- locationDataRef,- });-- setJourneyData(photoData);- setIsInitialLoad(false);-- if (hasLocationData) {- setIsLoadingLocations(true);- }- }, [- files,- journeyData.length,- filesCountRef,- locationDataRef,- thumbnailsGeneratedRef,- setJourneyData,- setIsInitialLoad,- setIsLoadingLocations,- ]);-- // Load cover image after data loads- useEffect(() => {- const loadCover = async () => {- const coverUrl = await loadCoverImage({- journeyData,- files,- collection,- });- if (coverUrl) {- setCoverImageUrl(coverUrl);- }- };-- void loadCover();- }, [journeyData, files, collection, setCoverImageUrl]);-};diff --git a/web/apps/photos/src/components/TripLayout/hooks/useFileViewer.ts b/web/apps/photos/src/components/TripLayout/hooks/useFileViewer.tsdeleted file mode 100644index b58ff27142..0000000000--- a/web/apps/photos/src/components/TripLayout/hooks/useFileViewer.ts+++ /dev/null@@ -1,72 +0,0 @@-import { type EnteFile } from "ente-media/file";-import { fileCreationTime } from "ente-media/file-metadata";-import { useCallback, useState } from "react";-import type { JourneyPoint } from "../types";--interface UseFileViewerProps {- files: EnteFile[];- onSetOpenFileViewer?: (open: boolean) => void;- onRemotePull?: () => Promise<void>;-}--export const useFileViewer = ({- files,- onSetOpenFileViewer,- onRemotePull,-}: UseFileViewerProps) => {- const [openFileViewer, setOpenFileViewer] = useState(false);- const [currentFileIndex, setCurrentFileIndex] = useState(0);- const [viewerFiles, setViewerFiles] = useState<EnteFile[]>([]);-- const handleOpenFileViewer = useCallback(- (cluster: JourneyPoint[], clickedFileId: number) => {- // Get file IDs from the cluster- const clusterFileIds = cluster.map((point) => point.fileId);-- // Filter files to only include those from the cluster- const clusterFiles = files.filter((file) =>- clusterFileIds.includes(file.id),- );-- // Sort cluster files by creation time- const sortedClusterFiles = [...clusterFiles].sort(- (a, b) => fileCreationTime(a) - fileCreationTime(b),- );-- // Find the index of the clicked photo in the cluster files- const clickedIndex = sortedClusterFiles.findIndex(- (f) => f.id === clickedFileId,- );-- if (clickedIndex !== -1 && sortedClusterFiles.length > 0) {- // Batch state updates to avoid multiple re-renders- setViewerFiles(sortedClusterFiles);- setCurrentFileIndex(clickedIndex);- setOpenFileViewer(true);- onSetOpenFileViewer?.(true);- }- },- [files, onSetOpenFileViewer],- );-- const handleCloseFileViewer = useCallback(() => {- // Batch state updates- setOpenFileViewer(false);- onSetOpenFileViewer?.(false);- }, [onSetOpenFileViewer]);-- const handleTriggerRemotePull = useCallback(() => {- return onRemotePull?.() || Promise.resolve();- }, [onRemotePull]);-- return {- // State- openFileViewer,- currentFileIndex,- viewerFiles,- // Handlers- handleOpenFileViewer,- handleCloseFileViewer,- handleTriggerRemotePull,- };-};diff --git a/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.ts b/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.tsdeleted file mode 100644index db2833e6d5..0000000000--- a/web/apps/photos/src/components/TripLayout/hooks/useLocationFetching.ts+++ /dev/null@@ -1,90 +0,0 @@-import { useEffect, useRef } from "react";--import type { JourneyPoint } from "../types";-import { fetchLocationNames } from "../utils/dataProcessing";--export interface UseLocationFetchingParams {- photoClusters: JourneyPoint[][];- journeyData: JourneyPoint[];- locationDataRef: React.RefObject<- Map<number, { name: string; country: string }>- >;- setJourneyData: (- data: JourneyPoint[] | ((prev: JourneyPoint[]) => JourneyPoint[]),- ) => void;- setIsLoadingLocations: (loading: boolean) => void;-}--export const useLocationFetching = ({- photoClusters,- locationDataRef,- setJourneyData,- setIsLoadingLocations,-}: UseLocationFetchingParams) => {- const processedPhotoIdsRef = useRef<Set<number>>(new Set());- const lastFetchedClustersRef = useRef<string>("");-- // Fetch location names for clusters- useEffect(() => {- // Create a stable key for current clusters to prevent duplicate fetches- const clustersKey = photoClusters- .map((cluster) => cluster.map((p) => p.fileId).join(","))- .join("|");-- // Skip if we already fetched for these exact clusters- if (clustersKey === lastFetchedClustersRef.current) {- return;- }-- const fetchNames = async () => {- if (photoClusters.length === 0) return;-- // Get all current photo IDs- const currentPhotoIds = new Set(- photoClusters.flat().map((photo) => photo.fileId),- );-- // Check if any photos need location fetching- const needsFetching = photoClusters.some((cluster) =>- cluster.some(- (photo) => !locationDataRef.current.has(photo.fileId),- ),- );-- if (!needsFetching) {- setIsLoadingLocations(false);- return;- }-- setIsLoadingLocations(true);- lastFetchedClustersRef.current = clustersKey;-- try {- const { updatedPhotos } = await fetchLocationNames({- photoClusters,- journeyData: [],- locationDataRef,- });-- if (updatedPhotos.size > 0) {- setJourneyData((prevData) =>- prevData.map((photo) => {- const update = updatedPhotos.get(photo.fileId);- if (update) {- return { ...photo, ...update };- }- return photo;- }),- );- }-- // Update processed photos set- processedPhotoIdsRef.current = currentPhotoIds;- } finally {- setIsLoadingLocations(false);- }- };-- void fetchNames();- }, [photoClusters, locationDataRef, setJourneyData, setIsLoadingLocations]);-};diff --git a/web/apps/photos/src/components/TripLayout/hooks/useScrollHandling.ts b/web/apps/photos/src/components/TripLayout/hooks/useScrollHandling.tsdeleted file mode 100644index 2b1cdff5b0..0000000000--- a/web/apps/photos/src/components/TripLayout/hooks/useScrollHandling.ts+++ /dev/null@@ -1,170 +0,0 @@-import { useCallback, useEffect, useMemo } from "react";--import type { JourneyPoint } from "../types";-import { throttle } from "../utils/geocoding";-import {- handleMarkerClick,- handleTimelineScroll,- scrollTimelineToLocation,- updateLocationPositions,- type PositionInfo,-} from "../utils/scrollUtils";--export interface UseScrollHandlingParams {- timelineRef: React.RefObject<HTMLDivElement | null>;- photoClusters: JourneyPoint[][];- locationPositions: PositionInfo[];- mapRef: L.Map | null;- locationRefs: React.RefObject<(HTMLDivElement | null)[]>;- isClusterClickScrollingRef: React.RefObject<boolean>;- clusterClickTimeoutRef: React.RefObject<NodeJS.Timeout | null>;- previousActiveLocationRef: React.RefObject<number>;- setLocationPositions: (positions: PositionInfo[]) => void;- setHasUserScrolled: (scrolled: boolean) => void;- setScrollProgress: (progress: number) => void;- setTargetZoom: (zoom: number | null) => void;- isMobileOrTablet: boolean;-}--export const useScrollHandling = ({- timelineRef,- photoClusters,- locationPositions,- mapRef,- locationRefs,- isClusterClickScrollingRef,- clusterClickTimeoutRef,- previousActiveLocationRef,- setLocationPositions,- setHasUserScrolled,- setScrollProgress,- setTargetZoom,- isMobileOrTablet,-}: UseScrollHandlingParams) => {- // Update location positions callback- const updatePositions = useCallback(() => {- updateLocationPositions({- locationRefs: locationRefs.current,- setLocationPositions,- });- }, [locationRefs, setLocationPositions]);-- // Timeline scroll handler- const timelineScrollHandler = useCallback(() => {- handleTimelineScroll({- timelineRef,- photoClusters,- locationPositions,- mapRef,- isClusterClickScrollingRef,- setHasUserScrolled,- setScrollProgress,- previousActiveLocationRef,- isMobileOrTablet,- setTargetZoom,- });- }, [- timelineRef,- photoClusters,- locationPositions,- mapRef,- isClusterClickScrollingRef,- setHasUserScrolled,- setScrollProgress,- previousActiveLocationRef,- isMobileOrTablet,- setTargetZoom,- ]);-- // Throttled scroll handler- const throttledTimelineScroll = useMemo(- () => throttle(timelineScrollHandler, 16),- [timelineScrollHandler],- );-- // Timeline scroll to location function- const scrollToLocation = useCallback(- (locationIndex: number) => {- scrollTimelineToLocation({- timelineRef,- locationIndex,- photoClusters,- locationPositions,- isMobileOrTablet,- });- },- [timelineRef, photoClusters, locationPositions, isMobileOrTablet],- );-- // Marker click handler- const markerClickHandler = useCallback(- (clusterIndex: number, clusterLat: number, clusterLng: number) => {- handleMarkerClick({- clusterIndex,- clusterLat,- clusterLng,- photoClusters,- mapRef,- isClusterClickScrollingRef,- clusterClickTimeoutRef,- setScrollProgress,- setHasUserScrolled,- scrollTimelineToLocation: scrollToLocation,- isMobileOrTablet,- setTargetZoom,- previousActiveLocationRef,- });- },- [- photoClusters,- mapRef,- isClusterClickScrollingRef,- clusterClickTimeoutRef,- setScrollProgress,- setHasUserScrolled,- scrollToLocation,- isMobileOrTablet,- setTargetZoom,- previousActiveLocationRef,- ],- );-- // Update positions when locations render- useEffect(() => {- if (- locationRefs.current.length === photoClusters.length &&- photoClusters.length > 0- ) {- const timer = setTimeout(updatePositions, 100);- return () => clearTimeout(timer);- }- return undefined;- }, [photoClusters, updatePositions, locationRefs]);-- // Add scroll event listener- useEffect(() => {- const timelineContainer = timelineRef.current;- if (!timelineContainer) return;-- timelineContainer.addEventListener("scroll", throttledTimelineScroll);-- return () => {- timelineContainer.removeEventListener(- "scroll",- throttledTimelineScroll,- );- };- }, [throttledTimelineScroll, timelineRef]);-- // Cleanup timeout on unmount- useEffect(() => {- return () => {- if (clusterClickTimeoutRef.current) {- clearTimeout(clusterClickTimeoutRef.current);- clusterClickTimeoutRef.current = null;- }- };- }, [clusterClickTimeoutRef]);-- return { updatePositions, scrollToLocation, markerClickHandler };-};diff --git a/web/apps/photos/src/components/TripLayout/hooks/useThumbnailGeneration.ts b/web/apps/photos/src/components/TripLayout/hooks/useThumbnailGeneration.tsdeleted file mode 100644index d999859dd9..0000000000--- a/web/apps/photos/src/components/TripLayout/hooks/useThumbnailGeneration.ts+++ /dev/null@@ -1,74 +0,0 @@-import { type EnteFile } from "ente-media/file";-import { useEffect, useRef } from "react";--import type { JourneyPoint } from "../types";-import { generateNeededThumbnails } from "../utils/dataProcessing";--export interface UseThumbnailGenerationParams {- photoClusters: JourneyPoint[][];- journeyData: JourneyPoint[];- files: EnteFile[];- thumbnailsGeneratedRef: React.RefObject<boolean>;- setJourneyData: (- data: JourneyPoint[] | ((prev: JourneyPoint[]) => JourneyPoint[]),- ) => void;-}--export const useThumbnailGeneration = ({- photoClusters,- files,- thumbnailsGeneratedRef,- setJourneyData,-}: UseThumbnailGenerationParams) => {- const processedPhotoIdsRef = useRef<Set<number>>(new Set());-- // Generate thumbnails for needed photos with progressive loading- useEffect(() => {- const generateThumbs = async () => {- if (photoClusters.length === 0) return;-- // Get all current photo IDs- const currentPhotoIds = new Set(- photoClusters.flat().map((photo) => photo.fileId),- );-- // Check if we have photos that need thumbnails- const photosNeedingThumbnails = photoClusters- .flat()- .filter(- (photo) =>- !photo.image &&- (!processedPhotoIdsRef.current.has(photo.fileId) ||- !thumbnailsGeneratedRef.current),- );-- if (photosNeedingThumbnails.length === 0) return;-- const { thumbnailUpdates } = await generateNeededThumbnails({- photoClusters,- files,- });-- if (thumbnailUpdates.size > 0) {- setJourneyData((prevData) =>- prevData.map((photo) => {- const thumbnailUrl = thumbnailUpdates.get(photo.fileId);- if (thumbnailUrl && !photo.image) {- return { ...photo, image: thumbnailUrl };- }- return photo;- }),- );- }-- // Update processed photos set and mark as generated- processedPhotoIdsRef.current = new Set([- ...processedPhotoIdsRef.current,- ...currentPhotoIds,- ]);- thumbnailsGeneratedRef.current = true;- };-- void generateThumbs();- }, [photoClusters, files, thumbnailsGeneratedRef, setJourneyData]);-};diff --git a/web/apps/photos/src/components/TripLayout/index.tsx b/web/apps/photos/src/components/TripLayout/index.tsxdeleted file mode 100644index cee4133053..0000000000--- a/web/apps/photos/src/components/TripLayout/index.tsx+++ /dev/null@@ -1,822 +0,0 @@-import { Box, styled, useMediaQuery, useTheme } from "@mui/material";-import { ActiveDownloadStatusNotifications } from "components/ActiveDownloadStatusNotifications";-import { useModalVisibility } from "ente-base/components/utils/modal";-import type { PublicAlbumsCredentials } from "ente-base/http";-import { useSaveGroupsActions } from "ente-gallery/components/utils/save-groups";-import {- FileViewer,- type FileViewerInitialSidebar,-} from "ente-gallery/components/viewer/FileViewer";-import {- PublicFeedSidebar,- type PublicFeedItemClickInfo,-} from "ente-gallery/components/viewer/PublicFeedSidebar";-import { downloadAndSaveCollectionFiles } from "ente-gallery/services/save";-import { type Collection } from "ente-media/collection";-import { type EnteFile } from "ente-media/file";-import { useJoinAlbum } from "hooks/useJoinAlbum";-import { useEffect, useRef, useState } from "react";--// Import extracted components-import { MobileCover } from "./MobileCover";-import { MobileNavBar } from "./MobileNavBar";-import { MobileTimelineLocation } from "./MobileTimelineLocation";-import { MobileTripStarted } from "./MobileTripStarted";-import { TimelineBaseLine } from "./TimelineBaseLine";-import { TimelineLocation } from "./TimelineLocation";-import { TimelineProgressLine } from "./TimelineProgressLine";-import { TopNavButtons } from "./TopNavButtons";-import { TripCover } from "./TripCover";--// Import hooks-import { useDataProcessing } from "./hooks/useDataProcessing";-import { useFileViewer } from "./hooks/useFileViewer";-import { useLocationFetching } from "./hooks/useLocationFetching";-import { useScrollHandling } from "./hooks/useScrollHandling";-import { useThumbnailGeneration } from "./hooks/useThumbnailGeneration";--// Import types and utils-import type { JourneyPoint } from "./types";-import type { PositionInfo } from "./utils/scrollUtils";--interface TripLayoutProps {- files: EnteFile[];- collection?: Collection;- albumTitle?: string;- user?: { id: number; email: string; token: string; [key: string]: unknown }; // User object for FileViewer- // FileViewer related props (optional, can be added as needed)- enableDownload?: boolean;- onSetOpenFileViewer?: (open: boolean) => void;- onRemotePull?: () => Promise<void>;- onAddPhotos?: () => void; // Callback for add photos button- // Join album props- accessToken?: string;- collectionKey?: string;- credentials?: React.RefObject<PublicAlbumsCredentials | undefined>;- /**- * `true` if comments/reactions are enabled on the public link.- * When `false`, the feed button will be hidden.- */- enableComment?: boolean;- /**- * `true` if the "Join album" option is enabled for this public link.- * When `false`, the "Join album and like/comment" buttons will be hidden.- */- enableJoin?: boolean;-}--export const TripLayout: React.FC<TripLayoutProps> = ({- files,- collection,- albumTitle,- user,- enableDownload,- onSetOpenFileViewer,- onRemotePull,- onAddPhotos,- accessToken,- collectionKey,- credentials,- enableComment = true,- enableJoin = true,-}) => {- // Extract collection info if available- const collectionTitle = collection?.name || albumTitle || "Trip";-- // Use media query for mobile/tablet detection (up to 960px)- const theme = useTheme();- const isMobileOrTablet = useMediaQuery(theme.breakpoints.down("md")); // 960px breakpoint for mobile and tablet-- // Save groups hook for download progress tracking- const { onAddSaveGroup } = useSaveGroupsActions();- const { show: showPublicFeed, props: publicFeedVisibilityProps } =- useModalVisibility();-- // Navigation state for feed item clicks- const [initialSidebar, setInitialSidebar] = useState<- FileViewerInitialSidebar | undefined- >(undefined);- const [highlightCommentID, setHighlightCommentID] = useState<- string | undefined- >(undefined);-- // File viewer hook- const {- openFileViewer,- currentFileIndex,- viewerFiles,- handleOpenFileViewer,- handleCloseFileViewer,- handleTriggerRemotePull,- } = useFileViewer({ files, onSetOpenFileViewer, onRemotePull });-- // Join album hook for file viewer's public like modal- const { handleJoinAlbum } = useJoinAlbum({- publicCollection: collection,- accessToken,- collectionKey,- credentials,- });-- /**- * Handle clicks on feed items to navigate to the file and open sidebar.- */- const handleFeedItemClick = (info: PublicFeedItemClickInfo) => {- // Find the file in the journey data to get its cluster- const journeyPoint = journeyData.find(- (point) => point.fileId === info.fileID,- );- if (!journeyPoint) return;-- // Find the cluster that contains this file- const cluster = photoClusters.find((c) =>- c.some((p) => p.fileId === info.fileID),- );- if (!cluster) return;-- // Close the feed sidebar- publicFeedVisibilityProps.onClose();-- // Determine which sidebar to open- const sidebar: FileViewerInitialSidebar =- info.type === "liked_photo" || info.type === "liked_video"- ? "likes"- : "comments";-- // Set navigation state and open file viewer- setInitialSidebar(sidebar);- setHighlightCommentID(info.commentID);- handleOpenFileViewer(cluster, info.fileID);- };-- /**- * Handle file viewer close to clear navigation state.- */- const handleCloseFileViewerWithCleanup = () => {- setInitialSidebar(undefined);- setHighlightCommentID(undefined);- handleCloseFileViewer();- };-- // Download all files functionality- const downloadAllFiles = () => {- if (!collection) return;- void downloadAndSaveCollectionFiles(- collectionTitle,- collection.id,- files,- undefined,- onAddSaveGroup,- );- };-- const [journeyData, setJourneyData] = useState<JourneyPoint[]>([]);- const [coverImageUrl, setCoverImageUrl] = useState<string | null>(null);- const [isClient, setIsClient] = useState(false);- const [isLoadingLocations, setIsLoadingLocations] = useState(false);- const [isInitialLoad, setIsInitialLoad] = useState(true);- const [currentZoom, setCurrentZoom] = useState(7); // Default zoom, will be updated by MapEvents and optimalZoom- const [mapRef, setMapRef] = useState<import("leaflet").Map | null>(null);- const [, setTargetZoom] = useState<number | null>(null); // Only setter is used by child components- const [scrollProgress, setScrollProgress] = useState(0); // 0 to 1 representing scroll progress- const [hasUserScrolled, setHasUserScrolled] = useState(false); // Track if user has actually scrolled- const [showMobileCover, setShowMobileCover] = useState(true); // Track mobile cover state- const [locationPositions, setLocationPositions] = useState<PositionInfo[]>(- [],- );- const timelineRef = useRef<HTMLDivElement>(null);- const locationRefs = useRef<(HTMLDivElement | null)[]>([]);- const tripStartedRef = useRef<HTMLDivElement | null>(null);- const isClusterClickScrollingRef = useRef(false); // Use ref for immediate updates- const clusterClickTimeoutRef = useRef<NodeJS.Timeout | null>(null); // Timeout for cluster clicks- const thumbnailsGeneratedRef = useRef(false); // Track if thumbnails have been generated- const locationDataRef = useRef<- Map<number, { name: string; country: string }>- >(new Map()); // Track location data to prevent resets- const filesCountRef = useRef<number>(0); // Track files count to detect real changes- const previousActiveLocationRef = useRef<number>(-1); // Track previous active location for discrete panning-- const [photoClusters, setPhotoClusters] = useState<JourneyPoint[][]>([]);- const [optimalZoom, setOptimalZoom] = useState(7);- const [TripMapComponent, setTripMapComponent] =- useState<React.ComponentType<{- journeyData: JourneyPoint[];- photoClusters: JourneyPoint[][];- hasPhotoData: boolean;- optimalZoom: number;- scrollProgress: number;- setMapRef: (map: import("leaflet").Map | null) => void;- setCurrentZoom: (zoom: number) => void;- setTargetZoom: (zoom: number | null) => void;- onMarkerClick: (- clusterIndex: number,- clusterLat: number,- clusterLng: number,- ) => void;- }> | null>(null);-- // Load client-side components and calculations- useEffect(() => {- if (isClient) {- // Load TripMap component- void import("./TripMap").then(({ TripMap }) => {- setTripMapComponent(() => TripMap);- });-- // Load mapHelpers and calculate clusters if we have data- if (journeyData.length > 0) {- void import("./mapHelpers").then(- ({ clusterPhotosByProximity, calculateOptimalZoom }) => {- const clusters = clusterPhotosByProximity(journeyData);-- // Sort clusters by their earliest timestamp to maintain chronological order- const sortedClusters = clusters.sort((a, b) => {- const earliestA = Math.min(- ...a.map((p) =>- new Date(p.timestamp).getTime(),- ),- );- const earliestB = Math.min(- ...b.map((p) =>- new Date(p.timestamp).getTime(),- ),- );- return earliestA - earliestB;- });-- const optimalZoomLevel = calculateOptimalZoom();-- setPhotoClusters(sortedClusters);- setOptimalZoom(optimalZoomLevel);- },- );- }- }- }, [isClient, journeyData, isMobileOrTablet]);-- // Update currentZoom when optimalZoom changes and there's no mapRef yet- useEffect(() => {- if (!mapRef && optimalZoom !== currentZoom) {- setCurrentZoom(optimalZoom);- }- }, [optimalZoom, mapRef, currentZoom]);-- // Set client-side rendering flag- useEffect(() => {- setIsClient(true);- }, []);-- // Use extracted data processing hooks- useDataProcessing({- files,- collection,- journeyData,- thumbnailsGeneratedRef,- filesCountRef,- locationDataRef,- setJourneyData,- setIsInitialLoad,- setIsLoadingLocations,- setCoverImageUrl,- });-- useLocationFetching({- photoClusters,- journeyData,- locationDataRef,- setJourneyData,- setIsLoadingLocations,- });-- useThumbnailGeneration({- photoClusters,- journeyData,- files,- thumbnailsGeneratedRef,- setJourneyData,- });-- // Use extracted scroll handling hooks- const { markerClickHandler } = useScrollHandling({- timelineRef,- photoClusters,- locationPositions,- mapRef,- locationRefs,- isClusterClickScrollingRef,- clusterClickTimeoutRef,- previousActiveLocationRef,- setLocationPositions,- isMobileOrTablet,- setHasUserScrolled: (scrolled: boolean) => {- setHasUserScrolled(scrolled);- if (- isMobileOrTablet &&- tripStartedRef.current &&- timelineRef.current- ) {- const timelineContainer = timelineRef.current;- const tripStartedElement = tripStartedRef.current;- const tripStartedRect =- tripStartedElement.getBoundingClientRect();- const timelineRect = timelineContainer.getBoundingClientRect();-- // Show/hide cover based on trip started position- const threshold = timelineRect.top + timelineRect.height * 0.3;- if (tripStartedRect.bottom < threshold) {- setShowMobileCover(false);- } else {- setShowMobileCover(true);- }- }- },- setScrollProgress,- setTargetZoom,- });-- // Only wait for client-side rendering (needed for maps), but show layout immediately- // Let individual components handle their own loading states- if (!isClient) {- return null; // SSR compatibility- }-- // Show black background if no photo data yet- const hasPhotoData = journeyData.length > 0;-- return (- <TripLayoutContainer>- {!openFileViewer &&- (isMobileOrTablet ? (- <MobileNavBar- onAddPhotos={onAddPhotos}- downloadAllFiles={downloadAllFiles}- enableDownload={enableDownload}- onShowFeed={enableComment ? showPublicFeed : undefined}- collectionTitle={collectionTitle}- publicCollection={collection}- accessToken={accessToken}- collectionKey={collectionKey}- credentials={credentials}- />- ) : (- <TopNavButtons- onAddPhotos={onAddPhotos}- downloadAllFiles={downloadAllFiles}- enableDownload={enableDownload}- onShowFeed={enableComment ? showPublicFeed : undefined}- publicCollection={collection}- accessToken={accessToken}- collectionKey={collectionKey}- credentials={credentials}- />- ))}- {/* Mobile Layout */}- {isMobileOrTablet ? (- <MobileContainer>- {/* Map takes 60% of height */}- <MobileMapContainer>- {TripMapComponent && (- <TripMapComponent- journeyData={journeyData}- photoClusters={photoClusters}- hasPhotoData={hasPhotoData}- optimalZoom={optimalZoom}- scrollProgress={scrollProgress}- setMapRef={setMapRef}- setCurrentZoom={setCurrentZoom}- setTargetZoom={setTargetZoom}- onMarkerClick={markerClickHandler}- />- )}- {/* Cover overlay */}- {!isInitialLoad && journeyData.length > 0 && (- <MobileCoverOverlay show={showMobileCover}>- <MobileCover- journeyData={journeyData}- albumTitle={collectionTitle}- coverImageUrl={coverImageUrl}- />- </MobileCoverOverlay>- )}- </MobileMapContainer>-- {/* Timeline takes 40% of height */}- <MobileTimelineContainer ref={timelineRef}>- <MobileTimelineContent>- {isInitialLoad ? (- <MobileLoadingContainer>- <LoadingSpinner />- </MobileLoadingContainer>- ) : journeyData.length > 0 ? (- <div>- {isLoadingLocations ? (- <LocationsLoadingContainer>- <LoadingSpinner />- </LocationsLoadingContainer>- ) : (- <>- <MobileTripStarted- onRef={(el) => {- tripStartedRef.current = el;- }}- journeyData={journeyData}- />-- <TimelineContainer id="timeline-container">- <MobileTimelineBaseLine- photoClusters={- photoClusters- }- />-- {photoClusters.map(- (cluster, index) => (- <MobileTimelineLocation- key={index}- cluster={cluster}- index={index}- journeyData={- journeyData- }- onRef={(el) => {- locationRefs.current[- index- ] = el;- }}- onPhotoClick={- handleOpenFileViewer- }- />- ),- )}- </TimelineContainer>- </>- )}- </div>- ) : (- <NoPhotosContainer>- No photos found with location information.- </NoPhotosContainer>- )}- </MobileTimelineContent>- </MobileTimelineContainer>- </MobileContainer>- ) : (- <>- {/* Desktop Layout - Left Sidebar - Floating Timeline */}- <TimelineSidebar ref={timelineRef}>- <TimelineContent>- {isInitialLoad ? (- <LoadingCoverPlaceholder>- <LoadingCoverImage>- <CoverGradientOverlay />- <CoverPlaceholderContent>- <PlaceholderTextBox- sx={{- height: "30px",- width: "200px",- mb: "2px",- }}- />- <PlaceholderTextBox- sx={{- height: "16px",- width: "120px",- margin: 0,- }}- />- </CoverPlaceholderContent>- </LoadingCoverImage>- <LoadingSpinnerContainer>- <LoadingSpinner />- </LoadingSpinnerContainer>- </LoadingCoverPlaceholder>- ) : journeyData.length > 0 ? (- <div>- <TripCover- journeyData={journeyData}- albumTitle={collectionTitle}- coverImageUrl={coverImageUrl}- />-- {isLoadingLocations ? (- <LocationsLoadingContainer>- <LoadingSpinner />- </LocationsLoadingContainer>- ) : (- <>- <TimelineContainer id="timeline-container">- <TimelineBaseLine- locationPositions={- locationPositions- }- />-- <TimelineProgressLine- locationPositions={- locationPositions- }- scrollProgress={- scrollProgress- }- hasUserScrolled={- hasUserScrolled- }- photoClusters={- photoClusters- }- />-- {photoClusters.map(- (cluster, index) => (- <TimelineLocation- key={index}- cluster={cluster}- index={index}- photoClusters={- photoClusters- }- scrollProgress={- scrollProgress- }- journeyData={- journeyData- }- onRef={(el) => {- locationRefs.current[- index- ] = el;- }}- onPhotoClick={- handleOpenFileViewer- }- />- ),- )}- </TimelineContainer>- </>- )}- </div>- ) : (- <NoPhotosContainer>- No photos found with location information.- </NoPhotosContainer>- )}- </TimelineContent>- </TimelineSidebar>-- {/* Desktop Map Container */}- {TripMapComponent && (- <TripMapComponent- journeyData={journeyData}- photoClusters={photoClusters}- hasPhotoData={hasPhotoData}- optimalZoom={optimalZoom}- scrollProgress={scrollProgress}- setMapRef={setMapRef}- setCurrentZoom={setCurrentZoom}- setTargetZoom={setTargetZoom}- onMarkerClick={markerClickHandler}- />- )}- </>- )}-- {/* FileViewer for photo gallery */}- <FileViewer- open={openFileViewer}- onClose={handleCloseFileViewerWithCleanup}- initialIndex={currentFileIndex}- initialSidebar={initialSidebar}- highlightCommentID={highlightCommentID}- files={viewerFiles}- user={user}- disableDownload={!enableDownload}- onTriggerRemotePull={handleTriggerRemotePull}- onRemoteFilesPull={handleTriggerRemotePull}- onVisualFeedback={() => {- // No-op: Trip viewer is read-only and doesn't need visual feedback- }}- publicAlbumsCredentials={credentials?.current}- collectionKey={collectionKey}- onJoinAlbum={handleJoinAlbum}- enableComment={enableComment}- enableJoin={enableJoin}- />-- {/* Download progress notifications */}- <ActiveDownloadStatusNotifications fullWidthOnMobile />-- {/* Public feed sidebar */}- {collection && credentials?.current && collectionKey && (- <PublicFeedSidebar- {...publicFeedVisibilityProps}- files={files}- credentials={credentials.current}- collectionKey={collectionKey}- onItemClick={handleFeedItemClick}- />- )}- </TripLayoutContainer>- );-};--// Styled components-const TripLayoutContainer = styled(Box)({- position: "relative",- width: "100%",- height: "100%",-});--const TimelineSidebar = styled(Box)(({ theme }) => ({- position: "absolute",- left: "16px",- top: "16px",- bottom: "16px",- width: "680px",- overflow: "auto",- boxShadow: theme.shadows[10],- backgroundColor: theme.palette.background.paper,- zIndex: 1000,- borderRadius: "48px",- "&::-webkit-scrollbar": { width: "8px" },- "&::-webkit-scrollbar-track": {- background: "transparent",- borderRadius: "48px",- },- "&::-webkit-scrollbar-thumb": {- background: theme.palette.divider,- borderRadius: "48px",- "&:hover": { background: theme.palette.text.disabled },- },- scrollbarWidth: "thin",- scrollbarColor: `${theme.palette.divider} transparent`,- [theme.breakpoints.up(1920)]: { width: "960px" },-}));--const TimelineContent = styled(Box)({- padding: "32px",- height: "100%",- display: "flex",- flexDirection: "column",-});--const LoadingCoverPlaceholder = styled(Box)({ marginBottom: "96px" });--const LoadingCoverImage = styled(Box)(({ theme }) => ({- aspectRatio: "16/8",- position: "relative",- marginBottom: "12px",- borderRadius: "24px",- overflow: "hidden",- backgroundColor: theme.palette.grey[200],- animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",- "@keyframes pulse": { "0%, 100%": { opacity: 1 }, "50%": { opacity: 0.5 } },-}));--const CoverGradientOverlay = styled(Box)({- position: "absolute",- bottom: 0,- left: 0,- right: 0,- height: "128px",- background: "linear-gradient(to top, rgba(0,0,0,0.3), transparent)",-});--const CoverPlaceholderContent = styled(Box)({- position: "absolute",- bottom: 0,- left: 0,- right: 0,- padding: "24px",- color: "rgba(255, 255, 255, 0.7)",-});--const PlaceholderTextBox = styled(Box)({- backgroundColor: "rgba(255, 255, 255, 0.2)",- borderRadius: "4px",-});--const LoadingSpinnerContainer = styled(Box)({- display: "flex",- justifyContent: "center",- alignItems: "center",- padding: "60px 20px",- minHeight: "200px",-});--const LoadingSpinner = styled(Box)(({ theme }) => ({- animation: "spin 1s linear infinite",- borderRadius: "50%",- height: "40px",- width: "40px",- borderTop: `3px solid ${theme.palette.success.main}`,- borderRight: "3px solid transparent",- borderBottom: `3px solid ${theme.palette.success.main}`,- borderLeft: "3px solid transparent",- "@keyframes spin": {- from: { transform: "rotate(0deg)" },- to: { transform: "rotate(360deg)" },- },-}));--const LocationsLoadingContainer = styled(Box)({- position: "relative",- marginTop: "64px",- marginBottom: "200px",- textAlign: "center",- display: "flex",- justifyContent: "center",- alignItems: "center",-});--const TimelineContainer = styled(Box)({ position: "relative" });--const NoPhotosContainer = styled(Box)(({ theme }) => ({- display: "flex",- alignItems: "center",- justifyContent: "center",- textAlign: "center",- width: "100%",- flex: 1,- padding: "40px 20px",- color: theme.palette.text.secondary,- fontSize: "16px",-}));--// Mobile specific styled components-const MobileContainer = styled(Box)({- display: "flex",- flexDirection: "column",- height: "100svh",- width: "100%",-});--const MobileMapContainer = styled(Box)({- height: "calc(60svh + 20px)",- position: "relative",- overflow: "hidden",-});--const MobileTimelineContainer = styled(Box)(({ theme }) => ({- height: "40svh",- marginTop: "-20px",- overflow: "auto",- backgroundColor: theme.palette.background.paper,- boxShadow: `0 -4px 20px rgba(0, 0, 0, 0.1)`,- scrollSnapType: "y mandatory",- borderTopLeftRadius: "24px",- borderTopRightRadius: "24px",- zIndex: 1001,- "&::-webkit-scrollbar": { width: "6px" },- "&::-webkit-scrollbar-track": { background: "transparent" },- "&::-webkit-scrollbar-thumb": {- background: theme.palette.divider,- borderRadius: "20px",- "&:hover": { background: theme.palette.text.disabled },- },- scrollbarWidth: "thin",- scrollbarColor: `${theme.palette.divider} transparent`,-}));--const MobileCoverOverlay = styled(Box, {- shouldForwardProp: (prop) => prop !== "show",-})<{ show: boolean }>(({ show }) => ({- position: "absolute",- top: 0,- left: 0,- right: 0,- bottom: 0,- zIndex: 1000,- opacity: show ? 1 : 0,- transition: "opacity 0.5s ease-in-out",- pointerEvents: show ? "auto" : "none",-}));--const MobileTimelineContent = styled(Box)({- padding: "0",- height: "100%",- display: "flex",- flexDirection: "column",-});--const MobileLoadingContainer = styled(Box)({- display: "flex",- alignItems: "center",- justifyContent: "center",- height: "100%",- width: "100%",-});--const MobileTimelineBaseLine = styled(Box, {- shouldForwardProp: (prop) => prop !== "photoClusters",-})<{ photoClusters: JourneyPoint[][] }>(({ theme, photoClusters }) => ({- position: "absolute",- left: "50%",- top: "-15svh",- height: `${(photoClusters.length - 1) * 40 + 35}svh`,- width: "3px",- backgroundColor: theme.palette.grey[300],- transform: "translateX(-1.5px)",- zIndex: 0,-}));diff --git a/web/apps/photos/src/components/TripLayout/mapHelpers.ts b/web/apps/photos/src/components/TripLayout/mapHelpers.tsdeleted file mode 100644index 9ef10b15be..0000000000--- a/web/apps/photos/src/components/TripLayout/mapHelpers.ts+++ /dev/null@@ -1,311 +0,0 @@-import { haveWindow } from "ente-base/env";-import type { JourneyPoint } from "./types";-import { iconCache } from "./utils/geocoding";--// Mobile/tablet detection using media query breakpoint-const isMobileDevice = () => {- if (typeof window === "undefined") return false;- // Use 960px breakpoint to match Material-UI's "md" breakpoint for mobile and tablet- return window.innerWidth < 960;-};--// Conditionally import leaflet only in browser environment-const getLeaflet = () => {- if (haveWindow()) {- // eslint-disable-next-line @typescript-eslint/no-require-imports- return require("leaflet") as typeof import("leaflet");- }- return null;-};--// Calculate distance between two points using Haversine formula (returns distance in km)-export const calculateDistance = (- lat1: number,- lng1: number,- lat2: number,- lng2: number,-): number => {- const R = 6371; // Radius of Earth in kilometers- const dLat = (lat2 - lat1) * (Math.PI / 180);- const dLng = (lng2 - lng1) * (Math.PI / 180);- const a =- Math.sin(dLat / 2) * Math.sin(dLat / 2) +- Math.cos(lat1 * (Math.PI / 180)) *- Math.cos(lat2 * (Math.PI / 180)) *- Math.sin(dLng / 2) *- Math.sin(dLng / 2);- const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));- return R * c;-};--// Geographic clustering with responsive distance thresholds and day separation-export const clusterPhotosByProximity = (photos: JourneyPoint[]) => {- if (photos.length === 0) return [];-- // 5km clustering distance (roughly 0.05 degrees)- const distanceThreshold = 0.05; // About 5km in degrees-- // First, group photos by day- const photosByDay = new Map<string, JourneyPoint[]>();- photos.forEach((photo) => {- const date = new Date(photo.timestamp);- const dayKey = `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;-- if (!photosByDay.has(dayKey)) {- photosByDay.set(dayKey, []);- }- photosByDay.get(dayKey)!.push(photo);- });-- // Then cluster within each day- const allClusters: JourneyPoint[][] = [];-- photosByDay.forEach((dayPhotos) => {- const visited = new Set<number>();-- dayPhotos.forEach((photo, i) => {- if (visited.has(i)) return;-- const cluster = [photo];- visited.add(i);-- dayPhotos.forEach((otherPhoto, j) => {- if (i === j || visited.has(j)) return;-- const distance = Math.sqrt(- Math.pow(photo.lat - otherPhoto.lat, 2) +- Math.pow(photo.lng - otherPhoto.lng, 2),- );-- if (distance < distanceThreshold) {- cluster.push(otherPhoto);- visited.add(j);- }- });-- allClusters.push(cluster);- });- });-- return allClusters;-};--// Return fixed zoom level of 10 for consistent positioning-export const calculateOptimalZoom = (): number => {- // Return fixed zoom of 10 as per new requirements- return 10;-};--// Function to create icon with specific image and progress styling-export const createIcon = (- imageSrc: string,- size = 40,- borderColor = "#ffffff",- _clusterCount?: number,- isReached = false,-): import("leaflet").DivIcon | null => {- const leaflet = getLeaflet();- if (typeof window === "undefined" || !leaflet) {- // Fallback icon for SSR- return null;- }-- const pinSize = size + 16; // Make it square and bigger- const triangleHeight = size <= 30 ? 7 : 10; // Smaller triangle for mobile- const pinHeight = pinSize + triangleHeight + 2; // Add space for triangle- const hasImage = imageSrc && imageSrc.trim() !== "";-- // Adjust border radius for smaller mobile markers- const outerBorderRadius = size <= 30 ? 14 : 16;- const innerBorderRadius = size <= 30 ? 10 : 12;-- // Create cache key based on all parameters including border radius and triangle size- const cacheKey = `icon_${imageSrc}_${size}_${borderColor}_${isReached}_${outerBorderRadius}_${innerBorderRadius}_${triangleHeight}`;-- const cachedIcon = iconCache.get(cacheKey);- if (cachedIcon) {- return cachedIcon;- }-- const icon = leaflet.divIcon({- html: `- <div class="photo-pin${isReached ? " reached" : ""}" style="- width: ${pinSize}px;- height: ${pinHeight}px;- position: relative;- cursor: pointer;- transition: all 0.3s ease;- ">- <!-- Main rounded rectangle container -->- <div style="- width: ${pinSize}px;- height: ${pinSize}px;- border-radius: ${outerBorderRadius}px;- background: ${isReached ? "#22c55e" : "white"};- border: 2px solid ${isReached ? "#22c55e" : borderColor};- padding: 4px;- position: relative;- overflow: hidden;- transition: background-color 0.3s ease, border-color 0.3s ease;- "- onmouseover="this.style.background='#22c55e'; this.style.borderColor='#22c55e'; this.nextElementSibling.style.borderTopColor='#22c55e';"- onmouseout="this.style.background='${isReached ? "#22c55e" : "white"}'; this.style.borderColor='${isReached ? "#22c55e" : "#ffffff"}'; this.nextElementSibling.style.borderTopColor='${isReached ? "#22c55e" : "white"}';"- >- ${- hasImage- ? `- <!-- Image inside the rounded rectangle -->- <img- src="${imageSrc}"- style="- width: 100%;- height: 100%;- object-fit: cover;- border-radius: ${innerBorderRadius}px;- "- alt="Location"- />- `- : `- <!-- Loading skeleton when no image -->- <div style="- width: 100%;- height: 100%;- border-radius: ${innerBorderRadius}px;- animation: skeleton-pulse 1.5s ease-in-out infinite;- "></div>- <style>- @keyframes skeleton-pulse {- 0% { background-color: #ffffff; }- 50% { background-color: #f0f0f0; }- 100% { background-color: #ffffff; }- }- </style>- `- }- </div>-- <!-- Triangle at the bottom -->- <div style="- position: absolute;- bottom: 2px;- left: 50%;- transform: translateX(-50%);- width: 0;- height: 0;- border-left: ${triangleHeight}px solid transparent;- border-right: ${triangleHeight}px solid transparent;- border-top: ${triangleHeight}px solid ${isReached ? "#22c55e" : "white"};- transition: border-top-color 0.3s ease;- "></div>- </div>- `,- className: "custom-pin-marker",- iconSize: [pinSize, pinHeight],- iconAnchor: [pinSize / 2, pinHeight],- popupAnchor: [0, -pinHeight],- });-- // Cache the icon- iconCache.set(cacheKey, icon);- return icon;-};--// Calculate map center with first location positioned at 20% from right edge-export const getMapCenter = (- photoClusters: JourneyPoint[][],- journeyData: JourneyPoint[],-): [number, number] => {- // If no clusters yet, check journey data- if (photoClusters.length === 0) {- const firstPoint = journeyData[0];- if (!firstPoint) return [0, 0]; // Fallback, but map won't render anyway- return [firstPoint.lat, firstPoint.lng];- }-- // Start at first cluster center- const firstCluster = photoClusters[0];- if (!firstCluster || firstCluster.length === 0) return [0, 0]; // Fallback, but map won't render anyway-- const firstLat =- firstCluster.reduce((sum, p) => sum + p.lat, 0) / firstCluster.length;- const firstLng =- firstCluster.reduce((sum, p) => sum + p.lng, 0) / firstCluster.length;-- // Position first location at 20% from right edge (80% from left)- // At zoom level 10, each pixel represents approximately 152.87 meters- // On mobile, timeline is at bottom so full width is available; on desktop, timeline takes up 50% of screen width- // We want the first location to be at 20% from right of the visible map area- // This means shifting map center left so marker appears more to the right-- const isMobile = isMobileDevice();- const timelineWidthRatio = isMobile ? 0.0 : 0.5; // Mobile: full width, Desktop: timeline takes up 50% of screen-- // At zoom 10, approximately 0.35 degrees per 1000px at equator- // For positioning, we need to shift the longitude to place marker at desired position- const degreesPerPixelAtZoom10 = 0.35 / 1000; // rough approximation- const basePixelsToShift =- (window.innerWidth || 1400) * (1 - timelineWidthRatio);- const pixelsToShiftFor20Percent = isMobile- ? basePixelsToShift * 0.6 // Mobile: less aggressive positioning (60% instead of 300%)- : basePixelsToShift * 3.0; // Desktop: 300% of visible map width to shift map left- const lngShift = pixelsToShiftFor20Percent * degreesPerPixelAtZoom10;-- const adjustedLng = firstLng - lngShift;-- return [firstLat, adjustedLng];-};--// Calculate position for a location to be at 20% from right edge of visible map-export const getLocationPosition = (- lat: number,- lng: number,-): [number, number] => {- // Position location at 20% from right edge (80% from left) of visible map area- // On mobile, the timeline is at the bottom, not the side, so full width is available for map- const isMobile = isMobileDevice();- const timelineWidthRatio = isMobile ? 0.0 : 0.5; // Mobile: full width, Desktop: timeline takes up 50% of screen- const degreesPerPixelAtZoom10 = 0.35 / 1000; // rough approximation at zoom 10-- // Calculate shift to position marker at 20% from right edge of visible map- // Need to shift map center left so the marker appears more to the right- // On mobile, use less aggressive positioning since we have full width- const basePixelsToShift =- (window.innerWidth || 1400) * (1 - timelineWidthRatio);- const pixelsToShiftFor20Percent = isMobile- ? basePixelsToShift * 0.6 // Mobile: less aggressive positioning (60% instead of 300%)- : basePixelsToShift * 3.0; // Desktop: 300% of visible map width to shift map left- const lngShift = pixelsToShiftFor20Percent * degreesPerPixelAtZoom10;-- return [lat, lng - lngShift];-};--// Calculate position for a location to be at 20% from right edge at a specific zoom level-export const getLocationPositionAtZoom = (- lat: number,- lng: number,- zoom: number,-): [number, number] => {- // Position location at 20% from right edge (80% from left) of visible map area- // On mobile, the timeline is at the bottom, not the side, so full width is available for map- const isMobile = isMobileDevice();- const timelineWidthRatio = isMobile ? 0.0 : 0.5; // Mobile: full width, Desktop: timeline takes up 50% of screen-- // Scale the positioning offset based on zoom level- // At higher zoom levels, we need less offset since we're more zoomed in- const baseDegreesPerPixelAtZoom10 = 0.35 / 1000;- const zoomScaleFactor = Math.pow(2, 10 - zoom); // Scale relative to zoom 10- const degreesPerPixelAtCurrentZoom =- baseDegreesPerPixelAtZoom10 * zoomScaleFactor;-- // Calculate shift to position marker at 20% from right edge of visible map- // On mobile, use less aggressive positioning since we have full width- const basePixelsToShift =- (window.innerWidth || 1400) * (1 - timelineWidthRatio);- const pixelsToShiftFor20Percent = isMobile- ? basePixelsToShift * 0.6 // Mobile: less aggressive positioning (60% instead of 300%)- : basePixelsToShift * 3.0; // Desktop: 300% of visible map width to shift map left- const lngShift = pixelsToShiftFor20Percent * degreesPerPixelAtCurrentZoom;-- return [lat, lng - lngShift];-};diff --git a/web/apps/photos/src/components/TripLayout/types.ts b/web/apps/photos/src/components/TripLayout/types.tsdeleted file mode 100644index b1a482a1c8..0000000000--- a/web/apps/photos/src/components/TripLayout/types.ts+++ /dev/null@@ -1,9 +0,0 @@-export interface JourneyPoint {- lat: number;- lng: number;- name: string;- country: string;- timestamp: string;- image: string;- fileId: number;-}diff --git a/web/apps/photos/src/components/TripLayout/utils/dataProcessing.ts b/web/apps/photos/src/components/TripLayout/utils/dataProcessing.tsdeleted file mode 100644index bbf09c4197..0000000000--- a/web/apps/photos/src/components/TripLayout/utils/dataProcessing.ts+++ /dev/null@@ -1,273 +0,0 @@-import { downloadManager } from "ente-gallery/services/download";-import { type EnteFile } from "ente-media/file";-import {- fileCreationTime,- fileFileName,- fileLocation,-} from "ente-media/file-metadata";-import React from "react";--import type { JourneyPoint } from "../types";-import { getLocationName } from "./geocoding";--export interface ProcessPhotosDataParams {- files: EnteFile[];- locationDataRef: React.RefObject<- Map<number, { name: string; country: string }>- >;-}--export interface ProcessPhotosDataResult {- photoData: JourneyPoint[];- hasLocationData: boolean;-}--export const processPhotosData = ({- files,- locationDataRef,-}: ProcessPhotosDataParams): ProcessPhotosDataResult => {- const photoData: JourneyPoint[] = [];-- if (files.length === 0) {- return { photoData, hasLocationData: false };- }-- for (const file of files) {- try {- const location = fileLocation(file);-- if (location) {- const cachedLocation = locationDataRef.current.get(file.id);- const finalName = cachedLocation?.name || fileFileName(file);- const finalCountry = cachedLocation?.country || "Unknown";-- photoData.push({- lat: location.latitude,- lng: location.longitude,- name: finalName,- country: finalCountry,- timestamp: new Date(- fileCreationTime(file) / 1000,- ).toISOString(),- image: "",- fileId: file.id,- });- }- } catch {- // Silently ignore processing errors for individual files- }- }-- photoData.sort(- (a, b) =>- new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime(),- );-- return { photoData, hasLocationData: photoData.length > 0 };-};--export interface FetchLocationNamesParams {- photoClusters: JourneyPoint[][];- journeyData: JourneyPoint[];- locationDataRef: React.RefObject<- Map<number, { name: string; country: string }>- >;-}--export interface FetchLocationNamesResult {- updatedPhotos: Map<number, { name: string; country: string }>;-}--export const fetchLocationNames = async ({- photoClusters,- locationDataRef,-}: FetchLocationNamesParams): Promise<FetchLocationNamesResult> => {- const updatedPhotos = new Map<number, { name: string; country: string }>();-- if (photoClusters.length === 0) {- return { updatedPhotos };- }-- // Create all geocoding promises at once for parallel execution- const geocodingPromises = photoClusters.map(async (cluster) => {- if (cluster.length === 0) return null;-- const representativePhoto = cluster[0];- if (!representativePhoto) return null;-- try {- const locationInfo = await getLocationName(- representativePhoto.lat,- representativePhoto.lng,- );- return { cluster, locationInfo };- } catch {- // Return null on error, will be filtered out- return null;- }- });-- // Execute all geocoding requests in parallel- const results = await Promise.all(geocodingPromises);-- // Process results and update maps- results.forEach((result) => {- if (!result) return; // Skip failed requests-- const { cluster, locationInfo } = result;- cluster.forEach((photo) => {- updatedPhotos.set(photo.fileId, {- name: locationInfo.place,- country: locationInfo.country,- });- locationDataRef.current.set(photo.fileId, {- name: locationInfo.place,- country: locationInfo.country,- });- });- });-- return { updatedPhotos };-};--export interface GenerateThumbnailsParams {- photoClusters: JourneyPoint[][];- files: EnteFile[];-}--export interface GenerateThumbnailsResult {- thumbnailUpdates: Map<number, string>;-}--export const generateNeededThumbnails = async ({- photoClusters,- files,-}: GenerateThumbnailsParams): Promise<GenerateThumbnailsResult> => {- const thumbnailUpdates = new Map<number, string>();-- if (photoClusters.length === 0) {- return { thumbnailUpdates };- }-- const filesById = new Map(files.map((file) => [file.id, file]));- const includedIds = new Set<number>();-- const addIfUnique = (group: EnteFile[], fileId: number) => {- const file = filesById.get(fileId);- if (!file) return;- if (includedIds.has(file.id)) return;- includedIds.add(file.id);- group.push(file);- };-- // Define priority groups with specific file collections- const priorityGroups: EnteFile[][] = [];-- // Priority 1: Cover image (handled separately in loadCoverImage, skip here)-- // Priority 2: First 3 locations photosfans (first 3 photos from each)- const firstLocationsFiles: EnteFile[] = [];- photoClusters.slice(0, 3).forEach((cluster) => {- cluster.slice(0, 3).forEach((photo) => {- addIfUnique(firstLocationsFiles, photo.fileId);- });- });- if (firstLocationsFiles.length > 0) {- priorityGroups.push(firstLocationsFiles);- }-- // Priority 3: Map marker photos (first photo from each cluster for markers)- const mapMarkerFiles: EnteFile[] = [];- photoClusters.forEach((cluster) => {- if (cluster.length > 0 && cluster[0]) {- const firstPhoto = cluster[0];- addIfUnique(mapMarkerFiles, firstPhoto.fileId);- }- });- if (mapMarkerFiles.length > 0) {- priorityGroups.push(mapMarkerFiles);- }-- // Priority 4: Rest of locations photosfans (remaining locations, first 3 from each)- const remainingLocationFiles: EnteFile[] = [];- photoClusters.slice(3).forEach((cluster) => {- cluster.slice(0, 3).forEach((photo) => {- addIfUnique(remainingLocationFiles, photo.fileId);- });- });- if (remainingLocationFiles.length > 0) {- priorityGroups.push(remainingLocationFiles);- }-- // Process priority groups sequentially with delays- for (let groupIndex = 0; groupIndex < priorityGroups.length; groupIndex++) {- const group = priorityGroups[groupIndex];- if (!group) continue;-- // Process files in parallel within each priority group- const groupPromises = group.map(async (file) => {- try {- const thumbnailUrl =- await downloadManager.renderableThumbnailURL(file);- if (thumbnailUrl) {- thumbnailUpdates.set(file.id, thumbnailUrl);- }- } catch {- // Silently ignore thumbnail generation errors- }- });-- await Promise.all(groupPromises);-- // Add small delay between priority groups to allow UI updates- if (groupIndex < priorityGroups.length - 1) {- await new Promise((resolve) => setTimeout(resolve, 50));- }- }-- return { thumbnailUpdates };-};--export interface LoadCoverImageParams {- journeyData: JourneyPoint[];- files: EnteFile[];- collection?: { pubMagicMetadata?: { data: { coverID?: number } } };-}--export const loadCoverImage = async ({- journeyData,- files,- collection,-}: LoadCoverImageParams): Promise<string | null> => {- if (journeyData.length === 0) return null;-- let coverFile: EnteFile | undefined;-- // Priority 1: Use explicit cover ID if set- const coverID = collection?.pubMagicMetadata?.data.coverID;- if (coverID) {- coverFile = files.find((f) => f.id === coverID);- }-- // Priority 2: Use first chronological photo as cover (highest priority)- if (!coverFile) {- const firstPhoto = journeyData[0];- if (!firstPhoto) return null;- coverFile = files.find((f) => f.id === firstPhoto.fileId);- }-- if (!coverFile) return null;-- try {- // Load cover image at highest quality first (highest priority)- const sourceURLs =- await downloadManager.renderableSourceURLs(coverFile);- if (sourceURLs.type === "image") {- return sourceURLs.imageURL;- }- } catch {- // Keep using thumbnail if high quality fails- }-- return null;-};diff --git a/web/apps/photos/src/components/TripLayout/utils/geocoding.ts b/web/apps/photos/src/components/TripLayout/utils/geocoding.tsdeleted file mode 100644index 557fe80e0a..0000000000--- a/web/apps/photos/src/components/TripLayout/utils/geocoding.ts+++ /dev/null@@ -1,100 +0,0 @@-interface StadiaMapsGeocodingResponse {- features?: {- properties?: {- locality?: string;- neighbourhood?: string;- county?: string;- region?: string;- name?: string;- country?: string;- [key: string]: unknown;- };- [key: string]: unknown;- }[];- [key: string]: unknown;-}--export interface LocationInfo {- place: string;- country: string;-}--// Icon cache to avoid recreating identical icons-export const iconCache = new Map<string, import("leaflet").DivIcon>();--// Throttle function for performance optimization-export const throttle = <T extends (...args: unknown[]) => void>(- func: T,- delay: number,-): ((...args: Parameters<T>) => void) => {- let timeoutId: NodeJS.Timeout | null = null;- let lastExecTime = 0;-- return (...args: Parameters<T>) => {- const currentTime = Date.now();-- if (currentTime - lastExecTime > delay) {- func(...args);- lastExecTime = currentTime;- } else {- if (timeoutId) clearTimeout(timeoutId);- timeoutId = setTimeout(- () => {- func(...args);- lastExecTime = Date.now();- },- delay - (currentTime - lastExecTime),- );- }- };-};--// Reverse geocoding function using Stadia Maps-export const getLocationName = async (- lat: number,- lng: number,-): Promise<LocationInfo> => {- try {- // Round coordinates to 2 decimal place for better geocoding- const roundedLat = Math.round(lat * 100) / 100;- const roundedLng = Math.round(lng * 100) / 100;-- const response = await fetch(- `https://api.stadiamaps.com/geocoding/v1/reverse?point.lat=${roundedLat}&point.lon=${roundedLng}`,- );-- if (!response.ok) {- throw new Error(`HTTP error! status: ${response.status}`);- }-- const data = (await response.json()) as StadiaMapsGeocodingResponse;-- // Extract location name from the response- const feature = data.features?.[0];- let result: LocationInfo;-- if (feature?.properties) {- const props = feature.properties;-- // Build location name with city and state/region for better context- const city = props.locality || props.neighbourhood;-- // Get location name- const locationName =- city || props.county || props.region || props.name || "Unknown";-- // Get country info- const country = props.country || "Unknown";-- result = { place: locationName, country };- } else {- // Fallback if no location found- result = { place: "Unknown", country: "Unknown" };- }-- return result;- } catch {- // Fallback on error- return { place: "Unknown", country: "Unknown" };- }-};diff --git a/web/apps/photos/src/components/TripLayout/utils/scrollUtils.ts b/web/apps/photos/src/components/TripLayout/utils/scrollUtils.tsdeleted file mode 100644index 2f31dff511..0000000000--- a/web/apps/photos/src/components/TripLayout/utils/scrollUtils.ts+++ /dev/null@@ -1,345 +0,0 @@-import { startTransition } from "react";--import { calculateDistance, getLocationPosition } from "../mapHelpers";-import type { JourneyPoint } from "../types";--export interface PositionInfo {- top: number;- center: number;-}--export interface UpdateLocationPositionsParams {- locationRefs: (HTMLDivElement | null)[];- setLocationPositions: (positions: PositionInfo[]) => void;-}--export const updateLocationPositions = ({- locationRefs,- setLocationPositions,-}: UpdateLocationPositionsParams) => {- if (locationRefs.length === 0) return;-- const positions = locationRefs.map((ref) => {- if (!ref) return { top: 0, center: 0 };- const rect = ref.getBoundingClientRect();- const top = ref.offsetTop;- const center = top + rect.height / 2;- return { top, center };- });-- startTransition(() => {- setLocationPositions(positions);- });-};--export interface HandleTimelineScrollParams {- timelineRef: React.RefObject<HTMLDivElement | null>;- photoClusters: JourneyPoint[][];- locationPositions: PositionInfo[];- mapRef: import("leaflet").Map | null;- isClusterClickScrollingRef: React.RefObject<boolean>;- setHasUserScrolled: (scrolled: boolean) => void;- setScrollProgress: (progress: number) => void;- previousActiveLocationRef: React.RefObject<number>;- isMobileOrTablet: boolean;- setTargetZoom: (zoom: number | null) => void;-}--export const handleTimelineScroll = ({- timelineRef,- photoClusters,- locationPositions,- mapRef,- isClusterClickScrollingRef,- setHasUserScrolled,- setScrollProgress,- previousActiveLocationRef,- isMobileOrTablet,- setTargetZoom,-}: HandleTimelineScrollParams) => {- if (- !timelineRef.current ||- photoClusters.length === 0 ||- locationPositions.length === 0- )- return;-- const timelineContainer = timelineRef.current;- const scrollHeight = timelineContainer.scrollHeight;- const clientHeight = timelineContainer.clientHeight;- const scrollTop = timelineContainer.scrollTop;-- // Calculate scroll progress (0 to 1)- const isAtBottom = scrollTop + clientHeight >= scrollHeight - 10;- let progress = 0;- if (isAtBottom) {- progress = 1;- } else {- const maxScrollableDistance = scrollHeight - clientHeight;- if (maxScrollableDistance > 0) {- progress = scrollTop / maxScrollableDistance;- } else {- progress = 0;- }- }- const clampedProgress = Math.min(1, Math.max(0, progress));-- if (isClusterClickScrollingRef.current) {- return;- }-- setHasUserScrolled(true);- startTransition(() => {- setScrollProgress(clampedProgress);- });-- // Calculate current active location index based on scroll progress- let currentActiveLocationIndex = -1; // Start with no location selected- if (photoClusters.length > 0) {- if (isMobileOrTablet) {- // Mobile: Slower progression - stay on each location longer- currentActiveLocationIndex = Math.floor(- clampedProgress * (photoClusters.length - 0.5),- );- } else {- // Desktop: Use original logic- currentActiveLocationIndex = Math.round(- clampedProgress * Math.max(0, photoClusters.length - 1),- );- }- }- const previousActiveLocationIndex = previousActiveLocationRef.current;-- // Only pan map when active location changes (discrete panning)- if (- mapRef?.getContainer() &&- currentActiveLocationIndex !== previousActiveLocationIndex- ) {- previousActiveLocationRef.current = currentActiveLocationIndex;-- // Skip panning if no location is selected (mobile default view)- if (currentActiveLocationIndex === -1) return;-- const clusterCenters = photoClusters.map((cluster) => {- const avgLat =- cluster.reduce((sum, p) => sum + p.lat, 0) / cluster.length;- const avgLng =- cluster.reduce((sum, p) => sum + p.lng, 0) / cluster.length;- return { lat: avgLat, lng: avgLng };- });-- const targetCluster = clusterCenters[currentActiveLocationIndex];- if (!targetCluster) return;-- // Position active location at 20% from right edge- const [positionedLat, positionedLng] = getLocationPosition(- targetCluster.lat,- targetCluster.lng,- );-- // Check if this is a distant location (>500km from previous)- let isDistantLocation = false;- if (- previousActiveLocationIndex !== -1 &&- previousActiveLocationIndex !== currentActiveLocationIndex- ) {- const previousCluster = clusterCenters[previousActiveLocationIndex];- if (previousCluster) {- const distance = calculateDistance(- previousCluster.lat,- previousCluster.lng,- targetCluster.lat,- targetCluster.lng,- );- isDistantLocation = distance > 500; // 500km threshold- }- }-- const targetZoom = isMobileOrTablet ? 8 : 10; // Touch device-aware zoom level-- try {- // Super cluster logic disabled - simple zoom transitions- if (isDistantLocation) {- // For distant locations not in super cluster: zoom out β pan β zoom in- const intermediateZoom = isMobileOrTablet ? 2 : 4;-- // Use event listener for smoother animation chaining with pause- const onZoomEnd = () => {- mapRef.off("zoomend", onZoomEnd);- // Small pause to let user see the zoomed out view- setTimeout(() => {- setTargetZoom(targetZoom);- mapRef.flyTo(- [positionedLat, positionedLng],- targetZoom,- {- animate: true,- duration: 1.2,- easeLinearity: 0.2,- },- );- }, 150);- };-- mapRef.once("zoomend", onZoomEnd);- setTargetZoom(intermediateZoom);- mapRef.flyTo([positionedLat, positionedLng], intermediateZoom, {- animate: true,- duration: 1.2,- easeLinearity: 0.2,- });- } else {- // For nearby locations not in super cluster: simple pan to target location- const currentMapZoom = mapRef.getZoom();- if (Math.abs(currentMapZoom - targetZoom) > 0.5) {- mapRef.flyTo([positionedLat, positionedLng], targetZoom, {- animate: true,- duration: 0.8,- easeLinearity: 0.3,- });- } else {- mapRef.panTo([positionedLat, positionedLng], {- animate: true,- duration: 0.8,- easeLinearity: 0.3,- });- }- }- } catch (error) {- console.warn("Map operation failed:", error);- }- }-};--export interface ScrollTimelineToLocationParams {- timelineRef: React.RefObject<HTMLDivElement | null>;- locationIndex: number;- photoClusters: JourneyPoint[][];- locationPositions: PositionInfo[];- isMobileOrTablet: boolean;-}--export const scrollTimelineToLocation = ({- timelineRef,- locationIndex,- photoClusters,- locationPositions,- isMobileOrTablet,-}: ScrollTimelineToLocationParams) => {- if (- !timelineRef.current ||- locationIndex < 0 ||- locationIndex >= photoClusters.length ||- locationPositions.length === 0- )- return;-- const timelineContainer = timelineRef.current;- const scrollHeight = timelineContainer.scrollHeight;- const clientHeight = timelineContainer.clientHeight;- const maxScrollableDistance = scrollHeight - clientHeight;-- // Calculate target progress using the same formula as scroll progress calculation- let targetProgress;- if (isMobileOrTablet) {- // Mobile: Use inverse of the slower progression formula- // If active index = Math.floor(progress * (length - 0.5))- // Then progress = (index + 0.5) / (length - 0.5) for accurate inverse- targetProgress =- (locationIndex + 0.5) / Math.max(1, photoClusters.length - 0.5);- } else {- // Desktop: Use original formula- targetProgress = locationIndex / Math.max(1, photoClusters.length - 1);- }-- // Clamp progress to valid range- targetProgress = Math.min(1, Math.max(0, targetProgress));- const targetScrollTop = targetProgress * maxScrollableDistance;-- timelineContainer.scrollTo({- top: Math.max(0, Math.min(targetScrollTop, maxScrollableDistance)),- behavior: "smooth",- });-};--export interface HandleMarkerClickParams {- clusterIndex: number;- clusterLat: number;- clusterLng: number;- photoClusters: JourneyPoint[][];- mapRef: import("leaflet").Map | null;- isClusterClickScrollingRef: React.RefObject<boolean>;- clusterClickTimeoutRef: React.RefObject<NodeJS.Timeout | null>;- setScrollProgress: (progress: number) => void;- setHasUserScrolled: (scrolled: boolean) => void;- scrollTimelineToLocation: (locationIndex: number) => void;- isMobileOrTablet: boolean;- setTargetZoom: (zoom: number | null) => void;- previousActiveLocationRef: React.RefObject<number>;-}--export const handleMarkerClick = ({- clusterIndex,- clusterLat,- clusterLng,- photoClusters,- mapRef,- isClusterClickScrollingRef,- clusterClickTimeoutRef,- setScrollProgress,- setHasUserScrolled,- scrollTimelineToLocation,- isMobileOrTablet,- setTargetZoom,- previousActiveLocationRef,-}: HandleMarkerClickParams) => {- const targetProgress = clusterIndex / Math.max(1, photoClusters.length - 1);-- if (clusterClickTimeoutRef.current) {- clearTimeout(clusterClickTimeoutRef.current);- }-- isClusterClickScrollingRef.current = true;- setScrollProgress(targetProgress);- setHasUserScrolled(true);-- // Update the previous active location to the target cluster- previousActiveLocationRef.current = clusterIndex;-- if (mapRef?.getContainer()) {- try {- // Super cluster logic disabled - simple fly to target with standard zoom- const [positionedLat, positionedLng] = getLocationPosition(- clusterLat,- clusterLng,- );- const targetZoomLevel = isMobileOrTablet ? 8 : 10;- // Set target zoom before animation- setTargetZoom(targetZoomLevel);-- // Clear target zoom after animation completes- const onMoveEnd = () => {- mapRef.off("moveend", onMoveEnd);- setTargetZoom(null);- };- mapRef.once("moveend", onMoveEnd);-- mapRef.flyTo([positionedLat, positionedLng], targetZoomLevel, {- animate: true,- duration: 1.0,- easeLinearity: 0.3,- });- } catch (error) {- console.warn("Map operation failed:", error);- }- }-- setTimeout(() => {- scrollTimelineToLocation(clusterIndex);- }, 50);-- clusterClickTimeoutRef.current = setTimeout(() => {- isClusterClickScrollingRef.current = false;- clusterClickTimeoutRef.current = null;- }, 1500);-};