diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx index 0f9a5a36..cb2500bb 100644 --- a/client/src/components/Journey/JourneyMap.tsx +++ b/client/src/components/Journey/JourneyMap.tsx @@ -269,8 +269,14 @@ const JourneyMap = forwardRef(function JourneyMap( const timer = setTimeout(() => { highlightMarker(activeMarkerId) const marker = markersRef.current.get(activeMarkerId) - if (marker && mapRef.current) { - mapRef.current.flyTo(marker.getLatLng(), Math.max(mapRef.current.getZoom(), 12), { duration: 0.5 }) + if (!marker || !mapRef.current) return + // fitBounds may still be pending when this fires — getZoom() throws + // "Set map center and zoom first" until the map has a view. Guard it. + try { + const currentZoom = mapRef.current.getZoom() + mapRef.current.flyTo(marker.getLatLng(), Math.max(currentZoom, 12), { duration: 0.5 }) + } catch { + mapRef.current.setView(marker.getLatLng(), 12) } }, 50) return () => clearTimeout(timer) diff --git a/client/src/components/Memories/MemoriesPanel.tsx b/client/src/components/Memories/MemoriesPanel.tsx index f2427ee6..6c34ed3b 100644 --- a/client/src/components/Memories/MemoriesPanel.tsx +++ b/client/src/components/Memories/MemoriesPanel.tsx @@ -582,7 +582,8 @@ export default function MemoriesPanel({ tripId, startDate, endDate }: MemoriesPa borderColor: !pickerDateFilter ? 'var(--text-primary)' : 'var(--border-primary)', color: !pickerDateFilter ? 'var(--bg-primary)' : 'var(--text-muted)', }}> - {t('memories.allPhotos')} + {t('memories.allPhotos')} + {t('common.all')} {selectedIds.size > 0 && ( diff --git a/client/src/pages/JourneyDetailPage.tsx b/client/src/pages/JourneyDetailPage.tsx index 44b435c8..ce1f4d9d 100644 --- a/client/src/pages/JourneyDetailPage.tsx +++ b/client/src/pages/JourneyDetailPage.tsx @@ -1734,7 +1734,7 @@ function ProviderPicker({ provider, userId, entries, trips, existingAssetIds, on {[ { id: 'trip' as const, label: t('journey.picker.tripPeriod') }, { id: 'custom' as const, label: t('journey.picker.dateRange') }, - { id: 'all' as const, label: t('journey.picker.allPhotos') }, + { id: 'all' as const, label: t('journey.picker.allPhotos'), short: t('common.all') }, { id: 'album' as const, label: t('journey.picker.albums') }, ].map(f => ( ))} @@ -2023,7 +2028,7 @@ function DatePicker({ value, onChange, tripDates }: { for (let i = 0; i < firstDow; i++) cells.push(null) for (let d = 1; d <= daysInMonth; d++) cells.push(d) - const formatted = value ? new Date(value + 'T00:00:00').toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' }) : t('journey.picker.selectDate') + const formatted = value ? new Date(value + 'T00:00:00').toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' }) : null return (
@@ -2032,7 +2037,14 @@ function DatePicker({ value, onChange, tripDates }: { onClick={() => setOpen(!open)} className="w-full px-3 py-2 border border-zinc-200 dark:border-zinc-700 rounded-lg text-[13px] bg-white dark:bg-zinc-800 text-zinc-900 dark:text-white text-left flex items-center justify-between" > - {formatted} + {formatted ? ( + {formatted} + ) : ( + + {t('journey.picker.selectDate')} + {t('common.date')} + + )}