fix(dayplan): the delete question names every date and night it changes

The question before a day goes now also says which day without a date takes over the last date, which stay running across the day loses a night and when it checks out, and what the cancelled booking costs, or that it has no expense at all; further bookings on the same stay are counted. Road trip boundaries follow their own days when the numbering still has a hole from the old delete, and ones left on no day are dropped.

A long list scrolls inside the confirm card on both shells with the buttons always in reach, Escape closes only the sheet on top and takes the trip dialog back from its review step to the form, and the panel of a deleted day closes, also when a fellow traveller deletes it. Undo steps on a deleted day are dropped, a restored place skips days that are gone, and an undo that fails says so. The day cache is written without holding up the answer once the server has it, the tip under a new start date points at the dated add button, and two Collab tests find the confirm button by its role instead of an old colour class.
This commit is contained in:
Maurice
2026-09-23 20:50:29 +02:00
parent 1639fc6a3e
commit 302101b186
102 changed files with 1170 additions and 142 deletions
@@ -130,6 +130,21 @@ describe('ConfirmDialog', () => {
expect(document.querySelector('.bg-danger-soft')).toBeNull();
});
it('FE-COMP-CONFIRM-013: a long list scrolls inside the card, and the buttons stay outside it, always in reach', () => {
render(
<ConfirmDialog isOpen={true} onClose={onClose} onConfirm={onConfirm} message="Delete it?">
<ul aria-label="consequences">{Array.from({ length: 40 }, (_, i) => <li key={i}>Row {i}</li>)}</ul>
</ConfirmDialog>
);
const scroller = screen.getByRole('list', { name: 'consequences' }).closest('.overflow-y-auto') as HTMLElement;
expect(scroller).not.toBeNull();
expect(scroller.parentElement).toHaveClass('flex-col');
expect(scroller.parentElement!.className).toMatch(/max-h-\[/);
const confirm = screen.getByRole('button', { name: /delete/i });
expect(scroller.contains(confirm)).toBe(false);
expect(confirm.parentElement).toHaveClass('flex-none');
});
it('FE-COMP-CONFIRM-008: clicking backdrop calls onClose', async () => {
const user = userEvent.setup();
render(<ConfirmDialog isOpen={true} onClose={onClose} onConfirm={onConfirm} message="msg" />);
@@ -65,12 +65,14 @@ export default function ConfirmDialog({
style={{ paddingBottom: 'var(--bottom-nav-h)' }}
onClick={onClose}
>
{/* Capped at the viewport: a long list of what goes along scrolls on its
own, and the two buttons below it always stay in reach. */}
<div
role="presentation"
className={`trek-modal-enter rounded-2xl shadow-2xl w-full ${children ? 'max-w-md' : 'max-w-sm'} p-6 bg-surface-card`}
className={`trek-modal-enter flex max-h-[calc(100dvh-2rem-var(--bottom-nav-h,0px))] flex-col rounded-2xl shadow-2xl w-full ${children ? 'max-w-md' : 'max-w-sm'} p-6 bg-surface-card`}
onClick={e => e.stopPropagation()}
>
<div className="flex items-start gap-4">
<div className="flex min-h-0 items-start gap-4 overflow-y-auto overscroll-contain">
{danger && (
<div className="flex-shrink-0 w-10 h-10 rounded-full bg-danger-soft flex items-center justify-center">
<AlertTriangle className="w-5 h-5 text-danger" />
@@ -87,7 +89,7 @@ export default function ConfirmDialog({
</div>
</div>
<div className="flex justify-end gap-3 mt-6">
<div className="flex flex-none justify-end gap-3 mt-6">
<button type="button"
onClick={onClose}
className="px-4 py-2 text-sm font-medium rounded-lg transition-colors text-content-secondary border border-edge-secondary"