The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
fix(mobile): no how-to line on the 3D map on a tablet
Mauriceb73f74988054
diff --git a/client/src/components/Tours/terrain/TourTerrainMap.test.tsx b/client/src/components/Tours/terrain/TourTerrainMap.test.tsxindex 26352ad1e..086625aef 100644--- a/client/src/components/Tours/terrain/TourTerrainMap.test.tsx+++ b/client/src/components/Tours/terrain/TourTerrainMap.test.tsx@@ -1,6 +1,7 @@// FE-COMP-TERRAIN-001 to FE-COMP-TERRAIN-018import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { act, fireEvent, render, screen, waitFor } from '../../../../tests/helpers/render';+import { resetSizeClass, setSizeClass } from '../../../../tests/helpers/sizeClass';import type { DistanceIndexedProfileSample, RouteProfileFocus } from '../../../utils/routeGeometry';import TourTerrainMap, { type TourTerrainMapProps } from './TourTerrainMap';@@ -257,6 +258,17 @@ describe('TourTerrainMap', () => {expect(screen.queryByRole('button', { name: 'Play flyover' })).toBeNull();});+ it('FE-COMP-TERRAIN-002b: on an iPad or an unfolded foldable the how-to line stays out of the map', async () => {+ setSizeClass('split');+ try {+ await renderTerrain();+ expect(screen.queryByText('Open a tour on the right to fly it in 3D and colour it by grade.')).toBeNull();+ expect(screen.queryByText(/Click the terrain to set points/)).toBeNull();+ } finally {+ resetSizeClass();+ }+ });+it('FE-COMP-TERRAIN-003: a click on the terrain adds a control point only while editing', async () => {const onAdd = vi.fn();const { rerender } = await renderTerrain({ waypoints: { points: [], selectedId: null, onSelect: vi.fn(), onAdd } });diff --git a/client/src/components/Tours/terrain/TourTerrainMap.tsx b/client/src/components/Tours/terrain/TourTerrainMap.tsxindex 92c7f1f4a..64262f027 100644--- a/client/src/components/Tours/terrain/TourTerrainMap.tsx+++ b/client/src/components/Tours/terrain/TourTerrainMap.tsx@@ -1,6 +1,7 @@import type { FerrataBbox } from '@trek/shared';import { ChevronDown, ChevronUp, Gauge, Palette, Pause, Play, RotateCcw, Scan, TrendingUp } from 'lucide-react';import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react';+import { useIsWide } from '../../../hooks/sizeClass';import { useTranslation } from '../../../i18n';import type { DistanceUnit } from '../../../types';import type { DistanceIndexedProfileSample, RouteProfileFocus } from '../../../utils/routeGeometry';@@ -84,6 +85,7 @@ export default function TourTerrainMap(props: TourTerrainMapProps) {const { setContainer, ...terrain } = useTourTerrain({ ...props, panels: { leftWidth, rightWidth } });const stats = useMemo(() => terrainStats(samples), [samples]);const { fit, height: controlsHeight, attachRow, attachStack } = useControlRowFit();+ const touchShell = useIsWide();const legend =terrain.canReplay && !props.water ? (<GradeLegend stats={stats} unit={unit} onLayout={props.onLegendLayout} />@@ -134,6 +136,9 @@ export default function TourTerrainMap(props: TourTerrainMapProps) {<span />{terrain.canReplay ? (<TerrainDock terrain={terrain} water={props.water} />+ ) : touchShell ? (+ // A tablet's map is short on room, and its user learns the gestures by touch: no how-to line.+ <span />) : (<divclassName="pointer-events-auto rounded-full px-4 py-2.5 text-content-muted"