Skip to content

armgit / TREK

Public Imported from GitHub
0

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.

fix(mobile): Studio's inspector stays docked on an iPad in landscape, the linked journal's buttons sit beside its switch, and the iOS app draws Leaflet's basemap as raster tiles

Maurice4d550112a1d2
diff --git a/client/src/components/Map/VectorBasemap.test.tsx b/client/src/components/Map/VectorBasemap.test.tsx
index 0f8062ddc..80672a152 100644
--- a/client/src/components/Map/VectorBasemap.test.tsx
+++ b/client/src/components/Map/VectorBasemap.test.tsx
@@ -39,6 +39,8 @@ vi.mock('react-leaflet', () => ({
// jsdom has no WebGL, so without this every case below would take the raster
// branch. The suite is about the GL wiring; the raster branch has its own cases.
vi.mock('../../utils/webgl', () => ({ hasWebGL: vi.fn(() => true), resetWebGLProbe: vi.fn() }))
+const platform = vi.hoisted(() => ({ ios: false }))
+vi.mock('../../native/platform', () => ({ isNativeIos: () => platform.ios, isNativeApp: () => platform.ios }))
vi.mock('./engines/maplibre', () => ({ default: { __engine: 'maplibre' } }))
vi.mock('@maplibre/maplibre-gl-leaflet', () => {
const maplibreGL = vi.fn(() => {
@@ -153,6 +155,17 @@ describe('VectorBasemap', () => {
warn.mockRestore()
})
+ it('FE-COMP-VECBM-021: in the iOS app the basemap is raster tiles, and no GL layer is built', async () => {
+ platform.ios = true
+ try {
+ const { findByTestId } = render(<VectorBasemap style={OFM_POSITRON} />)
+ expect(await findByTestId('raster-basemap')).toBeInTheDocument()
+ expect(maplibreGL).not.toHaveBeenCalled()
+ } finally {
+ platform.ios = false
+ }
+ })
+
it('FE-COMP-VECBM-004: takes the layer off the map on unmount', async () => {
const { unmount } = render(<VectorBasemap style={OFM_POSITRON} />)
await waitFor(() => expect(maplibreGL).toHaveBeenCalledTimes(1))
diff --git a/client/src/components/Map/VectorBasemap.tsx b/client/src/components/Map/VectorBasemap.tsx
index daba7db29..6100ebe74 100644
--- a/client/src/components/Map/VectorBasemap.tsx
+++ b/client/src/components/Map/VectorBasemap.tsx
@@ -11,6 +11,8 @@ import { hasWebGL, reportWebGLFailure } from '../../utils/webgl'
import { isGpuInitFailure } from './glSupport'
import { isChunkLoadError, reloadOnceForChunk } from '../../utils/chunkReload'
import { offlineStyle } from '../../native/offlineTiles'
+import { isNativeIos } from '../../native/platform'
+import { nativeRasterTemplate } from '../../native/tileCache'
/** The Leaflet layer maplibre-gl-leaflet hands back. */
export type GlLeafletLayer = InstanceType<typeof MaplibreGL>
@@ -107,6 +109,17 @@ function attachGlLayer(map: L.Map, layer: GlLeafletLayer, style: string): boolea
return true
}
+/*
+ * Whether the vector basemap can draw here. In the iOS app the MapLibre layer
+ * inside Leaflet drew nothing at all, with no error to fall back on (iPhone and
+ * iPad on iOS 26 and 27, 11/2026), while raster tiles and the 3D map drew; until
+ * that is traced on a device, the app draws Leaflet's basemap as raster tiles,
+ * through its tile store so they stay offline too.
+ */
+function vectorBasemapDraws(): boolean {
+ return hasWebGL() && !isNativeIos()
+}
+
/**
* Calls `fail` once when the layer's style errors before it ever loaded. Errors
* after that (a tile here and there) are the map's ordinary weather and leave it be.
@@ -132,7 +145,7 @@ function onStyleFailure(layer: GlLeafletLayer, fail: () => void): void {
* below instead, the way they already draw a user's own raster template.
*/
function attachRasterFallback(map: L.Map): L.TileLayer {
- const layer = L.tileLayer(RASTER_FALLBACK_TILE_URL, {
+ const layer = L.tileLayer(nativeRasterTemplate(RASTER_FALLBACK_TILE_URL), {
maxZoom: RASTER_FALLBACK_MAX_ZOOM,
referrerPolicy: 'strict-origin-when-cross-origin',
} as L.TileLayerOptions)
@@ -193,7 +206,7 @@ export function VectorBasemap({ style }: { style: string }) {
// State rather than a plain constant: the probe can say yes and the attach can
// still fail once the page has spent its context budget, and that has to reach
// the render or the raster tiles never appear.
- const [glUsable, setGlUsable] = useState(hasWebGL)
+ const [glUsable, setGlUsable] = useState(vectorBasemapDraws)
useEffect(() => {
if (!glUsable) return
@@ -249,7 +262,7 @@ export function VectorBasemap({ style }: { style: string }) {
return (
<TileLayer
key="webgl-fallback"
- url={RASTER_FALLBACK_TILE_URL}
+ url={nativeRasterTemplate(RASTER_FALLBACK_TILE_URL)}
attribution={attributionForTile(RASTER_FALLBACK_TILE_URL)}
maxZoom={RASTER_FALLBACK_MAX_ZOOM}
keepBuffer={8}
@@ -283,7 +296,7 @@ export async function attachVectorBasemap(
): Promise<void> {
// Same gate as the component: a browser without WebGL never pays for the
// maplibre chunk and gets raster tiles rather than an empty map (#2288).
- if (!hasWebGL()) {
+ if (!vectorBasemapDraws()) {
if (!cancelled()) ref.current = attachRasterFallback(map)
return
}
diff --git a/client/src/components/Studio/sidebar/StudioRail.test.tsx b/client/src/components/Studio/sidebar/StudioRail.test.tsx
index f8bb50fe1..9c0ad4490 100644
--- a/client/src/components/Studio/sidebar/StudioRail.test.tsx
+++ b/client/src/components/Studio/sidebar/StudioRail.test.tsx
@@ -206,7 +206,7 @@ describe('the rail', () => {
const columns = [...STUDIO_CSS.matchAll(/\.st-body \{[^}]*?grid-template-columns:\s*([^;]+);/g)].map((m) => m[1]);
expect(columns).toEqual([
'minmax(64px, min-content) 236px minmax(0, 1fr) 300px',
- 'minmax(64px, min-content) 236px minmax(0, 1fr)',
+ 'minmax(64px, min-content) 236px minmax(0, 1fr) 280px',
'minmax(64px, min-content) minmax(0, 1fr)',
]);
diff --git a/client/src/mobile/screens/journey/MJourneyDetail.tsx b/client/src/mobile/screens/journey/MJourneyDetail.tsx
index a5328f219..9d33de44e 100644
--- a/client/src/mobile/screens/journey/MJourneyDetail.tsx
+++ b/client/src/mobile/screens/journey/MJourneyDetail.tsx
@@ -840,7 +840,7 @@ const IN_SHELL_ROW = { '--m-safe-top': 'calc(env(safe-area-inset-top, 0px) + 6px
function HeaderFrame({ slot, feed, children }: { slot: HTMLElement | null; feed: boolean; children: ReactNode }) {
if (slot) {
return createPortal(
- <div className="flex min-w-0 flex-1 items-center gap-2 [&>span:first-child]:hidden [&_[data-view-switch]]:static [&_[data-view-switch]]:translate-x-0">
+ <div className="flex min-w-0 flex-1 items-center gap-2 [&>span:first-child]:hidden [&>span:last-child]:ms-0 [&_[data-view-switch]]:static [&_[data-view-switch]]:translate-x-0">
{children}
</div>,
slot
diff --git a/client/src/styles/studio-floating.css b/client/src/styles/studio-floating.css
index 80aa625d0..238502cad 100644
--- a/client/src/styles/studio-floating.css
+++ b/client/src/styles/studio-floating.css
@@ -1,13 +1,10 @@
/*
* Studio's side panels where they float over the workbench (studio.css, under
- * 1280px for the inspector and 1080px for the side panel, an iPad in either
- * orientation). The docked panels' glass let the page show through there and the
- * panel's text washed out, so a floating panel is opaque. Higher specificity than
- * `.st-panel`, which sets the glass after these breakpoints.
+ * 1080px: an iPad in portrait). The docked panels' glass let the page show
+ * through there and the text washed out, so a floating panel is opaque. Higher
+ * specificity than `.st-panel`, which sets the glass after these breakpoints.
*/
-@media (max-width: 1279px) {
- .trek-dash .st-panel.st-inspector { background: var(--surface); }
-}
@media (max-width: 1079px) {
+ .trek-dash .st-panel.st-inspector,
.trek-dash .st-panel.st-side { background: var(--surface); }
}
diff --git a/client/src/styles/studio.css b/client/src/styles/studio.css
index d55ed7494..b44a39c3a 100644
--- a/client/src/styles/studio.css
+++ b/client/src/styles/studio.css
@@ -218,10 +218,13 @@
min-height: 0;
}
-/* Under 1280 the inspector floats over the workbench instead of narrowing it —
- below roughly 700px of canvas a spread stops being legible at any zoom. */
+/* Under 1280 the inspector narrows and stays docked: floating over the workbench it
+ hid the page an iPad in landscape was editing. Under 1080 it floats after all. */
@media (max-width: 1279px) {
- .trek-dash .st-body { grid-template-columns: minmax(64px, min-content) 236px minmax(0, 1fr); }
+ .trek-dash .st-body { grid-template-columns: minmax(64px, min-content) 236px minmax(0, 1fr) 280px; }
+}
+@media (max-width: 1079px) {
+ .trek-dash .st-body { grid-template-columns: minmax(64px, min-content) minmax(0, 1fr); }
.trek-dash .st-inspector {
position: absolute;
top: 56px;
@@ -230,9 +233,6 @@
width: 300px;
box-shadow: var(--sh-lg);
}
-}
-@media (max-width: 1079px) {
- .trek-dash .st-body { grid-template-columns: minmax(64px, min-content) minmax(0, 1fr); }
/* The panel floats over the workbench's cell, so it starts wherever the rail ends. */
.trek-dash .st-side, .trek-dash .st-work-wrap { grid-area: 1 / 2; }
.trek-dash .st-side {