Commit Graph

5571 Commits

Author SHA1 Message Date
Maurice 4d01439c75 test(server): type the created transport in the legs-only seat test
Server lint was red: the new MCP test cast its result to any, one no-explicit-any warning over the tests baseline.
2026-11-21 15:29:53 +01:00
Maurice adb6a2c80d fix(planner): show each leg's own seat on a flight with a stop
A flight with a stop saves a seat per leg, but every view read the
booking's flat seat, which mirrors the first leg's. A seat booked only on
the second leg showed nowhere, and one on the first leg showed on both.
#2701 had fixed this for trains only.

- getFlightLegs reads each leg's seat. The first leg falls back to the flat
  seat, as the booking form does, so older bookings keep theirs.
- bookingSeats lists the seat of every leg that has one with its route.
  The detail views (the phone's transport sheet, the booking detail) show
  each leg's seat under its route ("Seat IST → JFK"), and a leg opened
  from its row shows its own. The cards and field grids (bookings list,
  the phone's Bookings and Transports tabs, the day plan's transport
  detail) hold every seat in one Seat cell, so a card cutting its grid
  short no longer drops the second leg's.
- The day plan's flight leg rows carry their seat, and the PDF prints a
  flight's seat, direct or per leg.
- The watch and the Wallet pass name every leg's seat of the booking.
- A legs-only MCP update sets the flat seat, airline and flight number
  (train number and platform) again from the new first leg, so a seat
  taken off the first leg does not live on in the flat seat. A flat value
  the stored first leg never had stays.

Closes #3158
2026-11-21 15:24:52 +01:00
Maurice 1824cc77ec fix(ci): bring the per-trip addon tests and ratchets in step
The second run of #3157 was red in six jobs:
- Server types: ReminderJobsService takes AddonsService now; RJOB-007 built
  it with five arguments.
- Server tests 2/10: the doc-sync job tests stubbed AddonsService without
  isEnabledForTrip, which the sync asks per trip now.
- Client tests 4/10: toursPermissions mocked useAuthStore as a bare
  selector; tripAddonsStore keys its lists by account through getState.
- Server lint (knip): TripAddonRow was exported without a reader outside
  its file.
- Client lint and Client types: no-unused-vars and the strict errors in
  useTripPlanner.ts went down by one, so their entries are lowered.
2026-11-21 14:00:02 +01:00
Maurice 9e2805fc89 chore(lint): lower the server no-unused-vars baseline to 34
Server lint was red: the per-trip addon change left one unused variable fewer in src, and the ratchet fails on an entry above the count.
2026-11-21 13:28:06 +01:00
Maurice 77380ea5cf docs(wiki): describe the trip settings' Addons area and its MCP tools 2026-11-21 13:23:09 +01:00
Maurice 9956c58dd5 feat(client): follow and switch a trip's own addons
- The trip's addon list is read through tripAddonsRepo into
  tripAddonsStore (per account and trip, kept in Dexie version 16 for
  offline), refreshed when the connection returns and live on
  tripAddons:changed.
- The planner's tabs, dock, rail and deep links, the cost, tour and list
  readers, the PDF export, the share link options, the widgets and the
  watch follow the trip instead of the instance switch.
- Trip settings gets an Addons area for the owner, on the desktop dialog
  and the phone sheet, on one useTripAddonRows hook: each trip addon with
  its switch, marked "This trip only" while it differs from the instance.
  Switching back to the instance's value drops the trip's choice.
  Switching needs a connection.
2026-11-21 13:23:09 +01:00
Maurice 3f38621024 feat(server): let a trip owner switch trip addons for one trip
A trip can now turn a trip addon (lists, costs, documents, collab, road
trip, tours) on or off for itself, whatever the instance switch says. No
row in the new trip_addon_overrides table means the trip follows the
instance; a row is the owner's choice. Going back to the instance setting
deletes the row, and no addon data is touched either way.

- GET/PUT /api/trips/:tripId/addons[/:addonId] (every member reads, the
  owner writes) and the MCP tools get_trip_addons and set_trip_addon, on
  the shared tripAddons contract; tripAddons:changed tells the members.
- Every trip-scoped addon surface asks the trip: REST through
  TripAddonGuard, MCP through a per-call gate on the named or pinned trip,
  plugin RPC and events, the share link, the offline bundle, reminders,
  doc sync, the assistant (tools, keep_attached_file), booking costs, the
  trip summary prompt, and the cross-trip tour reads (library, Atlas
  stats, collection save).
- Routes without a trip open while the addon is on in any of the user's
  trips. Switching an addon on that the instance has off ends the members'
  MCP sessions so they reconnect with its tools.
- A copied trip takes its owner's choices along.

Behaviour changes: an anonymous call to an addon route that is off now
gets 401 instead of 404, and with an instance switch off the packing,
todo and files plugin RPC methods, the files MCP tools, todo reminder
mails, core plugin events, plugin view contributions, the share link's
lists, costs and chat sections and the offline bundle's lists follow it.
2026-11-21 13:23:09 +01:00
Maurice 2f7b8357ce fix(server): schema-qualify the table the move asks Postgres for its sequence
Server Postgres 18 3/3 was red on dev: PGMOVENUL-007 failed with relation "information_schema_catalog_name" does not exist. readTargetSchema called pg_get_serial_sequence(format('%I', table_name), ...) over information_schema.columns, and Postgres does not promise to apply the table_schema filter first, so the call could see rows of information_schema itself, whose bare names do not resolve on the search path. The name now carries its schema, so the call answers for every row whatever the plan. The fake Postgres of the move tests matches the new text.
2026-11-21 11:30:06 +01:00
Maurice 6861687b1f fix(server): queue the backfill's updates instead of awaiting them in a loop
Server lint was red on dev: lint:warnings counted 557 no-await-in-loop warnings in src against a baseline of 556, from the UPDATE the new admin-made account backfill awaited per account. The updates are now queued with addSql, the way the Ireland counties migration queues its row writes, with the id checked to be an integer. The migration does the same as before; it has not shipped in a release.
2026-11-21 11:22:47 +01:00
Maurice 8fc9fe7945 fix(auth): mark an address an admin-made account changed itself, so SSO no longer links to it
The 5.0.0 backfill (Migration20200101042800) set email_self_asserted only for accounts whose address moved away from their user.register audit row. An account created in Admin > Users has only an admin.user_create row, so it kept 0 even when the account had changed its own address in its settings before the upgrade, and a verified SSO sign-in asserting that address was still linked into it.

A new migration applies the same rule with the address in the admin.user_create row as the baseline: an admin-made account whose address is none it was created or registered with, and whose email no admin edited, is marked. Only rows still at 0 are touched and nothing is cleared. The shipped migration stays as it is.
2026-11-21 11:12:34 +01:00
Maurice f668eee227 test(client): drop the two new non-null assertions in the addon card tests
Client lint was red: lint:warnings counted 1877 no-non-null-assertion warnings in tests against a baseline of 1875, both from closest('section')! in FE-ADMIN-ADDON-045 and 046. Cast to HTMLElement like the other card lookups in the file.
2026-11-21 10:59:35 +01:00
Maurice 711015d5fd feat(admin): live flight status, booking mail import and paddle water data as rows of the addon cards
The addons page listed the trip, global and integration addons and then three
loose cards under them: live flight status, the booking mail import and the
paddle water data. They now sit where they belong, as rows of the cards:

- Live flight status is a row of the trip card, with its switch, locked when
  FLIGHT_LIVE_ENABLED holds it.
- The booking mail import is a row of the integration card with its switch;
  while it is on, "Set up mail import" opens the transport, address, AI
  allowance, test and status in a dialog, the way AI is set up.
- The paddle water data are a row under the Tours addon that opens the
  regions in a dialog, counting the open requests, else the regions.

The phone follows with the same rows and bottom sheets. The setup row and the
setup dialog are shared components (AddonSetupRow, AddonSetupDialog on the
desktop, MAdminOptionRow and MAdminSetupRow on the phone), the card counts
stay the addons' own, and the settings tab loses its features part.
2026-11-21 00:23:13 +01:00
Maurice 6ebd5cf0c7 fix(mobile): a road trip stage draws only its own rides, not the drive's flight home
The phone's road trip tab shows one stage at a time, but its map drew the
arcs of every ride that seams the whole drive, plus every booking switched on
for any day. A flight home on the 12th then crossed the map of the stage on
the 9th, with its airport label, as if it were part of that day.

The stage now draws the rides that seam its own drive, whatever day they were
booked on, and of the bookings switched on by hand only those that run on the
stage's day. The all-days view and the desktop, which shows the whole drive,
are unchanged.
2026-11-20 23:00:52 +01:00
Maurice 8ab7547edf fix(calendar): a booking linked to a plan stop gets its zone and is exported once
The calendar feed and the .ics export wrote a restaurant booking linked to a
plan stop twice, and the booking's copy without a time zone:

- The zone of a booking came only from its own place. A booking whose place
  is its linked stop (reservations.assignment_id) had none, so its DTSTART and
  DTEND went out as floating times and calendar apps placed them in the
  device's zone, an hour early for a London lunch read in Paris. The zone now
  comes from the booking's place, then its linked stop's place, then the zone
  all stops of its day or of the trip agree on. Transports keep their
  endpoint zones and still float when those are unknown, since either end can
  be in another zone.
- The stop and its booking were both emitted (trek-assign-<id> and
  trek-res-<id>). As for hotels, a stop whose booking yields a timed event on
  the same day is no longer emitted on its own; the booking event takes over
  the stop's place as LOCATION, its notes and, when it has none, its end. A
  booking without a clock, on another day, or still staged leaves the stop as
  it was, so no event is lost.

The VTIMEZONE builder moved unchanged into calendar-timezones.helpers.ts to
keep the service under the size cap.

Closes #3150
2026-11-20 22:19:11 +01:00
Maurice f599892a4b test(server): delete the tracked uploads together, not one await per loop turn 2026-11-20 21:49:40 +01:00
Maurice 1436cec35c test(server): suites remove only the uploads they stored, not whole shared folders
files, security, collections, journey and trips cleaned up by removing a whole
uploads category folder (uploads/files, covers, places, journey). Every suite
that boots the app writes into the same uploads tree, and on the Postgres lane
several run at once, so that removal took the files of the suite running
beside it: ATTE2E-008 then failed with "storage object not found" for its
attached file.

A small helper wraps StorageService.put on the app's instance, records what
the suite stores and deletes exactly that afterwards. The journey upload tests
that counted the files in uploads/journey (and so also counted what another
suite wrote there) now check that every object they stored is gone again.
2026-11-20 21:45:05 +01:00
Maurice fe90502955 fix(mobile): show stay names whole in the day card's chip strip
The stay chips in the day card's header shrank to fit beside the day pill and
the weather, so a name could end after one or two letters (H..., Br...). They
now keep their size and show the whole name; the strip scrolls sideways
instead, with its ends fading while more waits behind them.
2026-11-20 19:29:57 +01:00
Maurice 0431741ad7 fix(widgets): size the timeline's time column to the longest time shown
The day timeline in the trip widgets gave every time a fixed 38 pt column,
enough for 09:30 but not for a 12-hour clock: 5:45 AM was cut to 5:4... at
every widget size. The column now takes the width of the longest visible time
(and the now marker's label), at least the old 38 pt, so the dots still stand
in one line.
2026-11-20 19:29:56 +01:00
Maurice fa99940945 test(platform): a share-token photo whose copy fails to build is a 404 2026-11-20 19:15:48 +01:00
Maurice 09316025c3 test(share): sweep tests in the thumbnail job, tx and strict baselines follow the resolver split 2026-11-20 18:33:42 +01:00
Maurice 100313cfa9 fix(share): compare the pending rendition build with undefined 2026-11-20 18:23:20 +01:00
Maurice 411ec4af59 fix(share): keep private data and photo locations out of public trip and journey links
Public trip and journey share links handed out more than the owner chose to
share:

- A travel-only trip link still returned every day's title, and every link with
  the map returned the free-text day notes the shared page never shows. Days now
  go out through a public projection without notes, and travel-only links carry
  no day titles. Day notes, packing, budget and chat use explicit field lists
  too, and the category list holds only the categories the shared places use,
  without creator ids.
- The public journey payload spread whole entry and photo rows, including
  storage keys (file_path, thumbnail_path) and internal fields. It is now built
  from allow-lists and pinned by a strict response contract.
- /uploads/journey served every entry photo, original and video to anyone who
  knew the file name, so a URL kept working after a share link was revoked or
  the gallery switched off. It now serves journey covers and other non-entry
  objects only; entry media go through the token-checked proxy.
- Anonymous byte paths served stored originals unchanged, so EXIF GPS left the
  server even with map sharing off. Every public path (journey share proxy,
  covers, trip share photos, public uploads) now sends a copy with location
  data blanked in place (EXIF GPS, XMP and IPTC location, MP4/MOV location
  atoms), falling back to a metadata-free re-encode or a 404, never the raw
  file. Owners and members still get their originals.
- An entry's visibility field never decided the share link but was offered by
  MCP and the assistant as if it did. It is now documented as having no effect
  and no longer shown as a privacy label; is_draft keeps an entry off the link.
2026-11-20 18:18:50 +01:00
Maurice ec7f5e0585 test(atlas): cache the test places' regions in one go rather than an awaited loop 2026-11-19 22:11:29 +01:00
Maurice 8e38749bc3 fix(transit): show every stop name and each ride's arrival in the folded-out itinerary
The same gap as on the phone (#3139) in the desktop day plan's folded-out
transit row and the assistant's transit card: each ride cut its stop names
to one line and showed only its departure, and a walk cut its target. The
names and the walk target now wrap, and each ride shows its arrival under
its departure. The phone's booking sheet lets the route line under its
title wrap too.
2026-11-19 21:57:28 +01:00
Maurice 2c17edd74c docs(docker): the entrypoint drops to node with setpriv, say so beside its copy 2026-11-19 21:57:28 +01:00
Maurice c5e2afc21b fix(atlas): count places and cities the same way on the Atlas page and in the stats API
The Atlas page showed 100 cities and 169 places where GET /api/v1/stats
and the dashboard's passport card showed 66 and 164 for the same account.
The two sides counted with their own code. The Atlas page took the address
part right before the country as the city, which is often the region
(Bavaria for Munich, Nuremberg and Regensburg alike), and counted a bare
place name with no comma as a city. The stats side read its places with a
DISTINCT over address, coordinates and region only, so two places that
looked alike (the same hotel on two trips, places with neither address nor
coordinates) counted once, and its city reader skipped every address part
with a digit, so "10178 Berlin" never counted as Berlin.

Both now take places and cities from one method: every place counts once,
a city is read with cityFromAddress, which skips the region (#1115) and now
reads a city written beside its postcode (German, French, US, Japanese,
Dutch, British and Canadian forms) while a street with its house number
still does not count, and two spellings that differ only in case are one
city. The Atlas page, the passport card, /api/v1/stats and the MCP atlas
tool follow it. The response shapes are unchanged.

Closes #3137
2026-11-19 21:57:28 +01:00
Maurice 502e6916d9 fix(docker): start under rootful Podman on hosts that block gosu's signals
Started as root, the entrypoint dropped to the node user with gosu. gosu is
a Go program, and Go changes a process's ids by sending every runtime thread
a realtime signal and spinning until each one has answered, with no limit.
On a host whose security module drops that signal inside the container
(AppArmor on recent Ubuntu, under rootful Podman) gosu spun at full CPU
forever, before Node printed a line: no logs, no database, port 3000 never
served. Running as uid 1000 worked only because that path skips gosu.

The entrypoint now drops privileges with setpriv from util-linux, which is
already in the image: single-threaded C that makes the same id changes
without any signal. Node still runs as uid and gid 1000 with no
capabilities and HOME=/home/node. gosu stays in the image for anyone who
calls it by hand.

Closes #3135
2026-11-19 21:57:28 +01:00
Maurice 61674cf918 fix(transit): show every stop name and each ride's arrival in the journey details
The expanded transit card on the phone cut a ride's "from -> to" line to
one line, so a long first stop pushed the destination out of sight, and
it showed only the departure of each ride. The phone's booking sheet and
the desktop leg list (booking dialog, booking card, journey modal) cut
the stop names and the sheet title the same way.

The detail views now let stop names, walk targets and the booking title
wrap instead of truncating, and the expanded card shows each ride's
arrival time under its departure. The collapsed card still shortens its
headline, since expanding it shows everything.

Closes #3139
2026-11-19 21:57:28 +01:00
Maurice ac01925be7 fix(mobile): show a place's full name in its details sheet
The details sheet cut the place name to one line, and nothing in the
sheet showed the rest; only the edit form did. The sheet is where a
place is read in full, so the name now wraps onto as many lines as it
needs, as the desktop inspector already does. The address under it
wrapped before and still does.

Closes #3140
2026-11-19 21:57:28 +01:00
Maurice 99465d04de fix(mobile): the add-place button of the stay sheet takes the caption size
It uses the planner's add-place label, which no view named before, so the
unused-key baseline of planner.ts drops by one.
v5.1.4-tf.1
2026-11-19 21:41:54 +01:00
Maurice 73a7c4843b fix(mobile): a stay can be added to a trip that has no place yet
A stay belongs to one of the trip's places, so on a new trip the
accommodation sheet only said "Add places to your trip first", and the
booking could not be saved without leaving the sheet (TestFlight feedback,
5.1.3). The hint now carries the "Add place/activity" button for anyone
allowed to add places: the place form opens over the sheet, and the place
is listed to pick once it is saved.
2026-11-19 21:31:46 +01:00
Maurice 6e919696bb fix(native): a tap beside a field closes the keyboard
The app hides the keyboard's bar with its "done" button, and a textarea
keeps its return key for new lines, so after typing a note in the place
editor nothing closed the keyboard and it covered the rest of the sheet,
times and Save included (TestFlight feedback, 5.1.3). A tap away from the
focused field now lets go of the focus. A scroll keeps the keyboard open,
and a tap on another field moves the focus there.
2026-11-19 21:27:54 +01:00
Maurice d32cfb3635 fix(native): give the Apple Watch app icon a light background
watchOS crops the icon to a circle on a black face, so the black icon did
not read as a circle at all (App Review, guideline 4). The mark now sits
dark on a light grey ground, drawn from the same master silhouette.
2026-11-19 21:26:38 +01:00
Maurice 31c9f40550 fix(native): App Review builds can buy TREK Cloud while orders are closed
While TREK Cloud's orders are closed, the plan picker on iOS offers the
subscriptions only to builds that buy in the App Store sandbox (TestFlight,
App Review, Xcode). That was read from the receipt's file name alone, which
App Review's build did not carry: the reviewer saw "TREK Cloud opens soon"
and no way to buy, and the app was rejected under 2.1(b) because its
in-app purchases could not be found.

The environment now comes from the signed app transaction (StoreKit 2, iOS
16 and later), with the receipt's file name as the fallback on iOS 15 or
when the app transaction cannot be read. A production build still sees the
plans without a buy button until orders open, and the cloud refuses a
production purchase before the opening as before.
2026-11-19 21:26:38 +01:00
Maurice 7ae4dcba51 fix(db): sort the Postgres move's names with an explicit code-unit compare
Five sorts in the Postgres bootstrap and the move from SQLite relied on the
default sort, which SonarCloud reports as a bug because it compares by code
unit implicitly. They order migration names, table names and JSON keys for a
checksum, where locale-aware ordering would change the result, so each now
names the code-unit compare the default already used. Nothing changes.
2026-11-18 23:58:20 +01:00
Maurice daa4e1dfcf test(planner): an older place lookup that answers last does not replace the newer results 2026-11-18 23:30:37 +01:00
Raz Erlich 9a7bce6fd8 fix(planner): scope transit picks by day and rank other stays by date 2026-11-18 23:30:36 +01:00
Maurice 0834d4f8fe docs(airtrail): name the API key scopes AirTrail 3.13 checks 2026-11-18 23:17:47 +01:00
Maurice d8c28c9998 fix(airtrail): read the v1 answers at the boundary and refuse an arrival before the departure
The v1 bodies were cast to their types unchecked, so a flight page whose data
was not a list, or a passenger list of another shape, failed deeper down as a
TypeError instead of an AirTrail request error. Each v1 answer (a flight, a
page of flights, a created flight, a reference lookup, the key owner) is now
read through a small schema that keeps the fields TREK does not need lenient.

The legacy save refuses an arrival before the departure; the v1 body passed
it on, so an overnight arrival time without its date would have been stored
before the departure. The v1 write-back now refuses it with the same message.
2026-11-18 23:17:27 +01:00
aaronspruit 76ff6e15b1 feat(airtrail): use the AirTrail /api/v1 routes, and keep the legacy routes
AirTrail 3.13 adds /api/v1 and marks the /api/flight/* routes as
deprecated. TREK now asks the public discovery document GET /api/v1
and uses v1 when the instance has it. It uses the legacy routes for
an older instance. The client methods keep their signatures, and the
sync hash stays the same, so a linked flight does not sync again
when an instance changes to v1.

The probe cache holds only a clear answer: 200 with the discovery
document gives v1, and 404 gives legacy. The cache is per AirTrail
URL, for 10 minutes. A timeout, a 5xx or a network error fails that
call only. A 401, a 403 or a page that is not the discovery document
uses legacy for that call only. A 404 for one flight makes the client
ask the probe again before it reports the flight as deleted.

A missing scope gives AirtrailScopeError, which names the scope. It
does not unlink a flight. The API key hint and the help step list
the scopes for read and for write-back, in all languages.

Each new request goes through safeFetch, with the SSRF guard, the
timeout and the size cap. The flight list reads pages of 100 and
fails above 50 pages. A failed list unlinks nothing.

airtrail-v1.ts translates between the v1 shapes and the legacy
shapes. A write-back looks up the airport, airline and aircraft ids,
and changes each local time to a UTC instant in the zone of its own
airport. It writes each instant in the +00:00 form of the legacy
save, because AirTrail stores the string as it gets it and the sync
hash reads that string.

The tests cover both APIs over HTTP, the probe cache rules, the sync
hash on a switch and on a save, the page limit, the scope error, and
the UTC conversion across midnight, the date line and daylight-saving
changes.
2026-11-18 23:07:35 +01:00
Maurice 3e0a2ef8ed fix(native): widgets turn to the next trip day by themselves
TestFlight feedback: during a trip the widgets stayed on day 1 until the app
was opened again. The app wrote only today's day into the widget snapshot,
and only while it ran, so every timeline entry after midnight still showed
the day it last ran, with its stops all ahead again.

The snapshot now also carries the trip's days from today on (a month at
most, sixteen stops a day), each with its date. On iOS every timeline entry
takes the day of its own date, so the quarter-hour entry at midnight turns
the widget to the next day, and the bookings list drops the days behind; the
Android widgets do the same on each update. A snapshot from an app without
the days reads as it was written, and an older app binary ignores them.
2026-11-18 22:21:26 +01:00
Maurice fd35f79c36 fix(mobile): keep every screen clear of an iPhone Duo's status capsule
TestFlight feedback: on an iPhone Duo the status capsule in the top right
corner covered the trip's controls, its day chips, the map's category bar and
the first cards of every trip tab, upright and on its side. The app has
measured the capsule since 0f42b8b8a, but only the shell's own bars and page
used it, and the trip, its map and the sheets place their own controls.

- Upright, a control row in the capsule's height stands beside it and the
  content starts below it: the trip's top row and day chips, the map's
  category bar, the road trip's stage bar, every trip tab's first row, the
  places browser, the plan timeline, docked and card sheets, the assistant,
  the account menu, the image viewer's close button, the atlas search,
  vacay's header and a journey's content and map controls.
- On a wide window the page gives up the capsule's side over the whole
  height instead, as an iPhone on its side does for its camera: lifting each
  page below the capsule cost a quarter of the height of an unfolded Duo.
  The list tabs, the assistant panel and the form sheets end before it too.
- Screens whose first row is part of the page (settings, administration,
  collections) are lifted until that row is below the capsule; screens that
  keep clear of it by themselves (atlas, vacay, a journey) are not lifted.
- Right to left the rail stands on the capsule's side and takes it.

All of it reads the corner variables the app publishes, which are 0 on every
other device and before iOS 26, so nothing else moves. The rules for the
screens that place their own controls live in mobile/corner.css.
2026-11-18 21:23:14 +01:00
Maurice 294a386d23 fix(planner): take a ?tab=, ?day= or ?assistant= link once per URL
React Router lands the URL without the link as a transition. Until it does,
every render still read the link, and the tab link took it again on each of
them: selectTab is a new function per render and onLinked sets state, so a
notification's ?tab= link rendered the planner into React's update limit and
the route's error page replaced the trip on an iPad or an unfolded foldable.
Both link hooks now take a link once per URL and wait for the cleaned one;
the same link in a new URL is taken again.
2026-11-18 21:23:03 +01:00
Maurice ee79413653 fix(mobile): keep the navigation rail's list ref stable
The rail's list ref was an inline function that set state. React 19 detaches
and re-attaches a ref whose function changed, so every commit set the list to
null and back and asked for one more render of the rail. The ref is one
function for the rail's lifetime now.
2026-11-18 21:23:03 +01:00
Maurice ec08915a16 fix(trips): a day added before the start leaves the plan on its dates
Adding a day before a trip's start with "Keep bookings on their dates"
moved almost everything a day earlier and emptied the last day. The day
grid was always rebuilt by position: the n-th day row took the n-th date
of the new range. With bookings kept on their dates, only timed bookings
and stays were re-anchored afterwards. Places, day notes, bookings with no
time and a booking's place in a day's order stayed on their re-dated rows
and slid to the day before. Days added at both ends had the same problem.

planDayGrid now takes keepDates. When the new range still holds every
dated day, each of them keeps its date and the new days go around them.
The server passes it unless the traveller chose to shift everything, and
the trip dialog's warning check uses the same rule. A moved or shorter
range still follows the positional rule the dialog describes, and "Shift
everything" still moves the whole plan with the new start.

Two things keyed outside the day rows followed the old rule. Road trip day
boundaries are keyed by day number, so a new first day left each one on
the day before its own. They now follow their days to their new numbers
and go out to every screen. The owner's leave days moved by the change of
start even when days were only added. They now move by as far as the
trip's first day moved, which is nothing when days are only added. The
help text of the option and the MCP description say what happens when
days are added.

Closes #3119
2026-11-18 17:14:38 +01:00
Maurice 40f9c020bb fix(bookings): show the calendar date beside transport times
Tapping a transport in the compact Transports or Bookings list on the phone
opens the transport sheet, and its time boxes showed only the clock time. The
sheet named a date only in its subline, and only for a booking with no route
and no airline or number, so a flight or ferry could not be placed on a day
without unfolding the whole list. A transport holding only times (its date
lives on the linked trip day) had no date at all, and the desktop transport
detail dialog had the same gap: it read the date off reservation_time alone
and never named the arrival day of an overnight trip.

The dates now come from one helper, bookingDates(), which reads the booking's
own date, then the stop's local date, then the linked day's date, the rule
bookingFacts already used and now shares. The phone sheet prints the date
above each time (a leg opened from its row uses its own days); when no time
box carries a date, because no time is entered yet or the live flight card
stands in their place, the subline names the day instead. The desktop dialog
names the day, or both days of an overnight trip in reading order, in the
user's locale.

Closes #3122
2026-11-18 16:52:18 +01:00
Maurice 684a3bf5f5 fix(roadtrip): draw the drive between connected days in the arrival day's colour
With "Connect the days" and "A colour per day" on, the drive from one day's
last stop to the next day's first stop was coloured as the day it left. A stop
reached after midnight was handled the same way: the line into it kept the
colour of the day it came from. The road trip panel counts both drives toward
the arriving day (its distance includes them, and the setting's hint says
connecting drives count toward the arrival day). So the map showed the drive
under one day while the panel counted it under the other. This also happened
with daily travel times set to end the day at the last place, whenever the
schedule could not be kept (a drive longer than the window) and the days were
drawn as stored.

assembleRoadtrip now puts every line drawn into a day under that day's
number, the day whose figures count it, and still marks it as a join, so the
one-day stage view still leaves it off. Every map takes its day colours
from this list: desktop Leaflet and Mapbox GL, the phone map and its stage
view. The client tests that pinned the old colouring and the old join order
now expect the new ones.

Closes #3123
2026-11-18 16:52:17 +01:00
Maurice 26122a4208 ci(test): mirror the dev push run on the release pull request
Every push to dev started test.yml twice for the same commit: the push
run on dev and the pull_request run of the open release PR into main.
Together about 72 long jobs exceeded the 60 organisation slots, so jobs
queued and ci-ok landed minutes later.

On a pull request from dev into main (head in this repository) the
changes job now sets mirror and turns every area off
(scripts/ci/changed-areas.mjs), so no gate, test, coverage or scan job
runs. ci-ok keeps its needs verdict and then runs
scripts/ci/mirror-push-run.mjs, which waits for the ci-ok of the push
run of test.yml on dev for exactly the PR head commit and passes or
fails with it. A missing push run, one that ended without a verdict,
an API that keeps failing or a wait past 17 minutes fails with a
re-run hint. ci-ok reads with actions, checks and contents only, and
its timeout rises to 20 minutes.

A push to dev now lists its changes against the merge base with main
instead of the previous push, so the run the mirror copies covers
every area the release pull request brings in, also when an earlier
push's run was cancelled or red.

The release workflows keep reading the newest ci-ok on a commit. A
green mirror implies a green push ci-ok before it; a mirror that fails
on its own blocks a release until it is re-run.
2026-11-18 16:18:46 +01:00
Maurice 9dc80760f7 feat(server): name the database in the start banner
The move guide tells the operator to check that the log reports the Postgres engine, but the start banner never said which database the process runs on. It now carries a Database line with the engine's own description: the SQLite file, or the Postgres URL with its password masked. The guide's check and the manual checklist point at that line.
2026-11-18 15:43:26 +01:00
Maurice 090db8519d docs(postgres): document the volume path per major and what the move carries over
The compose pages name postgres:18, list the volume path for 18 and for 14
to 17, and say that changing a database's major needs pg_upgrade or a
backup and restore. The move steps say to carry the install's own
environment variables, container name and port over, and to append the
passwords and COMPOSE_FILE to the existing .env instead of replacing it,
so later plain docker compose commands, the ones in Updating included, keep
using the Postgres file instead of starting TREK on the old travel.db. The
pages also say which data is lost to an anonymous volume, which compose
service waits for the database, what tables that differ from the Postgres
schema mean, and how to recover from a first start without a password.
2026-11-18 15:22:52 +01:00