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(tours): ferrata map tokens in a style module of their own, keep module-private helpers unexported

Maurice976a612351d3
diff --git a/client/scripts/size-baseline.json b/client/scripts/size-baseline.json
index 44907fd51..7edf68862 100644
--- a/client/scripts/size-baseline.json
+++ b/client/scripts/size-baseline.json
@@ -12,7 +12,7 @@
"src/components/PDF/TripPDF.tsx": 1082,
"src/components/Planner/DayDetailPanel.test.tsx": 2333,
"src/components/Planner/DayPlanSidebar.test.tsx": 5378,
- "src/components/Planner/DayPlanSidebar.tsx": 2973,
+ "src/components/Planner/DayPlanSidebar.tsx": 2971,
"src/components/Planner/PlaceFormModal.test.tsx": 2864,
"src/components/Planner/PlaceFormModal.tsx": 1250,
"src/components/Planner/PlaceInspector.tsx": 1304,
diff --git a/client/src/components/Tours/planner/TourEditorFields.tsx b/client/src/components/Tours/planner/TourEditorFields.tsx
index 9917527d0..f3068c2be 100644
--- a/client/src/components/Tours/planner/TourEditorFields.tsx
+++ b/client/src/components/Tours/planner/TourEditorFields.tsx
@@ -145,7 +145,7 @@ function TourDurationInput({
}
/** Breaks on top of the walking time, and the planned total that defaults to their sum, side by side. */
-export function TourTimeFields({ planner, locked }: TourFieldProps) {
+function TourTimeFields({ planner, locked }: TourFieldProps) {
const { t } = useTranslation();
const manual = planner.plannedDurationMinutes != null;
return (
diff --git a/client/src/components/Tours/planner/tourFixedLegs.ts b/client/src/components/Tours/planner/tourFixedLegs.ts
index e72948f6e..2c3692da0 100644
--- a/client/src/components/Tours/planner/tourFixedLegs.ts
+++ b/client/src/components/Tours/planner/tourFixedLegs.ts
@@ -19,7 +19,7 @@ function gapM(a: { lat: number; lng: number }, end: readonly unknown[]): number
}
/** Whether a leg still runs from this waypoint to the next one. */
-export function fixedLegJoins(point: FixedLegPoint, next: FixedLegPoint | undefined, leg: TourFixedLeg): boolean {
+function fixedLegJoins(point: FixedLegPoint, next: FixedLegPoint | undefined, leg: TourFixedLeg): boolean {
const first = leg.geometry[0];
const last = leg.geometry[leg.geometry.length - 1];
return (
diff --git a/client/src/index.css b/client/src/index.css
index 1aa8c6f42..2bf9bee9b 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -788,10 +788,6 @@ input[type="number"], input[type="time"], input[type="date"], input[type="dateti
--journal-card: #FFFFFF;
--journal-border: #E4E4E7;
--journal-accent: #6366F1;
- /* Via ferrata lines on the map: a violet nothing else on the map uses, on a white halo. */
- --map-ferrata: #7c3aed;
- --map-ferrata-lit: #5b21b6;
- --map-ferrata-casing: #ffffff;
--journal-text: #09090B;
--journal-muted: #71717A;
--journal-faint: #A1A1AA;
@@ -889,9 +885,6 @@ input[type="number"], input[type="time"], input[type="date"], input[type="dateti
--journal-card: #18181B;
--journal-border: #27272A;
--journal-accent: #818CF8;
- --map-ferrata: #a78bfa;
- --map-ferrata-lit: #c4b5fd;
- --map-ferrata-casing: #ffffff;
--journal-text: #FAFAFA;
--journal-muted: #A1A1AA;
--journal-faint: #52525B;
@@ -1206,11 +1199,6 @@ body {
.leaflet-tooltip-top.map-tooltip::before {
display: none;
}
-/* A clicked via ferrata opens a card with its own focus; the path's focus ring would only linger on the map. */
-.leaflet-interactive.trek-ferrata-hit:focus,
-.leaflet-interactive.trek-ferrata-hit:focus-visible {
- outline: none;
-}
/* Scrollbars — styled on desktop, hidden on mobile */
::-webkit-scrollbar {
diff --git a/client/src/main.tsx b/client/src/main.tsx
index f190c8b68..d23ea51c0 100644
--- a/client/src/main.tsx
+++ b/client/src/main.tsx
@@ -25,6 +25,7 @@ import '@fontsource/geist-sans/600.css'
// several .leaflet-* styles.
import 'leaflet/dist/leaflet.css'
import './index.css'
+import './styles/ferratas.css'
// Native HTML5 drag-and-drop never fires on touch input, so the planner's place /
// day reordering was dead on Android and iOS. The `drag-drop-touch` polyfill synthesises
// the standard drag events from touch gestures over draggable elements (#1265). It is
diff --git a/client/src/store/tourPlaceToolStore.ts b/client/src/store/tourPlaceToolStore.ts
index aa2951ae6..1e30d4400 100644
--- a/client/src/store/tourPlaceToolStore.ts
+++ b/client/src/store/tourPlaceToolStore.ts
@@ -45,7 +45,7 @@ export function setTourPlaceToolMode(mode: TourMapMode): void {
if (useTourPlaceToolStore.getState().mode !== mode) useTourPlaceToolStore.setState({ mode });
}
-export function setTourPlacing(mode: TourMapMode, on: boolean): void {
+function setTourPlacing(mode: TourMapMode, on: boolean): void {
writePlacing(mode, on);
useTourPlaceToolStore.setState((state) => ({ placing: { ...state.placing, [mode]: on } }));
}
diff --git a/client/src/styles/ferratas.css b/client/src/styles/ferratas.css
new file mode 100644
index 000000000..f4cbe13cc
--- /dev/null
+++ b/client/src/styles/ferratas.css
@@ -0,0 +1,24 @@
+/* ============================================================================
+ Via ferratas on the maps: the line colours and the hit path's focus.
+ Global, since the 2D, GL and 3D maps and the tour planner's badges all read
+ the tokens.
+ ========================================================================== */
+
+/* A violet nothing else on the map uses, on a white halo. */
+:root {
+ --map-ferrata: #7c3aed;
+ --map-ferrata-lit: #5b21b6;
+ --map-ferrata-casing: #ffffff;
+}
+
+.dark {
+ --map-ferrata: #a78bfa;
+ --map-ferrata-lit: #c4b5fd;
+ --map-ferrata-casing: #ffffff;
+}
+
+/* A clicked via ferrata opens a card with its own focus; the path's focus ring would only linger on the map. */
+.leaflet-interactive.trek-ferrata-hit:focus,
+.leaflet-interactive.trek-ferrata-hit:focus-visible {
+ outline: none;
+}