fix(planner): a booked hotel stays in the place list when road trip stops are hidden in Days

Since 4.3.0 every lodging booking types its place as 'hotel', and 'hotel'
is one of the road trip stop types. With "Show in Days too" switched off,
Days dropped every such place from the trip's place list, so a hotel
vanished from the sidebar, from the booking's own place picker and from
the Days map the moment it was booked, and a click on it in the day list
found nothing. Nothing was deleted: road trip mode kept showing it.

Days now leaves out only road trip stops nobody booked. A lodging place
stays, and so does any place a stay or a booking points at, on the
desktop and on the phone. Trips planned on 4.3.1 show their hotels again
without any change to their data.

An imported GPX or KML track is no longer offered as the place of a stay,
in the booking form, the day's hotel picker and the phone's sheets. A
stay that already names a track keeps showing it.
This commit is contained in:
Maurice
2026-09-23 21:28:34 +02:00
parent a1d6348c5f
commit b5457d9e6a
16 changed files with 225 additions and 15 deletions
@@ -1,4 +1,4 @@
// FE-PLANNER-DAYDETAIL-001 to FE-PLANNER-DAYDETAIL-084
// FE-PLANNER-DAYDETAIL-001 to FE-PLANNER-DAYDETAIL-085
import React from 'react';
import { fireEvent, render, screen, waitFor, within, act } from '../../../tests/helpers/render';
import userEvent from '@testing-library/user-event';
@@ -520,6 +520,15 @@ describe('DayDetailPanel', () => {
expect(await screen.findByText('102 Quai de Jemmapes')).toBeInTheDocument();
});
it('FE-PLANNER-DAYDETAIL-085: the hotel picker leaves out imported tracks', async () => {
const hotel = buildPlace({ id: 10, name: 'Hotel du Nord' });
const track = buildPlace({ id: 12, name: 'Canal Saint-Martin walk', route_geometry: '[[48.87,2.36],[48.88,2.37]]' });
render(<DayDetailPanel {...defaultProps} places={[hotel, track]} />);
await userEvent.click(await screen.findByText(/Add accommodation/i));
await screen.findByText('Hotel du Nord');
expect(screen.queryByText('Canal Saint-Martin walk')).not.toBeInTheDocument();
});
it('FE-PLANNER-DAYDETAIL-030: selecting a place in hotel picker enables save button', async () => {
const place = buildPlace({ id: 10, name: 'Maison Blanche' });
server.use(