feat(trip-settings): edit the trip inside its settings, in one look across the areas and the trip form

Edit trip is an area of the settings dialog, beside People, Sharing and
Journal, instead of a second dialog. The side column names the areas only, the
dialog keeps one height, and every area uses the same cards, fields and
buttons; the trip form on its own takes the same head, cards and buttons. A
trip that loads quickly opens without the splash on the desktop too.
This commit is contained in:
Maurice
2026-11-13 12:40:16 +01:00
parent 721a610a70
commit bd58f17ec0
47 changed files with 892 additions and 522 deletions
@@ -1108,17 +1108,21 @@ describe('TripMembersModal', () => {
view.unmount();
});
it('FE-COMP-MEMBERS-062: Edit Trip in the side column hands over to the trip form (#2811)', async () => {
it('FE-COMP-MEMBERS-062: Edit Trip is an area of the dialog that shows the trip form (#2811)', async () => {
const user = userEvent.setup();
const onEditTrip = vi.fn();
render(<TripMembersModal {...defaultProps} onEditTrip={onEditTrip} />);
const trip = buildTrip({ id: 1, title: 'Lisbon in spring', user_id: ownerUser.id });
render(<TripMembersModal {...defaultProps} editTrip={{ trip, onSave: vi.fn() }} />);
// The column stands for it even where People is the only area.
const nav = await screen.findByRole('navigation', { name: 'Trip settings' });
await user.click(within(nav).getByRole('button', { name: 'Edit Trip' }));
expect(onEditTrip).toHaveBeenCalledTimes(1);
expect(within(nav).getByText('Title, dates, cover, description and currency.')).toBeInTheDocument();
// The trip's own form, in place: its title field holds the trip's title.
expect(await screen.findByDisplayValue('Lisbon in spring')).toBeVisible();
expect(within(nav).getByRole('button', { name: 'Edit Trip' })).toHaveAttribute('aria-current', 'page');
// The area itself says what it is for; the side column carries the names alone.
expect(within(nav).queryByText('Title, dates, cover, description and currency.')).toBeNull();
expect(screen.getByText('Title, dates, cover, description and currency.')).toBeInTheDocument();
});
it('FE-COMP-MEMBERS-063: without the right to edit the trip, the dialog offers no way to its form', async () => {