mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
feat(trips): shortening a trip says first which days go and what is on them
The trip dialog on the desktop and the trip sheet on a phone now ask before a save whose new dates remove days with something on them. The question names those days the way the day list does and lists what goes with them in the same rows the delete day question uses: planned places stay in the place list, notes and day texts are deleted, bookings stay under Bookings, and a stay that checks in or out on a removed day goes as a whole while its booking and expense remain, shown in the danger tone. A moved start gets both questions in one step, with the booking hint following the chosen shift mode, and a save that only drops empty days asks nothing. The rule that lays the days out moved into shared as planDayGrid, with resolveDayGridRange deciding whether the rows are rebuilt at all. generateDays on the server now carries that plan out in one transaction, so the warning names exactly the days the save takes, and a seeded fuzz test holds the new rebuild to the old one over 300 random day grids. The update_trip tool says in its description what shortening takes and lists removed_days in its answer. Alongside, the dialog sends a day count only when it changed, so a stale count no longer trims a day just added, stays are reloaded after every date change including the one made on a phone, and the date shift tip now points to adding a day under Reorder days.
This commit is contained in:
@@ -109,4 +109,17 @@ Each row of the **Reorder days** dialog has a delete button; on a phone it sits
|
||||
|
||||
A trip always keeps at least one day, and deleting needs a connection. There is no undo, which is why the dialog spells out the consequences first.
|
||||
|
||||
## Shortening a trip
|
||||
|
||||
New dates lay the days of a trip out again. Plans follow their position: the first day of the plan takes the new start date, the second the date after it, and so on. When the new dates hold fewer days than the plan, the last days go, also when it was the start that moved. Empty days without a date go as well.
|
||||
|
||||
Before such a save, the trip dialog (on a phone, the trip sheet) asks and lists the days that go, then what is on them:
|
||||
|
||||
- **Planned places** stay in the place list of the trip.
|
||||
- **Notes**, day titles and day descriptions are deleted.
|
||||
- **Bookings** on those days stay under Bookings. With **Keep bookings on their dates**, a booking whose date is still part of the trip goes back onto that day; with **Shift everything** it stays without a day.
|
||||
- **A stay that checks in or out on one of those days** is removed as a whole, also for nights that are still part of the trip. Its booking and the expense of that booking stay under Bookings. The list shows the stay in red.
|
||||
|
||||
When the start moved as well, the same step also asks how bookings follow the new dates. Nothing is asked when the days that go are empty, and there is no undo.
|
||||
|
||||
**See also:** [Places-and-Search](Places-and-Search) · [Map-Features](Map-Features) · [Route-Optimization](Route-Optimization) · [Weather-Forecasts](Weather-Forecasts) · [Reservations-and-Bookings](Reservations-and-Bookings)
|
||||
@@ -34,7 +34,7 @@ Requires `trips:read` or `trips:write` scope.
|
||||
|---|---|
|
||||
| `list_trips` | List all trips you own or are a member of. Supports `include_archived` flag. |
|
||||
| `create_trip` | Create a trip with title, dates, and currency. Days are auto-generated from the date range. Without a currency the trip takes your display currency (Settings → General, or the admin's User Defaults preset), and EUR when that is left on *Trip currency*; see [Currencies](Currencies). |
|
||||
| `update_trip` | Update a trip's title, description, dates, or currency. |
|
||||
| `update_trip` | Update a trip's title, description, dates, or currency. Shortening a dated trip removes its last days with what is on them, and the result then lists them in `removed_days`. |
|
||||
| `search_cover_images` | Search Unsplash for candidate cover photos and return their URLs, thumbnails and photographer credits. Nothing is saved; pass the chosen photo's URL to `update_trip` as `cover_image`. |
|
||||
| `delete_trip` | Delete a trip. Owner only. Requires `trips:delete`. |
|
||||
| `list_trip_members` | List the owner and all collaborators of a trip. |
|
||||
|
||||
Reference in New Issue
Block a user