From d07b508a77e146bd2a717d4d937c23b65afa1fd7 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 18 Apr 2026 22:05:19 +0200 Subject: [PATCH] drop hero / inline tab-bar on mobile journey + gallery, eager map tiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mobile: journey and gallery views both run as chromeless overlays now. The hero card, backlink, stats row and inline tab-bar are hidden; the floating top bar (back, Journey/Gallery toggle, settings) handles branding for both views, and the gallery content gets a top padding that matches the bar so nothing is occluded. - the journey-title pill below the tab-toggle is removed — the toggle itself is enough; the pill just duplicated information. - JourneyMap tile layer: set updateWhenIdle:false and keepBuffer:4. Leaflet defaults to "wait for pan to settle before loading tiles" on mobile, which showed as a visible tile-lag when switching timeline cards (flyTo moves the map). Eager updates plus a wider off-screen ring keep the neighbouring tiles hot. --- client/src/components/Journey/JourneyMap.tsx | 6 +++ client/src/pages/JourneyDetailPage.tsx | 40 ++++++++++++-------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx index cb2500bb..de9552ea 100644 --- a/client/src/components/Journey/JourneyMap.tsx +++ b/client/src/components/Journey/JourneyMap.tsx @@ -183,6 +183,12 @@ const JourneyMap = forwardRef(function JourneyMap( maxZoom: 18, attribution: '© OpenStreetMap', referrerPolicy: 'strict-origin-when-cross-origin', + // Leaflet defaults updateWhenIdle:true on mobile (waits for pan to settle + // before loading tiles). On the journey mobile combined view we flyTo + // constantly when switching cards, so tiles lag visibly — force eager + // updates and keep a larger ring of off-screen tiles ready. + updateWhenIdle: false, + keepBuffer: 4, } as any).addTo(map) const items = buildMarkerItems(entries) diff --git a/client/src/pages/JourneyDetailPage.tsx b/client/src/pages/JourneyDetailPage.tsx index ce1f4d9d..98717a22 100644 --- a/client/src/pages/JourneyDetailPage.tsx +++ b/client/src/pages/JourneyDetailPage.tsx @@ -230,6 +230,8 @@ export default function JourneyDetailPage() { const lifecycle = computeJourneyLifecycle(current.status, tripDateMin || null, tripDateMax || null) const showMobileCombined = isMobile && view === 'timeline' + const showMobileGallery = isMobile && view === 'gallery' + const isMobileChromeless = showMobileCombined || showMobileGallery return (
@@ -262,8 +264,8 @@ export default function JourneyDetailPage() { /> )} - {/* Floating top bar on mobile combined view: back | tabs+title | settings */} - {showMobileCombined && ( + {/* Floating top bar on mobile Journey + Gallery views: back | tabs+title | settings */} + {isMobileChromeless && (
-
+
- {current?.title && ( -
- {current.title} -
- )}
{canEditJourney ? ( @@ -323,8 +328,8 @@ export default function JourneyDetailPage() { {t('journey.detail.backToJourney')} - {/* Hero card — full width */} -
+ {/* Hero card — hidden on mobile gallery/journey views (floating top bar handles branding there) */} +
{current.cover_image && (
@@ -418,8 +423,8 @@ export default function JourneyDetailPage() { {/* Left column */}
- {/* View Controls */} -
+ {/* View Controls — hidden on mobile (floating top bar has them) */} +
{(isMobile ? [ @@ -516,8 +521,11 @@ export default function JourneyDetailPage() {
)} - {/* Gallery View */} -
+ {/* Gallery View — mobile gets extra top padding so the floating top bar doesn't overlap */} +