diff --git a/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx b/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx
index 41a0ebd74..c1aa53f3e 100644
--- a/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx
@@ -3,7 +3,8 @@ import { RES_ICONS } from '../../../../components/Planner/DayPlanSidebar.constan
import { formatPriceText } from '../../../../utils/formatters'
import { useTranslation } from '../../../../i18n'
import type { Reservation } from '../../../../types'
-import { CardActions, CardDeleteSheet, CardFiles, CardNotes, CardTitleButton, CardTypeMarker, CardWhenAndCode, RESERVATION_CARD_SURFACE, reservationHeaderTint } from './MReservationCardParts'
+import { CardActions, CardDeleteSheet, CardFiles, CardNotes, CardTitleButton, CardTypeMarker, CardWhenAndCode, RESERVATION_CARD_SURFACE } from './MReservationCardParts'
+import { reservationHeaderTint } from './reservationHeaderTint'
import { Field, ReservationPluginSlots, RESERVATION_FIELD_LABEL, RESERVATION_FIELD_SURFACE, TravelerAvatars } from './tabChrome'
import { STATUS_COLOR, type MTabScreenProps } from './tabModel'
import { cardWhen, parseTransportMeta } from './transportsModel'
diff --git a/client/src/mobile/screens/trip/tabs/reservationHeaderTint.ts b/client/src/mobile/screens/trip/tabs/reservationHeaderTint.ts
new file mode 100644
index 000000000..5f28ae463
--- /dev/null
+++ b/client/src/mobile/screens/trip/tabs/reservationHeaderTint.ts
@@ -0,0 +1,3 @@
+export function reservationHeaderTint(color: string) {
+ return `color-mix(in srgb, ${color} 8%, var(--m-sheetop))`;
+}
diff --git a/client/src/mobile/screens/vacay/MVacayInviteSheet.tsx b/client/src/mobile/screens/vacay/MVacayInviteSheet.tsx
index 22f2045b4..5d1b3ddd3 100644
--- a/client/src/mobile/screens/vacay/MVacayInviteSheet.tsx
+++ b/client/src/mobile/screens/vacay/MVacayInviteSheet.tsx
@@ -6,8 +6,8 @@ import { type VacayUser } from '../../../types'
import MSheet from '../../components/MSheet'
import { MUserPickerField } from '../../components/MUserPickerList'
import {
- FormSheetBody, FormSheetFooter, FormSheetHeader, FormSheetSection, SELECT_FIELD_CLS, formOptionClass,
-} from '../trip/sheets/PlSheetChrome'
+ FormSheetBody, FormSheetFooter, FormSheetHeader, FormSheetSection, SELECT_FIELD_CLS } from '../trip/sheets/PlSheetChrome'
+import { formOptionClass } from '../trip/sheets/formOptionClass'
interface MVacayInviteSheetProps {
open: boolean
diff --git a/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx b/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx
index 01b66320a..c152f273a 100644
--- a/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx
+++ b/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx
@@ -4,6 +4,7 @@ import MSheet from '../../components/MSheet'
import MIconBtn from '../../components/MIconBtn'
import MToggle from '../../components/MToggle'
import ConfirmDialog from '../../../components/shared/ConfirmDialog'
+import { useShallow } from 'zustand/react/shallow'
import { useVacayStore } from '../../../store/vacayStore'
import { useTranslation } from '../../../i18n'
import { useSchoolHolidayCountries } from '../../../components/Vacay/useSchoolHolidayCountries'
@@ -14,8 +15,8 @@ import { FALLBACK_PERSON_COLOR } from './vacayDayModel'
import type { VacayHolidayCalendar } from '../../../types'
import {
AddFieldButton, FIELD_CLS, FormSheetBody, FormSheetHeader, FormSheetSection,
- SELECT_FIELD_CLS, SheetDateField, formOptionClass,
-} from '../trip/sheets/PlSheetChrome'
+ SELECT_FIELD_CLS, SheetDateField } from '../trip/sheets/PlSheetChrome'
+import { formOptionClass } from '../trip/sheets/formOptionClass'
const CALENDAR_COLORS = ['#fecaca', '#fed7aa', '#fde68a', '#bbf7d0', '#a5f3fc', '#c7d2fe', '#e9d5ff', '#fda4af']
const HINT = 'text-caption leading-snug text-m-muted'
@@ -41,7 +42,9 @@ function ToggleRow({ label, hint, checked, onChange }: {
export default function MVacaySettingsSheet({ open, onClose }: { open: boolean; onClose: () => void }) {
const { t, language } = useTranslation()
- const { plan, updatePlan, isFused, users } = useVacayStore()
+ const { plan, updatePlan, isFused, users } = useVacayStore(useShallow(s => ({
+ plan: s.plan, updatePlan: s.updatePlan, isFused: s.isFused, users: s.users,
+ })))
const {
countries, publicHolidayCalendars, schoolHolidayCalendars, weekendDays, toggleWeekendDay,
dissolveFusion, confirmingDissolve, askDissolve, cancelDissolve,
@@ -138,7 +141,11 @@ function HolidaySettings({ type, countries, calendars, label, hint, enabled, onT
}) {
const { t } = useTranslation()
const [adding, setAdding] = useState(false)
- const { addHolidayCalendar, updateHolidayCalendar, deleteHolidayCalendar } = useVacayStore()
+ const { addHolidayCalendar, updateHolidayCalendar, deleteHolidayCalendar } = useVacayStore(useShallow(s => ({
+ addHolidayCalendar: s.addHolidayCalendar,
+ updateHolidayCalendar: s.updateHolidayCalendar,
+ deleteHolidayCalendar: s.deleteHolidayCalendar,
+ })))
return (
diff --git a/client/src/mobile/screens/vacay/MVacayShareSheet.tsx b/client/src/mobile/screens/vacay/MVacayShareSheet.tsx
index b76b07a80..b2f716b59 100644
--- a/client/src/mobile/screens/vacay/MVacayShareSheet.tsx
+++ b/client/src/mobile/screens/vacay/MVacayShareSheet.tsx
@@ -7,8 +7,8 @@ import MIconBtn from '../../components/MIconBtn'
import MSheet from '../../components/MSheet'
import { MUserPickerField } from '../../components/MUserPickerList'
import {
- FormSheetBody, FormSheetFooter, FormSheetHeader, FormSheetSection, SELECT_FIELD_CLS, formOptionClass,
-} from '../trip/sheets/PlSheetChrome'
+ FormSheetBody, FormSheetFooter, FormSheetHeader, FormSheetSection, SELECT_FIELD_CLS } from '../trip/sheets/PlSheetChrome'
+import { formOptionClass } from '../trip/sheets/formOptionClass'
interface MVacayShareSheetProps {
open: boolean
diff --git a/client/src/sync/tripSyncManager.prepare.test.ts b/client/src/sync/tripSyncManager.prepare.test.ts
index dbdcfef62..eb003bbc0 100644
--- a/client/src/sync/tripSyncManager.prepare.test.ts
+++ b/client/src/sync/tripSyncManager.prepare.test.ts
@@ -201,7 +201,7 @@ describe('tripSyncManager.prepareForOffline — full run', () => {
const broken = buildTrip({ id: 608, end_date: dateOffset(4) })
serveTrips([broken, good], { 607: bundleFor(good) })
- expect(await tripSyncManager.prepareForOffline()).toEqual({ status: 'done', trips: 2 })
+ expect(await tripSyncManager.prepareForOffline()).toEqual({ status: 'done', trips: 1 })
expect(await offlineDb.trips.get(607)).toBeDefined()
expect(await offlineDb.trips.get(608)).toBeUndefined()
expect(console.error).toHaveBeenCalled()
diff --git a/client/tests/unit/mobile/MSheet.test.tsx b/client/tests/unit/mobile/MSheet.test.tsx
index e7afce7b3..da0de10f8 100644
--- a/client/tests/unit/mobile/MSheet.test.tsx
+++ b/client/tests/unit/mobile/MSheet.test.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { describe, it, expect, vi, afterEach } from 'vitest';
-import { render, screen, fireEvent, act } from '@testing-library/react';
+import { render, screen, fireEvent, createEvent, act } from '@testing-library/react';
import MSheet from '../../../src/mobile/components/MSheet';
import { closeTopOverlay } from '../../../src/hooks/overlayStack';
import { CustomDatePicker } from '../../../src/components/shared/CustomDateTimePicker';
@@ -357,6 +357,8 @@ describe('MSheet', () => {
fireEvent.touchMove(content, touch(140));
fireEvent.touchMove(content, touch(300));
expect(dialog.style.transform).toBe('translateY(160px)');
+ const shade = document.querySelector('[data-m-scrim]')?.parentElement;
+ expect(shade?.style.opacity).toBe('0.6');
fireEvent.touchEnd(content, touch(300));
expect(onClose).toHaveBeenCalledTimes(1);
@@ -375,6 +377,7 @@ describe('MSheet', () => {
fireEvent.touchCancel(content, touch(300));
expect(dialog.style.transform).toBe('translateY(0px)');
+ expect(document.querySelector('[data-m-scrim]')?.parentElement?.style.opacity).toBe('1');
expect(onClose).not.toHaveBeenCalled();
});
@@ -430,9 +433,12 @@ describe('MSheet', () => {
const dialog = screen.getByRole('dialog', { name: 'Form' });
const strip = dialog.querySelector('.cursor-grab') as HTMLElement;
- fireEvent.pointerDown(strip, { pointerId: 1, clientY: 100 });
- fireEvent.pointerMove(strip, { pointerId: 1, clientY: 160 });
- fireEvent.pointerUp(strip, { pointerId: 1, clientY: 160 });
+ const down = createEvent.pointerDown(strip, { pointerId: 1, clientY: 100 });
+ const move = createEvent.pointerMove(strip, { pointerId: 1, clientY: 160 });
+ const up = createEvent.pointerUp(strip, { pointerId: 1, clientY: 160 });
+ fireEvent(strip, Object.defineProperty(down, 'timeStamp', { value: 100 }));
+ fireEvent(strip, Object.defineProperty(move, 'timeStamp', { value: 140 }));
+ fireEvent(strip, Object.defineProperty(up, 'timeStamp', { value: 150 }));
expect(onClose).not.toHaveBeenCalled();
expect(screen.getByRole('alertdialog')).toBeInTheDocument();
@@ -589,8 +595,8 @@ describe('MSheet', () => {
const root = panel().closest('[role="presentation"]') as HTMLElement;
const scrim = root.querySelector('[data-m-scrim]') as HTMLElement;
expect(scrim.className).toContain('m-fade-in');
- expect(scrim.className).toContain('pointer-events-none');
- expect(scrim.contains(panel())).toBe(false);
+ expect(scrim.parentElement).toHaveClass('pointer-events-none');
+ expect(scrim.parentElement?.contains(panel())).toBe(false);
// No ancestor of the sheet animates its opacity.
for (let el: HTMLElement | null = panel().parentElement; el; el = el.parentElement) {
expect(el.className || '').not.toMatch(/\bm-fade-(in|out)\b/);
diff --git a/client/tests/unit/mobile/formSheet.test.tsx b/client/tests/unit/mobile/formSheet.test.tsx
index 90f006a8f..8590a727a 100644
--- a/client/tests/unit/mobile/formSheet.test.tsx
+++ b/client/tests/unit/mobile/formSheet.test.tsx
@@ -46,7 +46,7 @@ describe('form sheet chrome', () => {
it('FE-MOB-FORMSHEET-002: a long title wraps to a second line instead of being cut after one', () => {
render();
- const title = screen.getAllByText('Add expense').find((el) => el.tagName === 'DIV') as HTMLElement;
+ const title = screen.getByRole('heading', { name: 'Add expense' });
expect(title).toHaveClass('line-clamp-2');
expect(title).not.toHaveClass('truncate');
});
@@ -87,7 +87,6 @@ describe('form sheet chrome', () => {
expect(
screen.getByRole('button', { name: /enter date manually|common\.datepicker\.enterManually/i })
).toBeInTheDocument();
- expect(trigger.closest('.rounded-full')).not.toBeNull();
});
});
diff --git a/client/tests/unit/mobile/largeScreen.test.tsx b/client/tests/unit/mobile/largeScreen.test.tsx
index 0695fd349..5e71e0b98 100644
--- a/client/tests/unit/mobile/largeScreen.test.tsx
+++ b/client/tests/unit/mobile/largeScreen.test.tsx
@@ -122,11 +122,12 @@ describe('JourneyEntryCover sizes', () => {
expect(screen.getByText('Kyoto, Japan').className).toContain('line-clamp-2');
});
- it("FE-MOB-LARGE-007: a card without a photo is the day's colour, not an empty grey", () => {
+ it('FE-MOB-LARGE-007: a mobile card without a photo uses the neutral sheet surface', () => {
render( {}} tone="mobile" />);
const card = screen.getByRole('button');
- expect(card.style.backgroundImage).toContain('rgba(20, 184, 166, 0.85)');
- expect(card.className).toContain('w-[136px]');
+ expect(card).toHaveClass('bg-m-sheetop', 'text-m-ink');
+ expect(card.style.backgroundImage).toBe('');
+ expect(card.className).toContain('w-[144px]');
expect(screen.getByText('Kyoto, Japan').className).toContain('truncate');
});
});