From 69d88ffefd23b5c569f18e29103e638949980a7f Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 6 Nov 2026 16:29:33 +0100 Subject: [PATCH] fix(mobile): booking status toggle as tall as the fields, with status dots The pending / confirmed toggle was shorter than the booking code field next to it. It is now a 42 px framed field with the status colour as a dot in each option, marked up as a radio group, and sits under the code at full width, where both words fit. --- .../trip/sheets/MBookingFields.test.tsx | 6 ++-- .../screens/trip/sheets/MBookingFields.tsx | 30 ++++++++++++++----- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/client/src/mobile/screens/trip/sheets/MBookingFields.test.tsx b/client/src/mobile/screens/trip/sheets/MBookingFields.test.tsx index 29a31b17b..3b5534bb1 100644 --- a/client/src/mobile/screens/trip/sheets/MBookingFields.test.tsx +++ b/client/src/mobile/screens/trip/sheets/MBookingFields.test.tsx @@ -35,15 +35,15 @@ describe('MBookingCodeStatus', () => { fireEvent.change(input, { target: { value: 'XYZ9' } }); expect(onCodeChange).toHaveBeenCalledWith('XYZ9'); - fireEvent.click(screen.getByRole('button', { name: 'reservations.confirmed' })); + fireEvent.click(screen.getByRole('radio', { name: 'reservations.confirmed' })); expect(onStatusChange).toHaveBeenCalledWith('confirmed'); }); it('FE-COMP-MBOOKINGFIELDS-002: marks the current status as the active segment', () => { render(); - expect(screen.getByRole('button', { name: 'reservations.confirmed' }).className).toContain('bg-m-act'); - expect(screen.getByRole('button', { name: 'reservations.pending' }).className).toContain('text-m-muted'); + expect(screen.getByRole('radio', { name: 'reservations.confirmed' }).className).toContain('bg-m-act'); + expect(screen.getByRole('radio', { name: 'reservations.pending' }).className).toContain('text-m-muted'); }); }); diff --git a/client/src/mobile/screens/trip/sheets/MBookingFields.tsx b/client/src/mobile/screens/trip/sheets/MBookingFields.tsx index aabf41e9a..471ee7661 100644 --- a/client/src/mobile/screens/trip/sheets/MBookingFields.tsx +++ b/client/src/mobile/screens/trip/sheets/MBookingFields.tsx @@ -32,11 +32,15 @@ interface MBookingCodeStatusProps { onStatusChange: (status: BookingStatus) => void; } -/** Booking code and the pending / confirmed toggle, side by side. */ +/** + * Booking code and the pending / confirmed toggle, one under the other: side + * by side the two words did not fit half a phone's width once each carried its + * status dot. + */ export function MBookingCodeStatus({ t, code, onCodeChange, status, onStatusChange }: MBookingCodeStatusProps) { return ( -
-
+
+
{t('reservations.confirmationCode')}
-
+
{t('reservations.status')} -
+ {/* As tall as the code field beside it, the status colour in each option's dot. */} +
{(['pending', 'confirmed'] as const).map((s) => ( ))}