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(journey): a folded Duo on its side gets the compact cards in the wide size class too

Maurice41752887dc18
diff --git a/client/src/mobile/screens/journey/MJourneyDetail.tsx b/client/src/mobile/screens/journey/MJourneyDetail.tsx
index 8c568377a..a3831d906 100644
--- a/client/src/mobile/screens/journey/MJourneyDetail.tsx
+++ b/client/src/mobile/screens/journey/MJourneyDetail.tsx
@@ -593,7 +593,8 @@ export default function MJourneyDetail({ journeyId, embedded = false }: JourneyD
showMood={current.show_mood !== 0}
showWeather={current.show_weather !== 0}
tone="mobile"
- size={wide ? 'large' : short ? 'compact' : 'regular'}
+ // Short before wide: a folded Duo on its side is wide (over 500px high) and short.
+ size={short ? 'compact' : wide ? 'large' : 'regular'}
/>
</div>
))}
diff --git a/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx b/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx
index b8ea512f9..c66ca9f65 100644
--- a/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx
+++ b/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx
@@ -1,7 +1,7 @@
-// FE-MOB-JDET-001 to FE-MOB-JDET-048
+// FE-MOB-JDET-001 to FE-MOB-JDET-049
import { describe, it, expect, beforeEach, afterEach, onTestFinished, vi } from 'vitest';
-import { render, screen, fireEvent, waitFor, act } from '../../../helpers/render';
import { setSizeClass } from '../../../helpers/sizeClass';
+import { render, screen, fireEvent, waitFor, act } from '../../../helpers/render';
import MJourneyDetail from '../../../../src/mobile/screens/journey/MJourneyDetail';
import { addonsApi, journeyApi, memoriesApi } from '../../../../src/api/client';
import { useJourneyStore } from '../../../../src/store/journeyStore';
@@ -256,9 +256,12 @@ describe('MJourneyDetail', () => {
};
window.matchMedia = tall;
onTestFinished(() => { window.matchMedia = real; });
+ // At 720 by 540 it is the wide size class too, whose large cards must not win.
+ setSizeClass('wide');
setup();
expect(document.querySelector('.h-\\[112px\\]')).toBeInTheDocument();
expect(document.querySelector('.h-\\[152px\\]')).not.toBeInTheDocument();
+ expect(document.querySelector('.h-\\[196px\\]')).not.toBeInTheDocument();
});
it('FE-MOB-JDET-001: shows a spinner while the journey is loading', () => {