From 90352b8e3a66e7a1705b80a61defef5c56a7bb54 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 12 Oct 2026 10:19:39 +0200 Subject: [PATCH] fix(journey): draw the dashed line between entries on fullscreen leaflet maps too The Leaflet journey map only drew the dashed route between entries when fullScreen was off. Since the desktop sidebar and the mobile map plus carousel view both pass fullScreen, the line was missing on the public journey page (desktop and phone) and in the logged in views with the Leaflet provider, while the GL renderer always drew it. fullScreen now only enables wheel zoom, matching JourneyMapGL where it only sets the pitch. Refs #2606 --- client/src/components/Journey/JourneyMap.test.tsx | 10 +++++++--- client/src/components/Journey/JourneyMap.tsx | 4 ++-- client/src/components/Journey/JourneyMapGL.test.tsx | 10 ++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/client/src/components/Journey/JourneyMap.test.tsx b/client/src/components/Journey/JourneyMap.test.tsx index f0e993ae3..181dbf04f 100644 --- a/client/src/components/Journey/JourneyMap.test.tsx +++ b/client/src/components/Journey/JourneyMap.test.tsx @@ -386,13 +386,17 @@ describe('JourneyMap', () => { expect(L.polyline).not.toHaveBeenCalled(); }); - it('FE-COMP-JOURNEYMAP-022: fullScreen enables wheel zoom and drops the route polyline', () => { + it('FE-COMP-JOURNEYMAP-022: fullScreen enables wheel zoom and still draws the dashed route polyline', () => { render( ); expect(vi.mocked(L.map).mock.calls[0][1]).toMatchObject({ scrollWheelZoom: true }); - // The connecting route line is a sidebar-only decoration - expect(L.polyline).not.toHaveBeenCalled(); + // The public sidebar and the mobile map+carousel view both pass fullScreen, + // and the line joining the entries has to show there too (#2606) + expect(L.polyline).toHaveBeenCalledWith( + [[48.8566, 2.3522], [52.52, 13.405]], + expect.objectContaining({ dashArray: '4 6' }), + ); }); it('FE-COMP-JOURNEYMAP-023: clicking a marker reports the entry id', () => { diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx index 57f50dae5..4c4615ea5 100644 --- a/client/src/components/Journey/JourneyMap.tsx +++ b/client/src/components/Journey/JourneyMap.tsx @@ -330,8 +330,8 @@ function JourneyMap( coords.forEach(c => trackCoords.push(c)) } - // route polyline — only in non-fullscreen (sidebar map) mode - if (!fullScreen && items.length > 1) { + // route trail: dashed line connecting entries in time order, same as JourneyMapGL + if (items.length > 1) { const routeCoords = items.map(i => [i.lat, i.lng] as L.LatLngTuple) L.polyline(routeCoords, { color: dark ? '#71717A' : '#A1A1AA', diff --git a/client/src/components/Journey/JourneyMapGL.test.tsx b/client/src/components/Journey/JourneyMapGL.test.tsx index 7fd69b831..7ab9f1993 100644 --- a/client/src/components/Journey/JourneyMapGL.test.tsx +++ b/client/src/components/Journey/JourneyMapGL.test.tsx @@ -277,6 +277,16 @@ describe('JourneyMapGL', () => { expect(gl.map.addLayer).not.toHaveBeenCalled() }) + it('FE-COMP-JMAPGL-037: the fullScreen map draws the route once the entries arrive after mount', () => { + withToken() + const { rerender } = render() + expect(gl.map.addSource).not.toHaveBeenCalledWith('journey-route', expect.anything()) + + rerender() + expect(gl.map.addSource).toHaveBeenCalledWith('journey-route', expect.objectContaining({ type: 'geojson' })) + expect(gl.map.addLayer).toHaveBeenCalledWith(expect.objectContaining({ id: 'journey-route-line' })) + }) + it('FE-COMP-JMAPGL-010: the camera fits entries and trail with the requested bottom padding', () => { withToken() render(