fix(client): lint, theme and size ratchets of the quick-win round, and the tests that followed the features

New warnings fixed at their source (refs written in effects, typed tile
options, no stray imports, smaller functions and components), the payer and
split heads hold their switch instead of letting it overhang, the baselines
lowered where the round removed warnings, and the tests updated to the
solo trip, the shares view and the revisit status.
This commit is contained in:
Maurice
2026-11-13 12:40:17 +01:00
parent 75aeba29ed
commit c2ba78253d
33 changed files with 278 additions and 194 deletions
@@ -132,8 +132,8 @@ export default function MapSettingsTab(): React.ReactElement {
const {
managed, presets, canMapbox, saving, provider, changeProvider, mapTileUrl, setMapTileUrl, mapboxToken, setMapboxToken,
cartoKey, setCartoKey, cartoNeedsKey, mapboxStyle, setMapboxStyle, mapbox3d, setMapbox3d,
mapboxQuality, setMapboxQuality, hideBasemapPois, setHideBasemapPois, previewPlaces, glPreview, webgl2Missing,
save: saveMapSettings,
mapboxQuality, setMapboxQuality, hideBasemapPois, setHideBasemapPois, mapboxPreview, previewPlaces, glPreview,
webgl2Missing, save: saveMapSettings,
} = useMapSettingsForm()
// One chunk per engine — see components/Map/glLazy.tsx.
const GlMapPreview = provider === 'maplibre-gl' ? GlMapPreviewMaplibre : GlMapPreviewMapbox
@@ -341,9 +341,9 @@ export default function MapSettingsTab(): React.ReactElement {
// Zoom in close so the style's character (3D buildings,
// satellite texture, label density) is immediately visible.
zoom={PREVIEW_ZOOM}
enable3d={provider === 'mapbox-gl' && mapbox3d && supports3d}
quality={provider === 'mapbox-gl' && mapboxQuality}
hidePois={provider === 'mapbox-gl' && hideBasemapPois}
enable3d={mapboxPreview.enable3d && supports3d}
quality={mapboxPreview.quality}
hidePois={mapboxPreview.hidePois}
/>
</Suspense>
</ErrorBoundary>
@@ -128,4 +128,10 @@ describe('useMapSettingsForm', () => {
await act(() => result.current.save());
expect(updateSettings).toHaveBeenCalledWith(expect.objectContaining({ map_hide_basemap_pois: false }));
});
it('FE-COMP-MAPFORM-010: the preview takes the Mapbox-only switches on Mapbox alone', () => {
seed({ map_provider: 'maplibre-gl', map_hide_basemap_pois: true, mapbox_3d_enabled: true });
const { result } = renderHook(() => useMapSettingsForm());
expect(result.current.mapboxPreview).toEqual({ enable3d: false, quality: false, hidePois: false });
});
});
@@ -127,6 +127,12 @@ export function useMapSettingsForm({ mirrorStyleBeforeSave = false }: MapSetting
setMapboxQuality,
hideBasemapPois,
setHideBasemapPois,
// What the GL preview draws: the Mapbox-only switches count only on Mapbox.
mapboxPreview: {
enable3d: provider === 'mapbox-gl' && mapbox3d,
quality: provider === 'mapbox-gl' && mapboxQuality,
hidePois: provider === 'mapbox-gl' && hideBasemapPois,
},
previewPlaces,
glPreview,
webgl2Missing,