diff --git a/client/src/components/Journey/JourneyEntryCover.tsx b/client/src/components/Journey/JourneyEntryCover.tsx
index 2d23eb7d9..1f5934ff9 100644
--- a/client/src/components/Journey/JourneyEntryCover.tsx
+++ b/client/src/components/Journey/JourneyEntryCover.tsx
@@ -108,7 +108,7 @@ export default function JourneyEntryCover({
// growing its box moved every card after it once a swipe had landed, and the
// snap then pulled the strip again, which read as a jolt (carousels keep the
// room for it with their gap and top padding).
- className={`relative h-[152px] w-[136px] flex-none origin-bottom overflow-hidden rounded-[18px] text-start transition-[transform,box-shadow] duration-300 ease-[cubic-bezier(.2,.8,.2,1)] motion-reduce:transition-none ${
+ className={`relative h-[152px] w-[136px] flex-none origin-bottom overflow-hidden rounded-[18px] text-start transition-[transform,box-shadow] duration-200 ease-[cubic-bezier(.2,.8,.2,1)] motion-reduce:transition-none ${
isActive ? 'z-[1] scale-[1.18] shadow-[0_18px_40px_-16px_rgba(0,0,0,.55)]' : 'scale-100 shadow-[0_10px_24px_-14px_rgba(0,0,0,.5)]'
} ${src ? '' : emptyGround} ${isSuggestion ? 'opacity-90' : ''}`}
// backgroundImage, not background: the shorthand would drop the opaque colour
diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx
index 06f088531..c3178c79b 100644
--- a/client/src/components/Journey/JourneyMap.tsx
+++ b/client/src/components/Journey/JourneyMap.tsx
@@ -693,8 +693,10 @@ function JourneyMap(
/>
{/* A finger zooms with a pinch, and on a phone these sat under the bottom bar (#3001). */}
diff --git a/client/src/components/Journey/MobileMapTimeline.tsx b/client/src/components/Journey/MobileMapTimeline.tsx
index b675a2053..4cb3a5865 100644
--- a/client/src/components/Journey/MobileMapTimeline.tsx
+++ b/client/src/components/Journey/MobileMapTimeline.tsx
@@ -69,7 +69,7 @@ export default function MobileMapTimeline({
controlsTop,
}: Props) {
const {
- mapRef, carouselRef, cardRefs, activeIndex, setActiveIndex, scrubberDays,
+ mapRef, carouselRef, cardRefs, activeIndex, focusIndex, setActiveIndex, scrubberDays,
syncMapToCard: syncMapToCarousel, handleMarkerClick, handleCardTap, openEntryById, jumpToDay,
} = useJourneyCarouselSync({ entries, mapEntries, onOpenEntry: onEntryClick })
// The delayed initial focus reads both through refs so it always works off
@@ -207,7 +207,7 @@ export default function MobileMapTimeline({
handleCardTap(entry, i)}
showMood={showMood}
showWeather={showWeather}
diff --git a/client/src/components/Journey/useJourneyCarouselSync.test.ts b/client/src/components/Journey/useJourneyCarouselSync.test.ts
index c8d5bb9e2..726abeabb 100644
--- a/client/src/components/Journey/useJourneyCarouselSync.test.ts
+++ b/client/src/components/Journey/useJourneyCarouselSync.test.ts
@@ -129,7 +129,7 @@ describe('useJourneyCarouselSync', () => {
carousel.dispatchEvent(new Event('scroll'));
act(() => vi.advanceTimersByTime(100));
carousel.dispatchEvent(new Event('scroll'));
- act(() => vi.advanceTimersByTime(149));
+ act(() => vi.advanceTimersByTime(89));
expect(hook.result.current.activeIndex).toBe(0);
act(() => vi.advanceTimersByTime(1));
// Centre 250: card 1 spans 200 to 300.
@@ -170,7 +170,7 @@ describe('useJourneyCarouselSync', () => {
Object.defineProperty(carousel, 'scrollLeft', { value: scrollLeft, configurable: true });
carousel.dispatchEvent(new Event('scroll'));
act(() => {
- vi.advanceTimersByTime(150);
+ vi.advanceTimersByTime(90);
});
};
diff --git a/client/src/components/Journey/useJourneyCarouselSync.ts b/client/src/components/Journey/useJourneyCarouselSync.ts
index 6042598cc..2668a3cca 100644
--- a/client/src/components/Journey/useJourneyCarouselSync.ts
+++ b/client/src/components/Journey/useJourneyCarouselSync.ts
@@ -25,6 +25,13 @@ export interface JourneyCarouselSyncOptions {
* once scrolling settles, and the map follows it; a marker, a day on the scrubber or a
* tap brings its card to the centre.
*/
+/**
+ * How long the strip has to be still before the swipe counts as landed: long
+ * enough to see past the gaps between scroll events of a momentum swipe, short
+ * enough that the map follows the card without a noticeable wait.
+ */
+const SETTLE_MS = 90;
+
export function useJourneyCarouselSync({
entries,
mapEntries,
@@ -35,6 +42,10 @@ export function useJourneyCarouselSync({
const carouselRef = useRef(null);
const cardRefs = useRef