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): keep the planner page at its size, and format the GPX test

Mauricece07c4dc7251
diff --git a/client/scripts/size-baseline.json b/client/scripts/size-baseline.json
index 002aa3dbe..ff45f522e 100644
--- a/client/scripts/size-baseline.json
+++ b/client/scripts/size-baseline.json
@@ -7,7 +7,7 @@
"src/components/Budget/CostsPanel.tsx": 1816,
"src/components/Map/MapView.tsx": 1402,
"src/components/Map/MapViewGL.test.tsx": 2920,
- "src/components/Map/MapViewGL.tsx": 2299,
+ "src/components/Map/MapViewGL.tsx": 2296,
"src/components/Map/RouteCalculator.ts": 1195,
"src/components/PDF/TripPDF.tsx": 1082,
"src/components/Planner/DayDetailPanel.test.tsx": 2333,
diff --git a/client/src/components/Tours/TourWorkspaceRail.tsx b/client/src/components/Tours/TourWorkspaceRail.tsx
index f92bb99a2..d5cc9f934 100644
--- a/client/src/components/Tours/TourWorkspaceRail.tsx
+++ b/client/src/components/Tours/TourWorkspaceRail.tsx
@@ -17,6 +17,8 @@ export interface TourWorkspaceRailParts {
trackPaddlePlan?: TrackPaddlePlan;
/** The obstacle checklist of the paddle tour open in the planner (PAD-06). */
paddleChecklist?: PaddleChecklist;
+ /** The trip's tours, never offered as a stop of another tour (PR1-10). */
+ tourPlaceIds?: ReadonlySet<number>;
}
/** The tours workspace's left rail: the tour editor, or the wanderer trails while those are browsed. */
@@ -24,13 +26,10 @@ export default function TourWorkspaceRail({
workspace,
canEdit,
canAssign,
- tourPlaceIds,
}: {
workspace: TourWorkspaceRailParts;
canEdit: boolean;
canAssign: boolean;
- /** The trip's tours, never offered as a stop of another tour (PR1-10). */
- tourPlaceIds?: ReadonlySet<number>;
}) {
const {
tourPlanner,
@@ -39,6 +38,7 @@ export default function TourWorkspaceRail({
recordedTrack,
trackPaddlePlan,
paddleChecklist,
+ tourPlaceIds,
} = workspace;
return wanderer.open ? (
<WandererBrowserRail browser={wanderer} />
diff --git a/client/src/pages/TripPlannerPage.tsx b/client/src/pages/TripPlannerPage.tsx
index ec2d35368..c78dc6cbb 100644
--- a/client/src/pages/TripPlannerPage.tsx
+++ b/client/src/pages/TripPlannerPage.tsx
@@ -646,7 +646,7 @@ function TripPlannerPageDesktop(): React.ReactElement | null {
transition: 'width 0.25s ease', opacity: leftHidden ? 0 : 1,
}}>
{!leftHidden && <PanelResizeHandle side="left" width={leftWidth} min={resizeMin} max={resizeMax} onStart={startResizeLeft} onNudge={nudgeLeft} />}
- <LazyPanel id="tour-planner-rail"><TourWorkspaceRail workspace={pageState} canEdit={canPlaceEdit} canAssign={canDayEdit} tourPlaceIds={tourPlaceIds} /></LazyPanel>
+ <LazyPanel id="tour-planner-rail"><TourWorkspaceRail workspace={pageState} canEdit={canPlaceEdit} canAssign={canDayEdit} /></LazyPanel>
</div>
</div>
<div className="absolute bottom-[10px] right-[10px] top-[10px] z-20 hidden md:block">
diff --git a/server/tests/unit/nest/place-import/gpx.provider.test.ts b/server/tests/unit/nest/place-import/gpx.provider.test.ts
index 86230d590..a44b66ccd 100644
--- a/server/tests/unit/nest/place-import/gpx.provider.test.ts
+++ b/server/tests/unit/nest/place-import/gpx.provider.test.ts
@@ -292,16 +292,17 @@ describe('buildTourGpx (PR1-06A)', () => {
const parser = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: '@_' });
it('writes the line as one track with the heights it has and none it lacks', () => {
- const gpx = buildTourGpx(
- tour(
- JSON.stringify([
- [47, 11, 600.4],
- [47.1, 11.1],
- [47.2, 11.2, 'x'],
- [47.3, 11.3, 650],
- ]),
- ),
- ) ?? '';
+ const gpx =
+ buildTourGpx(
+ tour(
+ JSON.stringify([
+ [47, 11, 600.4],
+ [47.1, 11.1],
+ [47.2, 11.2, 'x'],
+ [47.3, 11.3, 650],
+ ]),
+ ),
+ ) ?? '';
expect(XMLValidator.validate(gpx)).toBe(true);
const doc = parser.parse(gpx).gpx;
expect(doc.metadata).toMatchObject({
@@ -317,17 +318,18 @@ describe('buildTourGpx (PR1-06A)', () => {
});
it('writes no description or link a tour has not got', () => {
- const gpx = buildTourGpx({
- ...tour(
- JSON.stringify([
- [47, 11],
- [47.1, 11.1],
- ]),
- ),
- description: ' ',
- website: null,
- stops: [],
- }) ?? '';
+ const gpx =
+ buildTourGpx({
+ ...tour(
+ JSON.stringify([
+ [47, 11],
+ [47.1, 11.1],
+ ]),
+ ),
+ description: ' ',
+ website: null,
+ stops: [],
+ }) ?? '';
const doc = parser.parse(gpx).gpx;
expect(doc.metadata).toEqual({ name: 'Grat <Ost>' });
expect(doc.trk.desc).toBeUndefined();