mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
docs(wiki): deleting and adding days, and what shortening a trip removes
The day plan page now walks through the reorder dialog and its phone sheet as they are: the two ways to add a day on a trip with dates, the question before a day is deleted and what it lists, and the step the trip dialog puts before a save that removes days. Accommodations explains why a stay behaves differently when its day is deleted and when the trip is shortened, and the trip dialog, undo, public API, MCP and plugin pages point at the new rules, including the dated option of create_day and days.create, removed_days on update_trip and the last day that cannot be deleted.
This commit is contained in:
@@ -87,6 +87,15 @@ you already have show their hotels on the drive without anyone re-saving anythin
|
||||
planned before 4.3.1 are seated the same way on upgrade, see
|
||||
[Upgrading to 4.3.1](Updating#upgrading-to-431).
|
||||
|
||||
## When a check-in or check-out day goes
|
||||
|
||||
A stay is tied to its check-in and check-out day, so it cannot outlive either of them. What happens to its booking depends on how the day goes:
|
||||
|
||||
- **Deleting the day** in the **Reorder days** dialog cancels the stay cleanly, together with its Hotel booking and the expense of that booking. The question before the delete shows this line in red. See [Deleting a day](Day-Plans-and-Notes#deleting-a-day).
|
||||
- **Shortening the trip** removes the whole stay, also its nights that are still part of the trip, but leaves its booking under Bookings and its expense under Costs. The trip dialog shows the stay in red before it saves. See [Shortening a trip](Day-Plans-and-Notes#shortening-a-trip).
|
||||
|
||||
A stay that only runs across a deleted day, with its check-in before and its check-out after it, is kept.
|
||||
|
||||
## In the day plan sidebar
|
||||
|
||||
Accommodations appear as small colour-coded badges in the day header row of the day plan sidebar:
|
||||
|
||||
@@ -26,6 +26,8 @@ On desktop, if you leave **both** dates empty, a separate **Day count** field ap
|
||||
|
||||
Only the **start** date is linked to the other one. Picking a start date fills the end date to match it, and moving the start date of an already-dated trip shifts the end date so the previous duration is kept. Nothing links them the other way round: you can pick an end date on its own, and the picker's **✕** button clears either field afterwards. A trip can therefore be saved with both dates, with only a start date, with only an end date, or with neither. A trip left with exactly one date gets an undated day grid (7 days by default), just like a date-less one.
|
||||
|
||||
The same dialog changes the dates of an existing trip later. The day plans follow their position, so new dates that hold fewer days take the last days of the plan away. When anything is planned on those days, the dialog lists it and asks before it saves; see [Shortening a trip](Day-Plans-and-Notes#shortening-a-trip). To make a trip one day longer without opening the dialog, add a day with the next date in the planner; see [Adding a day](Day-Plans-and-Notes#adding-a-day).
|
||||
|
||||
### Currency
|
||||
|
||||
The trip's currency — its **accounting base**. Every expense in the Costs tab is converted into it, and every balance and settle-up suggestion is calculated in it. The dialog pre-fills your own display currency (Settings → General → *Display currency*); if you left that on **Trip currency**, it falls back to **EUR**. An administrator can preset the instance-wide value under Admin → **User Defaults**, which new users inherit until they pick their own. 165 currencies are available.
|
||||
|
||||
+15
-12
@@ -90,36 +90,39 @@ Route controls appear at the bottom of a day section, after the place list, and
|
||||
|
||||
## Adding a day
|
||||
|
||||
The **Reorder days** dialog adds a day at its foot; on a phone the day sheet does the same below its list. On a trip with dates there are two ways, each with a line that says what it does:
|
||||
The **Reorder days** dialog adds a day at its foot. On a phone the same choice sits below the list of the **Reorder days** sheet, which opens from the calendar icon next to the day title above the plan. On a trip with dates there are two ways, and a line under the buttons says what each one does:
|
||||
|
||||
- **Add day without date** puts a day without a date at the end. The trip dates stay as they are, which suits a buffer day you have not placed yet.
|
||||
- **Add** followed by the next date (for example **Add Tue, Oct 13**) adds the calendar day after the last date of the trip and extends the trip to it. The new day goes right behind the last dated day, so days without a date move one place back and keep their plans. No existing day or booking changes its date.
|
||||
- **Add** followed by the next date (for example **Add Tue, Oct 13**) adds the calendar day after the last date of the trip and extends the trip to it. The new day goes right behind the last dated day, so days without a date move one place back and keep their plans. No existing day or booking changes its date. A message confirms the new end of the trip, and fellow travellers see it straight away.
|
||||
|
||||
A trip without dates has a single **Add day** button. Adding a day needs a connection, and a trip that already spans the most days a trip can have cannot grow by another date.
|
||||
A trip without dates has a single **Add day** button. Adding a day needs a connection. Once a trip spans the most days a trip can have (999), the button with the date is greyed out and the line under it says why.
|
||||
|
||||
## Deleting a day
|
||||
|
||||
Each row of the **Reorder days** dialog has a delete button; on a phone it sits next to the arrows in the day sheet. Before anything is deleted, TREK asks and lists what goes with the day:
|
||||
Members who can edit days find a delete button at the end of every row of the **Reorder days** dialog; on a phone it sits next to the arrows in the **Reorder days** sheet. Nothing is deleted straight away. TREK first asks, and lists what goes with the day:
|
||||
|
||||
- **Planned places** stay in the place list of the trip. Only their spot on this day goes.
|
||||
- **Notes**, the day title and the day description are deleted.
|
||||
- **Bookings** on the day stay under Bookings, without a day, and keep their date.
|
||||
- **A stay that checks in or out on the day** is cancelled, together with its booking and the expense of that booking. The list shows it in red. A stay that only runs across the day is kept.
|
||||
- **The days after it** move up one place. On a trip with dates the dates stay where they are, so every later day, and the bookings on it, takes the date one slot earlier. A day without a date at the end takes over the last date; when there is none, the trip ends one day earlier.
|
||||
- **A stay that checks in or out on the day** is cancelled, together with its booking and the expense of that booking. The list shows it in red, since this is the line that costs money. A stay that only runs across the day is kept.
|
||||
- **The days after it** move up one place. On a trip with dates the dates stay where they are, so every later day, and the bookings on it, takes the date one slot earlier; the list says how many days and bookings move. A day without a date at the end takes over the last date. When there is none, the trip ends one day earlier, and the list names the new end date.
|
||||
|
||||
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.
|
||||
A day with nothing on it gets a single line that says so. Deleting needs a connection, and the last day of a trip cannot be deleted; in both cases the button is greyed out and TREK says why. There is no undo, which is why the question spells out the consequences first. Fellow travellers see the day go, and a new end date, straight away.
|
||||
|
||||
## 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.
|
||||
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 that are left over go as well, with any change of dates.
|
||||
|
||||
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:
|
||||
Before such a save, TREK asks first: in the trip dialog as a step before the save, on a phone in a sheet over the trip sheet. It names the days that go, the first six by name and the rest as a count, and lists 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.
|
||||
- **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. The phone does not offer the choice and keeps bookings on their dates.
|
||||
- **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. Unlike when you delete a single day, its booking stays under Bookings and its expense under Costs. The list shows the stay in red.
|
||||
- **The last days go, not the first** closes the list when the start moved, as a reminder that plans follow their position.
|
||||
|
||||
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.
|
||||
The save button then reads **Remove days and save**. When the start moved, the same step also asks how bookings follow the new dates, as before. When the days that go hold nothing, nothing extra is asked. Should TREK fail to read the days of the trip, it warns in general terms instead of listing them. There is no undo.
|
||||
|
||||
On a trip without dates, a lower **Day count** only takes away days with no places, notes or stay on them, starting from the end. A day with plans on it stays.
|
||||
|
||||
**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. Shortening a dated trip removes its last days with what is on them, and the result then lists them in `removed_days`. |
|
||||
| `update_trip` | Update a trip's title, description, dates, or currency. Day plans follow their position, so dates that hold fewer days remove the last days with what is on them, also when only the start moved later. Every day a change removes is listed in `removed_days`, with its id, number and date as they stood before and a reason: `overflow` for a day past the new range, `spare` for an empty day without a date. |
|
||||
| `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. |
|
||||
@@ -78,8 +78,8 @@ Requires `trips:read` or `trips:write` scope.
|
||||
| Tool | Description |
|
||||
|---|---|
|
||||
| `update_day` | Set or clear a day's title. |
|
||||
| `create_day` | Add a new day to a trip with optional date and notes. With `position` an empty day is slotted in at that place. With `dated` the trip grows by the calendar day after its last date: the new day gets that date and goes right behind the last dated day, days without a date move one place back, and the end date of the trip moves to the new day. `dated` only works on a trip with dates and cannot be combined with `date` or `position`. |
|
||||
| `delete_day` | Delete a day from a trip. Its places stay in the place list, its notes and texts go, and bookings on it stay without a day. A stay that checks in or out on the day is cancelled with its booking and expense. Later days move up one place; on a dated trip they and their bookings take the date one slot earlier, and the trip ends a day earlier when no day without a date is left to take the last date. The last day of a trip cannot be deleted. |
|
||||
| `create_day` | Add a new day to a trip with optional date and notes. With `position` an empty day is slotted in at that place. With `dated` the trip grows by the calendar day after its last date: the new day gets that date and goes right behind the last dated day, days without a date move one place back, and the end date of the trip moves to the new day. `dated` only works on a trip with dates, is refused once the trip spans 999 days, and cannot be combined with `date` or `position`; its result carries the updated `trip` next to the `day`. |
|
||||
| `delete_day` | Delete a day from a trip. Its places stay in the place list, its notes and texts go, and bookings on it stay without a day. A stay that checks in or out on the day is cancelled with its booking and expense; a stay that only runs across the day is kept. Later days move up one place; on a dated trip they and their bookings take the date one slot earlier, and the trip ends a day earlier when no day without a date is left to take the last date. The last day of a trip cannot be deleted. |
|
||||
| `reorder_days` | Reorder whole days by listing every day ID of the trip in the desired order. Each day keeps its places, notes, stays and bookings; on a dated trip the dates stay pinned to their slots, so the content moves across them. For places inside one day use `reorder_day_assignments`. Requires `trips:write`. |
|
||||
| `set_day_default_transport_mode` | Set the whole-day default travel mode. Per-leg modes still override it. Pass `null` to clear. |
|
||||
| `assign_place_to_day` | Pin a place to a specific day in the itinerary. Requires `places:write`. |
|
||||
|
||||
@@ -49,7 +49,8 @@ Both are membership-checked against the current user — same gate as `ctx.trips
|
||||
const place = await ctx.places.create(tripId, { name: 'Teamlab', lat: 35.62, lng: 139.78 })
|
||||
const day = await ctx.days.create(tripId, { date: '2027-04-02', notes: 'Odaiba' })
|
||||
await ctx.itinerary.assign(tripId, day.id, place.id, 'buy tickets first')
|
||||
// days.create reads { date?, notes? } and always appends at the end — a position is honoured on the REST route only, not on the plugin path.
|
||||
// days.create reads { date?, notes?, dated? } and appends at the end; a position is honoured on the REST route only, not on the plugin path.
|
||||
// { dated: true } instead adds the day after the trip's last date and extends the trip to it.
|
||||
// Set a day title later with ctx.days.update(tripId, day.id, { title: 'Odaiba' }).
|
||||
```
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ parser would ignore one if you added it.
|
||||
| `ctx.trips.update(tripId, fields)` | update trip fields (title/dates/currency/reminder_days/…) | `db:write:trips` |
|
||||
| `ctx.trips.create(input)` | create a **new trip owned by the acting user** (importers) — `title` required, plus `description?`/`start_date?`/`end_date?`/`currency?`/`reminder_days?`/`day_count?`; without `currency` the trip takes the acting user's display currency, then the instance default, then EUR | `db:create:trips` (+ `trip_create`) |
|
||||
| `ctx.places` | `create(tripId, fields)` / `update(tripId, placeId, fields)` / `delete(tripId, placeId)` | `db:write:places` |
|
||||
| `ctx.days` | `create(tripId, {date?, notes?})` / `update(tripId, dayId, {notes?, title?})` / `delete(tripId, dayId)` | `db:write:days` |
|
||||
| `ctx.days` | `create(tripId, {date?, notes?, dated?})` / `update(tripId, dayId, {notes?, title?})` / `delete(tripId, dayId)`. `dated: true` adds the calendar day after the trip's last date and extends the trip to it, on a trip with dates only and never next to `date`. `delete` works as in the planner (see [Deleting a day](Day-Plans-and-Notes#deleting-a-day)) and refuses the last day of a trip with `BAD_PARAMS` | `db:write:days` |
|
||||
| `ctx.itinerary` | `assign(tripId, dayId, placeId, notes?)` / `unassign(tripId, assignmentId)` — place↔day | `db:write:itinerary` |
|
||||
| `ctx.meta` | `get` / `set` / `list` / `delete` your **own** namespaced data on a `trip`/`place`/`day`/`reservation`/`accommodation` (enrich core entities without forking the schema) | `db:meta` |
|
||||
| `ctx.packing` | `list(tripId)` — a trip's packing items (membership-checked, respects private-item visibility) | `db:read:packing` |
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ Two sections come back at trip level rather than on a day, because that is where
|
||||
| Field | Comes with | What it is |
|
||||
|---|---|---|
|
||||
| `unplanned_places` | `places` | places collected but not scheduled yet. On a real instance these are routinely **half** of a trip's places, and they carry coordinates. A hotel is not listed here; it is under `accommodations`. |
|
||||
| `unscheduled_reservations` | `reservations` | bookings with no day. Deleting a day detaches its bookings rather than deleting them, so these exist in the wild. |
|
||||
| `unscheduled_reservations` | `reservations` | bookings with no day. Deleting a day or shortening a trip detaches the bookings on the days that go rather than deleting them, so these exist in the wild. |
|
||||
|
||||
Asking for `places`, `notes` or `reservations` brings `days` along automatically, since that is where they are reported. `?include=notes` returns the day skeleton with its notes and empty place lists, not an empty trip.
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ On screens narrower than 768 px, TREK does not squeeze the three-pane layout —
|
||||
|
||||
The planner tracks your recent actions — adding places, assigning them to days, reordering, and removing assignments — in a short undo ring. The **Undo** button sits in the Day Plan Sidebar toolbar (at the top of the sidebar); it is greyed out until an undoable action is available. It shows the name of the last action as a tooltip on hover and reverses it when clicked.
|
||||
|
||||
Deleting a day is not in the ring. The question before the delete lists what goes with the day instead; see [Deleting a day](Day-Plans-and-Notes#deleting-a-day). An earlier reorder of the days can still be undone afterwards, minus the day that is gone.
|
||||
|
||||
## Splash Screen
|
||||
|
||||
When you first open a trip, a brief loading screen appears while the planner data and place photos are fetched. This screen shows the trip title and a loading animation. Once data is ready and a short grace period for photos has elapsed, the planner workspace appears.
|
||||
|
||||
Reference in New Issue
Block a user