From 954758082b1762ec3bcc21ff56a8a2a96c14dbc5 Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 23 Sep 2026 22:20:59 +0200 Subject: [PATCH] fix(dayplan): calmer day dialogs, and the shrink question side by side The day dialog hangs from a fixed top edge, so switching to the delete question only moves its bottom edge, and the question opens at its top with the focus on Cancel. Cancel, Close and the quiet add share one outline; the dated add is drawn in the accent instead of filled with it. Dates in the dialog, its hints and the new-day toast read the way the day list writes them, and captions use the muted text colour for contrast. A stay booked twice is named once in the warning. On the phone the dated pill shows only its date, so both pills fit side by side. When the trip dialog asks both how bookings follow a moved start and which days the new dates remove, the two now stand side by side in a wide dialog instead of one long column. --- .../src/components/Planner/DayAddFooter.tsx | 17 +++--- .../components/Planner/DayReorderPopup.tsx | 53 +++++++------------ .../src/components/Trips/TripDateReview.tsx | 24 +++++++-- client/src/components/Trips/TripFormModal.tsx | 9 ++-- client/src/components/shared/Modal.tsx | 9 +++- .../mobile/screens/trip/sheets/MDaysSheet.tsx | 24 ++++++--- client/src/pages/tripPlanner/useDayAdd.ts | 4 +- client/src/pages/tripPlanner/useDayDelete.ts | 5 +- .../pages/tripPlanner/useTripPlanner.test.tsx | 2 +- client/src/utils/dayDeleteImpact.ts | 14 ++++- client/src/utils/dayLabel.ts | 21 +++++--- .../unit/mobile/trip/MDaysSheet.test.tsx | 6 +-- shared/src/i18n/ar/dayplan.ts | 2 +- shared/src/i18n/br/dayplan.ts | 6 +-- shared/src/i18n/ca/dayplan.ts | 6 +-- shared/src/i18n/cs/dayplan.ts | 6 +-- shared/src/i18n/de/dayplan.ts | 6 +-- shared/src/i18n/en/dayplan.ts | 6 +-- shared/src/i18n/es/dayplan.ts | 2 +- shared/src/i18n/fr/dayplan.ts | 6 +-- shared/src/i18n/gr/dayplan.ts | 2 +- shared/src/i18n/hu/dayplan.ts | 2 +- shared/src/i18n/id/dayplan.ts | 2 +- shared/src/i18n/it/dayplan.ts | 2 +- shared/src/i18n/ja/dayplan.ts | 2 +- shared/src/i18n/ko/dayplan.ts | 2 +- shared/src/i18n/nl/dayplan.ts | 2 +- shared/src/i18n/pl/dayplan.ts | 2 +- shared/src/i18n/ru/dayplan.ts | 6 +-- shared/src/i18n/sv/dayplan.ts | 6 +-- shared/src/i18n/tr/dayplan.ts | 2 +- shared/src/i18n/uk/dayplan.ts | 6 +-- shared/src/i18n/vi/dayplan.ts | 2 +- shared/src/i18n/zh-TW/dayplan.ts | 2 +- shared/src/i18n/zh/dayplan.ts | 2 +- 35 files changed, 152 insertions(+), 118 deletions(-) diff --git a/client/src/components/Planner/DayAddFooter.tsx b/client/src/components/Planner/DayAddFooter.tsx index 5d925bd1d..46a64ef1b 100644 --- a/client/src/components/Planner/DayAddFooter.tsx +++ b/client/src/components/Planner/DayAddFooter.tsx @@ -1,6 +1,6 @@ import { useId, useState } from 'react' import { CalendarPlus, Plus } from 'lucide-react' -import { formatDate } from '../../utils/formatters' +import { dayDate } from '../../utils/dayLabel' import type { DayAddControls } from '../../utils/dayAdd' interface DayAddFooterProps { @@ -15,10 +15,11 @@ interface DayAddFooterProps { /** One button size for the whole foot of the reorder dialog, the delete question's included. */ export const FOOTER_BTN = 'inline-flex min-h-9 flex-shrink-0 items-center justify-center gap-1.5 whitespace-nowrap rounded-lg px-3 py-1.5 text-body font-medium transition-colors disabled:cursor-default disabled:opacity-40' -const SECONDARY_BTN = `${FOOTER_BTN} border border-edge text-content-secondary hover:bg-surface-hover disabled:hover:bg-transparent` -const CLOSE_BTN = `${FOOTER_BTN} ml-auto border border-edge text-content-muted hover:bg-surface-hover hover:text-content` -/** The add that matters most, tinted from the accent instead of filled with it. */ -const MAIN_BTN = `${FOOTER_BTN} border border-[color:color-mix(in_srgb,var(--accent)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)] font-semibold text-accent-on hover:bg-[color:color-mix(in_srgb,var(--accent)_16%,transparent)] disabled:hover:bg-[color:color-mix(in_srgb,var(--accent)_10%,transparent)]` +/** Cancel, Close and the quiet add: one outline, one text colour, so none of them looks switched off beside another. */ +export const SECONDARY_BTN = `${FOOTER_BTN} border border-edge text-content-secondary hover:bg-surface-hover hover:text-content disabled:hover:bg-transparent` +const CLOSE_BTN = `${SECONDARY_BTN} ml-auto` +/** The add that matters most: drawn in the accent, not filled with it, so it leads without weighing on the row. */ +const MAIN_BTN = `${FOOTER_BTN} border border-accent-on bg-transparent font-semibold text-accent-on hover:bg-accent-subtle disabled:hover:bg-transparent` /** * The foot of the reorder dialog: close it, or add a day. @@ -45,7 +46,7 @@ export function DayAddFooter({ dayAdd, onAddDay, onClose, t, locale }: DayAddFoo if (!dayAdd?.nextDate) { return (
- {blocked &&

{blocked}

} + {blocked &&

{blocked}

}
@@ -101,9 +103,15 @@ export default function MDaysSheet({ planner, shell }: MTripSheetsProps) {
{date ? ( <> -