The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
feat(help): guides for what TREK talks to, and a seed that follows the day
Maurice41851429c9b9
diff --git a/client/.gitignore b/client/.gitignoreindex 2530b230e..63f406cb5 100644--- a/client/.gitignore+++ b/client/.gitignore@@ -6,3 +6,4 @@ playwright/.cache/# vite-plugin-pwa dev output (devOptions.enabled)dev-dist/+e2e/help/media.envdiff --git a/client/e2e/dates.ts b/client/e2e/dates.tsnew file mode 100644index 000000000..b3a57dc61--- /dev/null+++ b/client/e2e/dates.ts@@ -0,0 +1,114 @@+/**+ * The run's calendar.+ *+ * The seeded trip ends on the day the pictures are taken, and every other+ * date the seed, the fixtures and the guides use is an offset from that day.+ * So a run on any date meets a trip that is running, with a last day that is+ * today: the boarding pass, What's Next and the forecast all have something+ * to show, and nobody has to bump dates in three files every few weeks.+ *+ * The day is `E2E_PICTURE_DAY` (YYYY-MM-DD), set once by `e2e/help/run.mjs`+ * and `playwright.config.ts` so the seed project and every worker agree even+ * when the run crosses midnight; without it, today in the machine's zone.+ */++const ISO_DAY = /^\d{4}-\d{2}-\d{2}$/++function localToday(): string {+ const d = new Date()+ const pad = (n: number) => String(n).padStart(2, '0')+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`+}++const fromEnv = process.env.E2E_PICTURE_DAY+if (fromEnv && !ISO_DAY.test(fromEnv)) throw new Error(`E2E_PICTURE_DAY must be YYYY-MM-DD, got "${fromEnv}"`)++/** The picture day as YYYY-MM-DD: the trip's last day. */+export const PICTURE_DAY_ISO: string = fromEnv || localToday()++/** Noon UTC on the picture day, a safe anchor for calendar arithmetic. */+function anchor(offset: number): Date {+ const d = new Date(`${PICTURE_DAY_ISO}T12:00:00Z`)+ d.setUTCDate(d.getUTCDate() + offset)+ return d+}++/** `YYYY-MM-DD` of the picture day plus `offset` days. */+export function day(offset: number): string {+ return anchor(offset).toISOString().slice(0, 10)+}++/** `YYYY-MM-DDTHH:mm:00`, the shape reservations and expenses take. */+export function at(offset: number, hhmm: string): string {+ return `${day(offset)}T${hhmm}:00`+}++/** The calendar year of the picture day plus `years`. */+export function year(years = 0): number {+ return anchor(0).getUTCFullYear() + years+}++/** A day `months` months after the picture day, on the given day of the month. */+export function monthsAhead(months: number, dayOfMonth: number): string {+ const d = anchor(0)+ d.setUTCDate(1)+ d.setUTCMonth(d.getUTCMonth() + months)+ d.setUTCDate(dayOfMonth)+ return d.toISOString().slice(0, 10)+}++const en = (opts: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat('en-US', { timeZone: 'UTC', ...opts })++// The labels the English UI prints for a date, for the guides that have to+// find a button by its calendar text.++/** `Sat, Sep 12`, the day filter's chip. */+export function short(offset: number): string {+ return en({ weekday: 'short', month: 'short', day: 'numeric' }).format(anchor(offset))+}++/** `Saturday, September 12`, the day filter's long form. */+export function long(offset: number): string {+ return en({ weekday: 'long', month: 'long', day: 'numeric' }).format(anchor(offset))+}++/** `September 25, 2026`, a date picker's cell label. */+export function pickerLabel(offset: number): string {+ return pickerLabelOn(day(offset))+}++/** The same label for any `YYYY-MM-DD`, e.g. one from `monthsAhead`. */+export function pickerLabelOn(iso: string): string {+ return en({ month: 'long', day: 'numeric', year: 'numeric' }).format(new Date(`${iso}T12:00:00Z`))+}++/** `October`: the English name of the month `months` months after the picture day's. */+export function monthName(months: number): string {+ return en({ month: 'long' }).format(new Date(`${monthsAhead(months, 1)}T12:00:00Z`))+}++/** `19.09.2026`, what a date input takes when typed. */+export function dotted(offset: number): string {+ const [y, m, d] = day(offset).split('-')+ return `${d}.${m}.${y}`+}++/** `13th`, for prose that names a day of the month. */+export function ordinal(offset: number): string {+ const n = anchor(offset).getUTCDate()+ const suffix = n % 10 === 1 && n !== 11 ? 'st' : n % 10 === 2 && n !== 12 ? 'nd' : n % 10 === 3 && n !== 13 ? 'rd' : 'th'+ return `${n}${suffix}`+}++/** `Wednesday 16 September 2026`, the date line of a booking mail. */+export function emlDate(offset: number): string {+ return en({ weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }).format(anchor(offset)).replace(/,/g, '')+}++/** `Tue, 1 Sep 2026 09:12:00 +0900`, an RFC 2822 mail header for a fixed offset. */+export function mailHeaderDate(offset: number, hhmm: string, tz: string): string {+ const d = anchor(offset)+ const weekday = en({ weekday: 'short' }).format(d)+ const month = en({ month: 'short' }).format(d)+ return `${weekday}, ${d.getUTCDate()} ${month} ${d.getUTCFullYear()} ${hhmm}:00 ${tz}`+}diff --git a/client/e2e/help/README.md b/client/e2e/help/README.mdindex d004ef41b..633bf1790 100644--- a/client/e2e/help/README.md+++ b/client/e2e/help/README.md@@ -53,5 +53,39 @@ change the theme, the language or the zoom for a picture.tree once (`page.locator('body').ariaSnapshot()`) instead of guessing locators.- A plugin installed by a run lives in `server/data/plugins/`; the dev serverimports it on its next restart. Guides that install one uninstall it in `cleanup`.-- The trip is running on the seed's dates: the plan opens on today's (empty) day;- `openTrip` in `trip-shared.ts` selects day 1 and closes its details panel.+- The trip's last day is the run day by construction (`e2e/dates.ts`: every+ seeded date is an offset from `E2E_PICTURE_DAY`, which `run.mjs` fixes to today+ once for the whole run), so the plan opens on today, the trip's last and empty+ day; `openTrip` in `trip-shared.ts` selects day 1 and closes its details panel.+ A guide that has to find a date by its label builds it with the same helpers+ (`short`, `long`, `pickerLabel`, `dotted`) instead of writing a calendar date.++## The guides that show another service++A few guides picture TREK talking to something outside it: AirTrail (flights+into the Transports tab), Dawarich (the recorded route on the map, countries+and wishes in the Atlas), a document store (Nextcloud on the Files tab) and the+booking extractor (confirmations into Bookings and Transports). Their fixtures+in `external.ts` fill each service themselves through its API, so the pictures+do not depend on what happens to be in it; they need its address and key from+`e2e/help/media.env` (copy `media.env.example`, not committed). Without the+file those guides fail loudly at their first step and every other guide runs+as before.++- Every address has to be the machine's LAN address: the server's SSRF guard+ refuses loopback whatever `ALLOW_INTERNAL_NETWORK` says, and that flag has to+ be `true` in the same file for a private network to be reachable at all.+- AirTrail: any instance with one user and an API key from Settings > Security.+ The fixture puts four flights into that account.+- Dawarich: any 1.15 instance with a user and their API key; add the LAN address+ to its `APPLICATION_HOSTS`, and give it a reverse geocoder (Nominatim works)+ or the Atlas dialog finds no countries. The fixture uploads a synthetic+ recording of the trip and of the year before it (`dawarich-track.ts`).+- Nextcloud: an app password. The fixture keeps a folder under `/Reisen` with+ two documents, and the guide binds the trip to it.+- The extractor: `KITINERARY_EXTRACTOR_PATH` must point at a program the+ server can run with one file argument. On Linux that is the package's binary+ (`libkitinerary-bin`); on Windows, a small executable that runs it inside the+ TREK Docker image (`docker run --rm -v <dir>:/in:ro --entrypoint+ /usr/local/bin/kitinerary-extractor <image> /in/<file>`) and answers+ `--version` by itself.diff --git a/client/e2e/help/admin.guide.ts b/client/e2e/help/admin.guide.tsindex 81267e54a..dca606942 100644--- a/client/e2e/help/admin.guide.ts+++ b/client/e2e/help/admin.guide.ts@@ -2,6 +2,7 @@ import { test, expect, type Page, type Locator } from '@playwright/test'import { clearNotices } from '../screenshots/shot'import { captureGuide, captureHero, dismissReleaseNotice, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'import { ensureAdminFixtures, pluginPackage } from './fixtures'+import { toggleAddon } from './external'import { adminContext, adminTabContexts, adminGuides } from '../../src/help/contexts/admin'import type { HelpGuide } from '../../src/help/types'@@ -359,6 +360,26 @@ const SCRIPTS: Record<string, GuideScript> = {only(p => tile(p, 'Lists')),],},+ 'document-providers': {+ guide: guide('document-providers'),+ start: opener('admin-addons'),+ steps: [+ // The tile with its shelf: Documents is on in the seed, so the five rows are drawn.+ only(p => tile(p, 'Documents')),+ {+ // The row's switch is a ToggleSwitch whose aria-label is the row's title.+ target: p => tile(p, 'Documents').getByRole('button', { name: 'Nextcloud', exact: true }),+ act: async p => {+ const toggle = tile(p, 'Documents').getByRole('button', { name: 'Nextcloud', exact: true })+ await toggle.click()+ await expect(toggle).toHaveAttribute('aria-pressed', 'true', { timeout: 10_000 })+ await settle(p)+ },+ },+ ],+ // Back to the seed, where every store is off; the files run switches this one on for itself.+ cleanup: p => toggleAddon(p.request, 'nextcloud', false),+ },// ── Plugins ──────────────────────────────────────────────────────────────'install-plugin': {diff --git a/client/e2e/help/atlas.guide.ts b/client/e2e/help/atlas.guide.tsindex ce31292a4..cbb283452 100644--- a/client/e2e/help/atlas.guide.ts+++ b/client/e2e/help/atlas.guide.ts@@ -1,7 +1,10 @@import { test, expect, type Page, type Locator } from '@playwright/test'import { clearNotices } from '../screenshots/shot'import { captureGuide, captureHero, dismissReleaseNotice, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'+import { year } from '../dates'import { ensureAtlasFixtures } from './fixtures'+import { ensureDawarichConnection, disconnectDawarich } from './external'+import { modal } from './trip-shared'import { atlasGuides, atlasContext } from '../../src/help/contexts/atlas'import type { HelpGuide } from '../../src/help/types'@@ -46,6 +49,26 @@ const panel = (page: Page) => page.getByRole('button', { name: 'Stats' }).locato/** The detail card the panel grows for a country picked in the search. */const detailCard = (page: Page, country: string) =>panel(page).locator('p.text-sm.font-bold').filter({ hasText: country }).locator('xpath=../..')+/**+ * Dawarich's own glass panel, left of the statistics: the one panel with its+ * name in it. Scoped this way because its two tiles, Wishlist and Countries,+ * have namesakes in the dialog's tabs once it is open.+ */+const dawarichPanel = (page: Page) =>+ page.locator('div.hidden.md\\:flex').filter({ has: page.getByText('Dawarich', { exact: true }) }).first()+const tile = (page: Page, label: 'Wishlist' | 'Countries') =>+ dawarichPanel(page).getByRole('button', { name: label, exact: true })+/** The answers in the dialog: every row is one checkbox named after the country or the wish. */+const rows = (page: Page) => modal(page).getByRole('checkbox')++/** The countries the Atlas paints as visited right now, by code. */+async function visitedCodes(page: Page): Promise<Set<string>> {+ const res = await page.request.get('/api/addons/atlas/stats')+ const { countries } = (await res.json()) as { countries: { code: string; status: string }[] }+ return new Set(countries.filter(c => c.status === 'visited').map(c => c.code))+}+/** What was visited before the countries guide confirmed anything, so `cleanup` takes exactly its additions off again. */+let visitedBefore = new Set<string>()async function searchCountry(page: Page, name: string): Promise<void> {const input = searchInput(page)@@ -292,7 +315,7 @@ const SCRIPTS: Record<string, GuideScript> = {{prepare: async p => {await choose(p, unsetSelect(popup(p)), 'June')- await choose(p, unsetSelect(popup(p)), '2027')+ await choose(p, unsetSelect(popup(p)), String(year(1)))},target: p => popup(p),act: async p => {@@ -334,7 +357,7 @@ const SCRIPTS: Record<string, GuideScript> = {{prepare: async p => {await choose(p, unsetSelect(panel(p)), 'Sep')- await choose(p, unsetSelect(panel(p)), '2027')+ await choose(p, unsetSelect(panel(p)), String(year(1)))},target: p => p.getByRole('button', { name: 'Add', exact: true }),act: async p => {@@ -354,6 +377,109 @@ const SCRIPTS: Record<string, GuideScript> = {{ target: p => panel(p).locator('.flex.items-center.gap-4').first() },],},++ 'dawarich-countries': {+ guide: guide('dawarich-countries'),+ start: async p => {+ await openAtlas(p)+ visitedBefore = await visitedCodes(p)+ },+ steps: [+ {+ target: p => tile(p, 'Countries'),+ act: async p => {+ await tile(p, 'Countries').click()+ await expect(modal(p).getByRole('button', { name: 'Look for countries' })).toBeVisible({ timeout: 15_000 })+ await settle(p)+ },+ },+ {+ target: p => modal(p).getByRole('button', { name: 'Look for countries' }),+ act: async p => {+ await modal(p).getByRole('button', { name: 'Look for countries' }).click()+ // A year in thirteen 30-day reads, one after another, each of which+ // Dawarich computes on the spot; the client gives it four minutes.+ // An empty answer shows a sentence instead of rows and fails here,+ // which is right: a dialog with nothing to add is no picture.+ await expect(rows(p).first()).toBeVisible({ timeout: 240_000 })+ await settle(p)+ // The flags come from a CDN and land after the rows.+ await p.waitForTimeout(800)+ },+ },+ {+ target: p => modal(p).getByRole('button', { name: /^Add \d+ countries$/ }),+ act: async p => {+ await modal(p).getByRole('button', { name: /^Add \d+ countries$/ }).click()+ await expect(p.getByText(/\d+ countries added/)).toBeVisible({ timeout: 20_000 })+ await p.keyboard.press('Escape')+ await expect(modal(p)).toHaveCount(0)+ // The Atlas re-reads itself after a write; the colours land with the answer.+ await expect.poll(async () => (await visitedCodes(p)).size, { timeout: 20_000 }).toBeGreaterThan(visitedBefore.size)+ await settle(p)+ await p.waitForTimeout(900)+ },+ },+ ],+ cleanup: async p => {+ // Off the map again, so the next run and the guides after this one start+ // from the seed. Unmarking tombstones a country; confirming it again from+ // the dialog lifts that, so a re-run offers the same rows.+ const after = await visitedCodes(p)+ for (const code of after) {+ if (!visitedBefore.has(code)) await p.request.delete(`/api/addons/atlas/country/${code}/mark`)+ }+ },+ },++ 'dawarich-wishes': {+ guide: guide('dawarich-wishes'),+ start: openAtlas,+ steps: [+ {+ target: p => tile(p, 'Wishlist'),+ act: async p => {+ await tile(p, 'Wishlist').click()+ await expect(modal(p).getByRole('button', { name: 'Check wishlist' })).toBeVisible({ timeout: 15_000 })+ await settle(p)+ },+ },+ {+ target: p => modal(p).getByRole('button', { name: 'Check wishlist' }),+ act: async p => {+ await modal(p).getByRole('button', { name: 'Check wishlist' }).click()+ // One read per wish with coordinates (Fushimi Inari, Wadi Rum, Petra),+ // fifteen seconds each at worst; New Zealand and Iceland have none and+ // are counted in the note instead.+ await expect(rows(p).first()).toBeVisible({ timeout: 120_000 })+ await settle(p)+ },+ },+ {+ target: p => modal(p).getByRole('button', { name: /^Tick off \d+$/ }),+ act: async p => {+ await modal(p).getByRole('button', { name: /^Tick off \d+$/ }).click()+ await expect(p.getByText(/\d+ wishes ticked off/)).toBeVisible({ timeout: 20_000 })+ await p.keyboard.press('Escape')+ await expect(modal(p)).toHaveCount(0)+ // The result is the list itself: the ticked date under each wish is a+ // button labelled Undo, there once the list has re-read itself.+ await p.getByRole('button', { name: 'Bucket List' }).click()+ await expect(panel(p).getByRole('button', { name: 'Undo' }).first()).toBeVisible({ timeout: 20_000 })+ await settle(p)+ },+ },+ ],+ cleanup: async p => {+ // Every tick that came from a recording goes back, by the route the Undo+ // button uses, so the wishes are open again for the next run.+ const res = await p.request.get('/api/addons/atlas/bucket-list')+ const { items } = (await res.json()) as { items: { id: number; visited_source: string | null }[] }+ for (const item of items) {+ if (item.visited_source === 'dawarich') await p.request.delete(`/api/integrations/dawarich/bucket-list/${item.id}/visit`)+ }+ },+ },}// ── Run ───────────────────────────────────────────────────────────────────────@@ -362,6 +488,16 @@ test.describe.configure({ mode: 'serial' })test.beforeAll(async ({ request }) => {await ensureAtlasFixtures(request)+ // After the Atlas fixtures: the connection adds two wishes with coordinates+ // (Fushimi Inari Taisha, Wadi Rum) to the list the fixtures create.+ await ensureDawarichConnection(request)+})++test.afterAll(async ({ request }) => {+ // Instance-wide: while the addon is on, every Atlas carries the Dawarich+ // panel left of Stats. This file's pictures show it on purpose; the files+ // after it do not, so it goes off again here, whatever happened in between.+ await disconnectDawarich(request)})test('every registered atlas guide has a script, and only those', async () => {@@ -375,6 +511,10 @@ test('hero: atlas', async ({ page }) => {for (const id of atlasContext.guides) {test(`pictures: ${id}`, async ({ page }) => {+ // The Dawarich reads are a year of countries in thirteen pieces and one+ // look-up per wish: more waiting on another service than four minutes+ // may hold on a slow instance.+ if (id.startsWith('dawarich-')) test.slow()await page.setViewportSize(VIEWPORT)await captureGuide(page, SCRIPTS[id])})diff --git a/client/e2e/help/dashboard.guide.ts b/client/e2e/help/dashboard.guide.tsindex 32df705a7..d937b9b9c 100644--- a/client/e2e/help/dashboard.guide.ts+++ b/client/e2e/help/dashboard.guide.ts@@ -1,6 +1,7 @@import { test, expect, type Page } from '@playwright/test'import { clearNotices } from '../screenshots/shot'import { captureGuide, captureHero, dismissReleaseNotice, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'+import { monthName, monthsAhead, pickerLabelOn } from '../dates'import { ensureExtraTrips, coverFixture, card, EXTRA_TRIPS } from './fixtures'import { dashboardGuides, dashboardContext } from '../../src/help/contexts/dashboard'import type { HelpGuide } from '../../src/help/types'@@ -56,6 +57,9 @@ async function pickDate(page: Page, trigger: ReturnType<Page['getByRole']>, mont/** Hover-revealed action on a card. */const cardAction = (page: Page, title: string, name: string) => card(page, title).locator(`.trip-action-btn[aria-label="${name}"]`)+/** The trip the create guide makes, eight months out, named after the month it lands in. */+const NEW_TRIP = `Amalfi Coast in ${monthName(8)}`+const SCRIPTS: Record<string, GuideScript> = {'create-trip': {guide: guide('create-trip'),@@ -67,15 +71,15 @@ const SCRIPTS: Record<string, GuideScript> = {},{target: p => titleField(p),- act: async p => { await typeInto(p, titleField(p), 'Amalfi Coast in May') },+ act: async p => { await typeInto(p, titleField(p), NEW_TRIP) },},{target: p => datePicker(p, 'Start Date'),act: async p => {- await pickDate(p, datePicker(p, 'Start Date'), 8, 'May 8, 2027')+ await pickDate(p, datePicker(p, 'Start Date'), 8, pickerLabelOn(monthsAhead(8, 8)))await beat(p, 500)// The end date follows the start date, so its calendar already opens on May.- await pickDate(p, datePicker(p, 'End Date'), 0, 'May 15, 2027')+ await pickDate(p, datePicker(p, 'End Date'), 0, pickerLabelOn(monthsAhead(8, 15)))},},{@@ -85,7 +89,7 @@ const SCRIPTS: Record<string, GuideScript> = {target: p => modal(p).getByRole('button', { name: 'Create New Trip' }),act: async p => {await modal(p).getByRole('button', { name: 'Create New Trip' }).click()- await expect(card(p, 'Amalfi Coast in May')).toBeVisible({ timeout: 15_000 })+ await expect(card(p, NEW_TRIP)).toBeVisible({ timeout: 15_000 })},},],@@ -213,18 +217,18 @@ const SCRIPTS: Record<string, GuideScript> = {guide: guide('delete-trip'),start: async p => {await openDashboard(p)- await expect(card(p, 'Amalfi Coast in May')).toBeVisible()+ await expect(card(p, NEW_TRIP)).toBeVisible()},steps: [{- target: p => cardAction(p, 'Amalfi Coast in May', 'Delete'),- act: async p => { await cardAction(p, 'Amalfi Coast in May', 'Delete').click() },+ target: p => cardAction(p, NEW_TRIP, 'Delete'),+ act: async p => { await cardAction(p, NEW_TRIP, 'Delete').click() },},{target: p => dialog(p).getByRole('button', { name: 'Delete', exact: true }),act: async p => {await dialog(p).getByRole('button', { name: 'Delete', exact: true }).click()- await expect(card(p, 'Amalfi Coast in May')).toBeHidden({ timeout: 15_000 })+ await expect(card(p, NEW_TRIP)).toBeHidden({ timeout: 15_000 })},},],diff --git a/client/e2e/help/dawarich-track.ts b/client/e2e/help/dawarich-track.tsnew file mode 100644index 000000000..6b3ec43a0--- /dev/null+++ b/client/e2e/help/dawarich-track.ts@@ -0,0 +1,357 @@+/**+ * A synthetic Dawarich recording for the help-center pictures.+ *+ * TREK only ever reads from Dawarich, so the media run has to put a recording+ * there itself. This module makes one: a phone track that follows the seeded+ * demo trip through Tokyo and Kyoto, day by day, plus five short trips in the+ * year before it so the Atlas has countries to offer. Everything is relative to+ * the day the pictures are taken, so it stays inside the trip's dates whenever+ * the run happens.+ *+ * The points go through Dawarich's own batch endpoint as GeoJSON features;+ * see `ensureDawarichFixtures` in fixtures.ts for the upload.+ */++export interface TrackFeature {+ type: 'Feature'+ geometry: { type: 'Point'; coordinates: [number, number] }+ properties: {+ timestamp: string+ horizontal_accuracy: number+ altitude: number+ speed: number+ device_id: string+ }+}++/** One place on a day: when the phone gets there (local time) and how long it stays. */+interface Waypoint {+ t: string+ lat: number+ lng: number+ stay?: number+}++interface DayPlan {+ offset: number+ utcOffset: number+ points: Waypoint[]+}++export const DAWARICH_DEVICE = 'trek-help-fixture'++const JST = 9++// Every place the trail visits. The trip's own places come first and match the+// seed's coordinates, so the dashed line ends exactly on the markers.+const P = {+ sensoji: [35.7148, 139.7967],+ nakamise: [35.7118, 139.7963],+ asakusaStation: [35.7109, 139.7975],+ toyosuStation: [35.6551, 139.7961],+ teamlab: [35.6486, 139.79],+ shinjukuStation: [35.6896, 139.7006],+ gracery: [35.6946, 139.7012],+ shibuya: [35.6595, 139.7005],+ harajuku: [35.6702, 139.7027],+ meiji: [35.6764, 139.6993],+ ueno: [35.7146, 139.7714],+ akihabara: [35.6984, 139.7731],+ ginza: [35.6717, 139.765],+ tsukiji: [35.6654, 139.7707],+ tokyoTower: [35.6586, 139.7454],+ roppongi: [35.6605, 139.7292],+ tokyoStation: [35.6812, 139.7671],+ shinYokohama: [35.5075, 139.6174],+ nagoya: [35.1709, 136.8815],+ kyotoStation: [34.9858, 135.7588],+ kanra: [34.9942, 135.7592],+ fushimi: [34.9671, 135.7727],+ arashiyama: [35.017, 135.6716],+ togetsukyo: [35.013, 135.6776],+ nishiki: [35.005, 135.7649],+ kiyomizu: [34.9949, 135.785],+ gion: [35.0037, 135.7752],+ yasaka: [35.0037, 135.7785],+ todaiji: [34.689, 135.8398],+ naraPark: [34.6851, 135.843],+ ginkakuji: [35.027, 135.7982],+ philosophersPath: [35.0227, 135.7948],+ nanzenji: [35.0114, 135.7939],+ heian: [35.0163, 135.7824],+} as const++type Place = readonly [number, number]++const at = (t: string, [lat, lng]: Place, stay?: number): Waypoint => ({ t, lat, lng, stay })++/** The trip itself: the last day is the picture day (offset 0), the first is nine days before. */+function japanDays(): DayPlan[] {+ const day = (offset: number, points: Waypoint[]): DayPlan => ({ offset, utcOffset: JST, points })+ return [+ day(-9, [+ at('08:40', P.gracery, 10),+ at('09:30', P.sensoji, 90),+ at('11:05', P.nakamise, 40),+ at('11:50', P.asakusaStation, 5),+ at('12:40', P.ginza, 70),+ at('13:50', P.toyosuStation, 5),+ at('14:00', P.teamlab, 120),+ at('16:10', P.toyosuStation, 5),+ at('17:00', P.shinjukuStation, 10),+ at('17:15', P.gracery, 60),+ at('19:00', P.shinjukuStation, 90),+ at('21:00', P.gracery, 30),+ ]),+ day(-8, [+ at('09:00', P.gracery, 10),+ at('09:40', P.shibuya, 45),+ at('10:40', P.harajuku, 30),+ at('11:20', P.meiji, 75),+ at('13:00', P.harajuku, 60),+ at('14:30', P.shibuya, 90),+ at('16:40', P.shinjukuStation, 10),+ at('17:00', P.gracery, 240),+ ]),+ day(-7, [+ at('09:10', P.gracery, 10),+ at('10:00', P.ueno, 120),+ at('12:30', P.akihabara, 100),+ at('14:40', P.ginza, 120),+ at('17:20', P.shinjukuStation, 10),+ at('17:40', P.gracery, 200),+ ]),+ day(-6, [+ at('08:30', P.gracery, 10),+ at('09:20', P.tsukiji, 90),+ at('11:30', P.tokyoTower, 80),+ at('13:30', P.roppongi, 150),+ at('16:40', P.shinjukuStation, 10),+ at('17:00', P.gracery, 240),+ ]),+ day(-5, [+ at('07:40', P.gracery, 10),+ at('08:15', P.tokyoStation, 15),+ at('08:48', P.shinYokohama, 1),+ at('10:05', P.nagoya, 1),+ at('10:45', P.kyotoStation, 20),+ at('11:20', P.kanra, 120),+ at('14:00', P.gion, 90),+ at('16:20', P.kanra, 30),+ at('17:00', P.fushimi, 150),+ at('20:00', P.kanra, 60),+ ]),+ day(-4, [+ at('08:30', P.kanra, 10),+ at('09:30', P.togetsukyo, 30),+ at('10:10', P.arashiyama, 60),+ at('11:20', P.togetsukyo, 40),+ at('12:30', P.nishiki, 90),+ at('14:20', P.gion, 60),+ at('15:40', P.kanra, 240),+ ]),+ day(-3, [+ at('09:00', P.kanra, 10),+ at('09:50', P.kiyomizu, 100),+ at('11:50', P.yasaka, 40),+ at('12:40', P.gion, 120),+ at('15:00', P.heian, 60),+ at('16:30', P.kanra, 240),+ ]),+ day(-2, [+ at('08:20', P.kanra, 10),+ at('08:45', P.kyotoStation, 15),+ at('09:45', P.naraPark, 60),+ at('11:00', P.todaiji, 90),+ at('12:40', P.naraPark, 120),+ at('15:30', P.kyotoStation, 10),+ at('16:00', P.kanra, 200),+ ]),+ day(-1, [+ at('09:00', P.kanra, 10),+ at('09:50', P.nanzenji, 60),+ at('11:00', P.philosophersPath, 45),+ at('11:50', P.ginkakuji, 60),+ at('13:20', P.nishiki, 90),+ at('15:20', P.kanra, 240),+ ]),+ day(0, [+ at('08:30', P.kanra, 30),+ at('09:30', P.gion, 60),+ at('11:00', P.nishiki, 60),+ at('12:30', P.kanra, 60),+ at('14:00', P.kyotoStation, 120),+ ]),+ ]+}++/**+ * Five short trips in the year before the pictures, in countries the Atlas does+ * not have yet: Portugal, Jordan, Czechia, South Korea and Taiwan. Jordan+ * dwells at Petra long enough for the wishlist rule (250 m, 20 minutes).+ */+function worldDays(): DayPlan[] {+ const day = (offset: number, utcOffset: number, points: Waypoint[]): DayPlan => ({ offset, utcOffset, points })+ return [+ // Portugal, spring+ day(-158, 1, [+ at('09:30', [38.7077, -9.1366], 60),+ at('11:00', [38.7114, -9.13], 120),+ at('14:00', [38.6979, -9.2065], 90),+ at('15:50', [38.6916, -9.216], 60),+ at('18:00', [38.7077, -9.1366], 120),+ ]),+ day(-157, 1, [+ at('10:00', [41.1407, -8.611], 90),+ at('12:00', [41.147, -8.6149], 60),+ at('13:30', [41.1403, -8.6094], 120),+ at('16:00', [41.1496, -8.6109], 120),+ ]),+ // Jordan, late winter+ day(-205, 3, [+ at('09:00', [31.9544, 35.9344], 90),+ at('11:00', [31.9539, 35.9106], 120),+ at('15:00', [31.717, 35.587], 150),+ ]),+ day(-204, 3, [+ at('08:30', [30.3285, 35.4444], 90),+ at('10:20', [30.3222, 35.4517], 120),+ at('13:00', [30.3285, 35.4444], 60),+ at('15:30', [29.576, 35.42], 180),+ ]),+ // Czechia, early summer+ day(-100, 2, [+ at('09:30', [50.0875, 14.4213], 90),+ at('11:15', [50.0865, 14.4114], 45),+ at('12:30', [50.0911, 14.4016], 150),+ at('16:00', [50.0645, 14.4183], 90),+ ]),+ day(-99, 2, [+ at('10:00', [50.0793, 14.4275], 120),+ at('13:00', [50.0865, 14.4114], 60),+ at('15:00', [50.0875, 14.4213], 120),+ ]),+ // South Korea and Taiwan, one journey last autumn+ day(-300, 9, [+ at('09:30', [37.5796, 126.977], 120),+ at('12:00', [37.5826, 126.9831], 90),+ at('14:30', [37.5636, 126.9856], 120),+ at('17:30', [37.5512, 126.9882], 90),+ ]),+ day(-299, 9, [+ at('10:00', [37.5563, 126.9236], 150),+ at('14:00', [37.5796, 126.977], 90),+ ]),+ day(-297, 8, [+ at('10:00', [25.0372, 121.4999], 60),+ at('11:30', [25.0421, 121.5074], 120),+ at('15:00', [25.0339, 121.5645], 120),+ at('18:30', [25.088, 121.5245], 120),+ ]),+ day(-296, 8, [+ at('10:30', [25.1096, 121.8446], 240),+ at('16:00', [25.0421, 121.5074], 120),+ ]),+ ]+}++/** Deterministic jitter, so two runs produce the same recording. */+function noise(seed: number): number {+ const x = Math.sin(seed * 12.9898 + 78.233) * 43758.5453+ return x - Math.floor(x)+}++function isoAt(dayIso: string, hhmm: string, utcOffset: number, plusSeconds = 0): string {+ const [h, m] = hhmm.split(':').map(Number)+ const local = Date.UTC(+dayIso.slice(0, 4), +dayIso.slice(5, 7) - 1, +dayIso.slice(8, 10), h, m)+ return new Date(local - utcOffset * 3600_000 + plusSeconds * 1000).toISOString().replace(/\.\d{3}Z$/, 'Z')+}++function minutes(hhmm: string): number {+ const [h, m] = hhmm.split(':').map(Number)+ return h * 60 + m+}++function shiftDay(baseDay: string, offset: number): string {+ const d = new Date(`${baseDay}T00:00:00Z`)+ d.setUTCDate(d.getUTCDate() + offset)+ return d.toISOString().slice(0, 10)+}++function feature(lng: number, lat: number, timestamp: string, speed: number, seed: number): TrackFeature {+ return {+ type: 'Feature',+ geometry: { type: 'Point', coordinates: [+lng.toFixed(6), +lat.toFixed(6)] },+ properties: {+ timestamp,+ horizontal_accuracy: 4 + Math.round(noise(seed) * 8),+ altitude: 20 + Math.round(noise(seed + 1) * 30),+ speed: +speed.toFixed(2),+ device_id: DAWARICH_DEVICE,+ },+ }+}++/** Turns one day's waypoints into a track: a point a minute while moving, one every five while staying. */+function dayFeatures(dayIso: string, plan: DayPlan, seedBase: number): TrackFeature[] {+ const out: TrackFeature[] = []+ const pts = plan.points+ let seed = seedBase+ for (let i = 0; i < pts.length; i++) {+ const here = pts[i]+ const stay = here.stay ?? 0+ const arrive = minutes(here.t)+ for (let k = 0; k <= stay; k += 5) {+ seed+++ const wobble = 0.00012+ out.push(+ feature(+ here.lng + (noise(seed) - 0.5) * wobble,+ here.lat + (noise(seed + 7) - 0.5) * wobble,+ isoAt(dayIso, here.t, plan.utcOffset, k * 60),+ 0,+ seed,+ ),+ )+ }+ const next = pts[i + 1]+ if (!next) break+ const leaveAt = arrive + stay+ const travel = minutes(next.t) - leaveAt+ if (travel <= 0) continue+ // Moving: straight line with a little sway, a point a minute. Long hops+ // (the Shinkansen) get thinned out so a day never exceeds Dawarich's page.+ const step = travel > 60 ? 2 : 1+ const km = Math.hypot((next.lat - here.lat) * 111, (next.lng - here.lng) * 91)+ const speed = (km * 1000) / (travel * 60)+ for (let m = step; m < travel; m += step) {+ seed+++ const f = m / travel+ const sway = Math.sin(f * Math.PI) * 0.0008 * (noise(seed) - 0.5)+ out.push(+ feature(+ here.lng + (next.lng - here.lng) * f + sway,+ here.lat + (next.lat - here.lat) * f + sway,+ isoAt(dayIso, here.t, plan.utcOffset, (stay + m) * 60),+ speed,+ seed,+ ),+ )+ }+ }+ return out+}++/** The whole recording for a picture day: the trip's ten days plus the year before. */+export function dawarichRecording(baseDay: string): { trip: TrackFeature[]; world: TrackFeature[] } {+ const build = (plans: DayPlan[], seedBase: number) =>+ plans.flatMap((plan, i) => dayFeatures(shiftDay(baseDay, plan.offset), plan, seedBase + i * 10_000))+ return { trip: build(japanDays(), 1), world: build(worldDays(), 500_000) }+}++/** The UTC window one part of the recording covers, for checking whether it is already there. */+export function recordingWindow(baseDay: string, part: 'trip' | 'world'): { from: string; to: string } {+ const plans = part === 'trip' ? japanDays() : worldDays()+ const offsets = plans.map(p => p.offset)+ return { from: shiftDay(baseDay, Math.min(...offsets) - 1), to: shiftDay(baseDay, Math.max(...offsets) + 1) }+}diff --git a/client/e2e/help/external.ts b/client/e2e/help/external.tsnew file mode 100644index 000000000..34db7e2dc--- /dev/null+++ b/client/e2e/help/external.ts@@ -0,0 +1,290 @@+import type { APIRequestContext } from '@playwright/test'+import { day, PICTURE_DAY_ISO } from '../dates'+import { dawarichRecording, recordingWindow, type TrackFeature } from './dawarich-track'++/**+ * The services outside TREK that a few guides need: an AirTrail with flights,+ * a Dawarich with a recording, a Nextcloud with a folder of documents. Each is+ * reached through its own API with the address and key from the environment+ * (`e2e/help/media.env`, see README), and each fixture puts the service into+ * the state the guide expects before TREK is connected to it. Nothing here is+ * silent: a missing variable or an unreachable service fails the run rather+ * than producing a picture of an empty panel.+ *+ * TREK's SSRF guard refuses loopback whatever the flags say, so every address+ * has to be the machine's LAN address, and the media backend needs+ * ALLOW_INTERNAL_NETWORK=true to reach it at all.+ */++function env(name: string): string {+ const value = process.env[name]+ if (!value) throw new Error(`${name} is not set; see client/e2e/help/README.md for the media.env the external guides need`)+ return value.replace(/\/+$/, '')+}++async function expectOk(res: Response, what: string): Promise<Response> {+ if (!res.ok) throw new Error(`${what}: HTTP ${res.status} ${await res.text()}`)+ return res+}++// ── AirTrail ────────────────────────────────────────────────────────────────++interface AirtrailWanted {+ flightNumber: string+ from: string+ to: string+ offset: number+ departureTime: string+ arrivalTime: string+ airline: string+ aircraft: string+ seat: 'window' | 'aisle'+ seatNumber: string+}++/**+ * Two flights home on the trip's last day that connect in Tokyo, so the picker+ * offers to import them as one flight with a layover, and the flights of the+ * Lisbon weekend in spring for its "Other flights" list. LH716 out is already+ * in the seed and would only be skipped as a duplicate, so it stays out.+ */+export const AIRTRAIL_FLIGHTS: AirtrailWanted[] = [+ { flightNumber: 'NH16', from: 'ITM', to: 'HND', offset: 0, departureTime: '08:00', arrivalTime: '09:10', airline: 'ANA', aircraft: 'B789', seat: 'window', seatNumber: '12A' },+ { flightNumber: 'LH717', from: 'HND', to: 'FRA', offset: 0, departureTime: '12:35', arrivalTime: '18:25', airline: 'DLH', aircraft: 'A359', seat: 'aisle', seatNumber: '31C' },+ { flightNumber: 'TP573', from: 'FRA', to: 'LIS', offset: -158, departureTime: '10:20', arrivalTime: '12:25', airline: 'TAP', aircraft: 'A320', seat: 'window', seatNumber: '7F' },+ { flightNumber: 'TP574', from: 'LIS', to: 'FRA', offset: -156, departureTime: '13:10', arrivalTime: '17:05', airline: 'TAP', aircraft: 'A320', seat: 'aisle', seatNumber: '9C' },+]++interface AirtrailFlightRow {+ id: number+ flightNumber: string | null+ date: string+ passengers?: { id: number; userId: string | null }[]+ seats?: { id: number; userId: string | null }[]+}++/** Puts the wanted flights into the AirTrail account the key belongs to, once. */+export async function ensureAirtrailFlights(): Promise<void> {+ const base = env('HELP_MEDIA_AIRTRAIL_URL')+ const headers = { Authorization: `Bearer ${env('HELP_MEDIA_AIRTRAIL_API_KEY')}`, 'Content-Type': 'application/json' }+ const listed = await expectOk(await fetch(`${base}/api/flight/list`, { headers }), 'AirTrail flight list')+ const { flights } = (await listed.json()) as { flights: AirtrailFlightRow[] }+ for (const wanted of AIRTRAIL_FLIGHTS) {+ const date = day(wanted.offset)+ const existing = flights.find(f => f.flightNumber === wanted.flightNumber)+ if (existing && existing.date === date) continue+ const owner = (existing?.passengers ?? existing?.seats ?? []).find(p => p.userId)+ const body = {+ ...(existing ? { id: existing.id } : {}),+ from: wanted.from,+ to: wanted.to,+ departure: date,+ departureTime: wanted.departureTime,+ arrival: date,+ arrivalTime: wanted.arrivalTime,+ airline: wanted.airline,+ flightNumber: wanted.flightNumber,+ aircraft: wanted.aircraft,+ passengers: [{ ...(owner ? { id: owner.id } : {}), userId: '<USER_ID>', seat: wanted.seat, seatNumber: wanted.seatNumber, seatClass: 'economy', flightReason: 'leisure' }],+ }+ await expectOk(await fetch(`${base}/api/flight/save`, { method: 'POST', headers, body: JSON.stringify(body) }), `AirTrail save ${wanted.flightNumber}`)+ }+}++/** Switches the addon on and connects the signed-in user to the AirTrail, loudly. */+export async function ensureAirtrailConnection(api: APIRequestContext): Promise<void> {+ await ensureAirtrailFlights()+ await toggleAddon(api, 'airtrail', true)+ const saved = await api.put('/api/integrations/airtrail/settings', {+ data: { url: env('HELP_MEDIA_AIRTRAIL_URL'), apiKey: env('HELP_MEDIA_AIRTRAIL_API_KEY') },+ })+ if (!saved.ok()) throw new Error(`could not save the AirTrail connection: ${saved.status()} ${await saved.text()}`)+ const status = await api.get('/api/integrations/airtrail/status')+ const body = (await status.json()) as { connected: boolean; error?: string }+ if (!body.connected) throw new Error(`AirTrail is not reachable from the media backend: ${body.error ?? status.status()} (is ALLOW_INTERNAL_NETWORK=true?)`)+}++export async function disconnectAirtrail(api: APIRequestContext): Promise<void> {+ await api.put('/api/integrations/airtrail/settings', { data: { url: '' } })+ await toggleAddon(api, 'airtrail', false)+}++// ── Dawarich ────────────────────────────────────────────────────────────────++/** Uploads the synthetic recording, one part at a time, unless its window already holds points. */+export async function ensureDawarichRecording(): Promise<void> {+ const base = env('HELP_MEDIA_DAWARICH_URL')+ const key = env('HELP_MEDIA_DAWARICH_API_KEY')+ const recording = dawarichRecording(PICTURE_DAY_ISO)+ for (const part of ['world', 'trip'] as const) {+ const { from, to } = recordingWindow(PICTURE_DAY_ISO, part)+ const probe = await expectOk(+ await fetch(`${base}/api/v1/points?start_at=${from}&end_at=${to}&per_page=1`, { headers: { Authorization: `Bearer ${key}` } }),+ `Dawarich points ${part}`,+ )+ if (Number(probe.headers.get('x-total-pages') ?? 0) > 0) continue+ const features = recording[part]+ for (let i = 0; i < features.length; i += 500) {+ const batch: TrackFeature[] = features.slice(i, i + 500)+ await expectOk(+ await fetch(`${base}/api/v1/points?api_key=${key}`, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ locations: batch }),+ }),+ `Dawarich upload ${part} batch ${i / 500 + 1}`,+ )+ }+ }+}++/** Two wishes the recording reaches, with coordinates so the scan can match them. */+export const DAWARICH_WISHES = [+ { name: 'Fushimi Inari Taisha', lat: 34.9671, lng: 135.7727, country_code: 'JP' },+ { name: 'Wadi Rum', lat: 29.576, lng: 35.42, country_code: 'JO' },+]++/**+ * Switches the addon on, connects the signed-in user to the Dawarich and adds+ * the wishes. Automatic syncing stays off: a sync would seed suggestion rows+ * that head the Places column of every later picture.+ */+export async function ensureDawarichConnection(api: APIRequestContext): Promise<void> {+ await ensureDawarichRecording()+ await toggleAddon(api, 'dawarich', true)+ const saved = await api.put('/api/integrations/dawarich/settings', {+ data: { url: env('HELP_MEDIA_DAWARICH_URL'), apiKey: env('HELP_MEDIA_DAWARICH_API_KEY'), allowInsecureTls: false, syncEnabled: false },+ })+ if (!saved.ok()) throw new Error(`could not save the Dawarich connection: ${saved.status()} ${await saved.text()}`)+ // The probe wants the address in its body; the key it takes from the connection just saved.+ const test = await api.post('/api/integrations/dawarich/test', { data: { url: env('HELP_MEDIA_DAWARICH_URL'), allowInsecureTls: false } })+ const body = (await test.json()) as { connected: boolean; error?: string; errorDetail?: string }+ if (!body.connected) throw new Error(`Dawarich is not reachable from the media backend: ${body.error ?? ''} ${body.errorDetail ?? ''} (is ALLOW_INTERNAL_NETWORK=true?)`)++ const listRes = await api.get('/api/addons/atlas/bucket-list')+ const { items } = (await listRes.json()) as { items: { name: string }[] }+ for (const wish of DAWARICH_WISHES) {+ if (items.some(i => i.name === wish.name)) continue+ const created = await api.post('/api/addons/atlas/bucket-list', { data: wish })+ if (!created.ok()) throw new Error(`could not add the ${wish.name} wish: ${created.status()} ${await created.text()}`)+ }+}++export async function disconnectDawarich(api: APIRequestContext): Promise<void> {+ await api.delete('/api/integrations/dawarich/settings')+ await toggleAddon(api, 'dawarich', false)+}++// ── Nextcloud ───────────────────────────────────────────────────────────────++export const NEXTCLOUD_BASE_PATH = '/Reisen'+export const NEXTCLOUD_FOLDER = 'Autumn in Japan'+export const NEXTCLOUD_DOCUMENTS = ['ryokan-invoice.pdf', 'shinkansen-eticket.pdf']++function davRoot(): { url: string; auth: string } {+ const url = `${env('HELP_MEDIA_NEXTCLOUD_URL')}/remote.php/dav/files/${env('HELP_MEDIA_NEXTCLOUD_USER')}`+ const auth = 'Basic ' + Buffer.from(`${env('HELP_MEDIA_NEXTCLOUD_USER')}:${env('HELP_MEDIA_NEXTCLOUD_PASSWORD')}`).toString('base64')+ return { url, auth }+}++async function dav(method: string, path: string, body?: BodyInit, extra: Record<string, string> = {}): Promise<Response> {+ const { url, auth } = davRoot()+ const target = url + path.split('/').map(encodeURIComponent).join('/')+ return fetch(target, { method, headers: { Authorization: auth, ...extra }, body })+}++/**+ * The store side of the document-sync guide: a base folder with one trip+ * folder holding two documents and nothing else, however the last run left it.+ * `pdf` draws the documents, so this file stays free of binary fixtures.+ */+export async function ensureNextcloudFolder(pdf: (title: string, lines: string[]) => Buffer): Promise<void> {+ const folder = `${NEXTCLOUD_BASE_PATH}/${NEXTCLOUD_FOLDER}`+ for (const dir of [NEXTCLOUD_BASE_PATH, folder]) {+ const made = await dav('MKCOL', `${dir}/`)+ if (![201, 405].includes(made.status)) throw new Error(`Nextcloud MKCOL ${dir}: HTTP ${made.status} ${await made.text()}`)+ }+ const listing = await dav('PROPFIND', `${folder}/`, undefined, { Depth: '1' })+ if (listing.status !== 207) throw new Error(`Nextcloud PROPFIND ${folder}: HTTP ${listing.status}`)+ const names = [...(await listing.text()).matchAll(/<d:href>([^<]+)<\/d:href>/g)]+ .map(m => decodeURIComponent(m[1]).replace(/\/$/, '').split('/').pop() ?? '')+ .filter(n => n && n !== NEXTCLOUD_FOLDER)+ for (const name of names) {+ if (NEXTCLOUD_DOCUMENTS.includes(name)) continue+ const gone = await dav('DELETE', `${folder}/${name}`)+ if (![204, 404].includes(gone.status)) throw new Error(`Nextcloud DELETE ${name}: HTTP ${gone.status}`)+ }+ const documents: Record<string, string[]> = {+ 'ryokan-invoice.pdf': ['Hakone Ginyu, invoice 2026-0918', 'Two nights, two guests, half board', 'JPY 96,000, paid by card'],+ 'shinkansen-eticket.pdf': ['Nozomi 21, Tokyo to Kyoto', 'Car 7, seats 12A and 12B', 'Reserved, non-smoking'],+ }+ for (const name of NEXTCLOUD_DOCUMENTS) {+ if (names.includes(name)) continue+ const bytes = pdf(name.replace(/\.pdf$/, ''), documents[name])+ const body = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength) as ArrayBuffer+ const put = await dav('PUT', `${folder}/${name}`, body, { 'Content-Type': 'application/pdf' })+ if (![201, 204].includes(put.status)) throw new Error(`Nextcloud PUT ${name}: HTTP ${put.status} ${await put.text()}`)+ }+}++export const NEXTCLOUD_CONNECTION = () => ({+ providerId: 'nextcloud',+ baseUrl: env('HELP_MEDIA_NEXTCLOUD_URL'),+ credentials: { login_name: env('HELP_MEDIA_NEXTCLOUD_USER'), app_password: env('HELP_MEDIA_NEXTCLOUD_PASSWORD'), base_path: NEXTCLOUD_BASE_PATH },+ allowInsecureTls: false,+})++/** Takes every binding and connection off the trip, keeping the documents. */+export async function resetDocSync(api: APIRequestContext, tripId: number): Promise<void> {+ const links = await api.get(`/api/trips/${tripId}/docsync/links`)+ if (links.ok()) {+ const body = (await links.json()) as { links?: { id: number }[] } | { id: number }[]+ for (const link of Array.isArray(body) ? body : (body.links ?? [])) await api.delete(`/api/trips/${tripId}/docsync/links/${link.id}`)+ }+ const connections = await api.get(`/api/trips/${tripId}/docsync/connections`)+ if (connections.ok()) {+ const body = (await connections.json()) as { connections?: { id: number }[] } | { id: number }[]+ for (const c of Array.isArray(body) ? body : (body.connections ?? [])) await api.delete(`/api/trips/${tripId}/docsync/connections/${c.id}`)+ }+}++// ── Booking extractor ────────────────────────────────────────────────────────++/**+ * Import from file is rendered only when the server can read a confirmation.+ * The media run gets that from the extractor named in media.env+ * (KITINERARY_EXTRACTOR_PATH, see README). The AI Parsing addon would show+ * the button too, but with no model behind it every parse ends in a red card,+ * so the guides ask for the extractor and nothing else.+ */+export async function requireExtractor(api: APIRequestContext): Promise<void> {+ const res = await api.get('/api/health/features')+ const body = (await res.json()) as { bookingImport?: boolean }+ if (!body.bookingImport) {+ throw new Error('the booking extractor is not available to the media backend: set KITINERARY_EXTRACTOR_PATH in e2e/help/media.env (see README)')+ }+}++/**+ * The review attaches the confirmation to the booking it made through the+ * ordinary file upload, and that upload honours the administrator's Allowed+ * File Types, which do not include a mail out of the box: the booking is+ * saved and the .eml dropped without a word. So the list gets `eml` for the+ * import guides and loses it again in their cleanup. Idempotent either way.+ */+export async function allowEmlUploads(api: APIRequestContext, allowed: boolean): Promise<void> {+ const current = await api.get('/api/auth/app-settings')+ const { allowed_file_types = '' } = (await current.json()) as { allowed_file_types?: string }+ const types = allowed_file_types.split(',').map(t => t.trim().toLowerCase()).filter(Boolean)+ if (types.includes('eml') === allowed) return+ const next = allowed ? [...types, 'eml'] : types.filter(t => t !== 'eml')+ const res = await api.put('/api/auth/app-settings', { data: { allowed_file_types: next.join(',') } })+ if (!res.ok()) throw new Error(`could not ${allowed ? 'allow' : 'disallow'} .eml uploads: ${res.status()} ${await res.text()}`)+}++// ── shared ──────────────────────────────────────────────────────────────────++export async function toggleAddon(api: APIRequestContext, id: string, enabled: boolean): Promise<void> {+ const res = await api.put(`/api/admin/addons/${id}`, { data: { enabled } })+ if (!res.ok()) throw new Error(`could not switch addon ${id} ${enabled ? 'on' : 'off'}: ${res.status()} ${await res.text()}`)+}diff --git a/client/e2e/help/fixtures.ts b/client/e2e/help/fixtures.tsindex 86c3f9caa..8fc38970c 100644--- a/client/e2e/help/fixtures.ts+++ b/client/e2e/help/fixtures.ts@@ -5,6 +5,7 @@ import { gzipSync } from 'node:zlib'import { request as apiRequest, type APIRequestContext, type Page } from '@playwright/test'import { E2E_BASE_URL } from '../../playwright.config'import { OUT_DIR, PICTURE_DAY } from './guide'+import { at, day, emlDate, mailHeaderDate, short } from '../dates'/*** What the dashboard guides act on beyond the seeded trip.@@ -17,8 +18,8 @@ import { OUT_DIR, PICTURE_DAY } from './guide'*/export const EXTRA_TRIPS = [- { title: 'Weekend in Lisbon', description: 'Pastéis, miradouros and a day trip to Sintra.', start_date: '2026-10-16', end_date: '2026-10-18', currency: 'EUR' },- { title: 'Norway Road Trip', description: 'Bergen to the Lofoten, fjord by fjord.', start_date: '2027-06-05', end_date: '2027-06-19', currency: 'NOK' },+ { title: 'Weekend in Lisbon', description: 'Pastéis, miradouros and a day trip to Sintra.', start_date: day(25), end_date: day(27), currency: 'EUR' },+ { title: 'Norway Road Trip', description: 'Bergen to the Lofoten, fjord by fjord.', start_date: day(257), end_date: day(271), currency: 'NOK' },]export async function ensureExtraTrips(api: APIRequestContext): Promise<void> {@@ -145,7 +146,7 @@ const ENTRIES = [/** A second, future journey, so the list has a card below the banner. */export const SECOND_JOURNEY = { title: 'Fjords and ferries', subtitle: 'Norway, next summer', trip: 'Norway Road Trip' }/** A trip no journey has claimed, for the guide that links one. */-export const SPARE_TRIP = { title: 'Alps by rail', description: 'Zurich to Venice over the Bernina.', start_date: '2027-02-12', end_date: '2027-02-19', currency: 'CHF' }+export const SPARE_TRIP = { title: 'Alps by rail', description: 'Zurich to Venice over the Bernina.', start_date: day(144), end_date: day(151), currency: 'CHF' }export async function ensureJourneyFixtures(api: APIRequestContext): Promise<number> {const listRes = await api.get('/api/journeys')@@ -211,9 +212,9 @@ const SCHOOL_REGION = {name: 'Bavaria',revision: 0,holidays: [- { name: 'Autumn break', startDate: '2026-11-02', endDate: '2026-11-06' },- { name: 'Christmas break', startDate: '2026-12-24', endDate: '2027-01-06' },- { name: 'Easter break', startDate: '2027-03-29', endDate: '2027-04-09' },+ { name: 'Autumn break', startDate: day(42), endDate: day(46) },+ { name: 'Christmas break', startDate: day(94), endDate: day(107) },+ { name: 'Easter break', startDate: day(189), endDate: day(200) },],}@@ -414,7 +415,7 @@ export async function ensureDaysFixtures(api: APIRequestContext): Promise<void>await api.post(`/api/trips/${tripId}/reservations`, {data: {title: 'Lunch at Nishiki', type: 'restaurant', status: 'confirmed', day_id: dayIds[5],- place_id: market.place_id, assignment_id: market.id, reservation_time: '2026-09-17T12:30:00', confirmation_number: 'NK-2211',+ place_id: market.place_id, assignment_id: market.id, reservation_time: at(-4, '12:30'), confirmation_number: 'NK-2211',},})}@@ -424,11 +425,11 @@ export async function ensureDaysFixtures(api: APIRequestContext): Promise<void>await api.post(`/api/trips/${tripId}/reservations`, {data: {title: 'Nozomi 21 Tokyo → Kyoto', type: 'train', status: 'confirmed', location: 'Tokyo Station',- reservation_time: '2026-09-16T08:30:00', reservation_end_time: '2026-09-16T10:45:00', confirmation_number: 'JR-58204',+ reservation_time: at(-5, '08:30'), reservation_end_time: at(-5, '10:45'), confirmation_number: 'JR-58204',metadata: { train_number: 'Nozomi 21', platform: '17', seat: '8A' },endpoints: [- { role: 'from', sequence: 0, name: 'Tokyo Station', lat: 35.6812, lng: 139.7671, timezone: 'Asia/Tokyo', local_date: '2026-09-16', local_time: '08:30' },- { role: 'to', sequence: 1, name: 'Kyoto Station', lat: 34.9858, lng: 135.7588, timezone: 'Asia/Tokyo', local_date: '2026-09-16', local_time: '10:45' },+ { role: 'from', sequence: 0, name: 'Tokyo Station', lat: 35.6812, lng: 139.7671, timezone: 'Asia/Tokyo', local_date: day(-5), local_time: '08:30' },+ { role: 'to', sequence: 1, name: 'Kyoto Station', lat: 34.9858, lng: 135.7588, timezone: 'Asia/Tokyo', local_date: day(-5), local_time: '10:45' },],},})@@ -484,7 +485,9 @@ export async function ensureDaysFixtures(api: APIRequestContext): Promise<void>* What the place card needs beyond the seed: a website on one place so the* footer offers Open Website at all, a note on the first stop so the card can* show Notes for this day, and two other travellers' star votes so the rating- * row has an average and a voter list rather than one lonely face.+ * row has an average and a voter list rather than one lonely face. An+ * OpenStreetMap id on three places, so the card shows real hours, a ring and a+ * phone number; see OSM_PLACES.** The votes are cast as the members themselves. A login on the shared context* would set the trek_session cookie on it, and the server reads that cookie@@ -504,9 +507,132 @@ const MEMBER_VOTES = [{ username: 'jonas', email: '[email protected]', password: 'DemoSeed12345!', rating: 4 },]+/**+ * The OpenStreetMap element behind three of the seeded places, so their cards+ * show what a place picked from the search shows: the hours, the Open or+ * Closed ring, the phone number and the website. The seed posts bare rows, and+ * a place with neither a Google nor an OpenStreetMap id asks no provider at+ * all (PlaceInspector's usePlaceDetails), which is why every picture of the+ * card had been without them.+ *+ * The id is looked up at run time through TREK's own autocomplete, which+ * answers from the OpenStreetMap layer of the TREK index, so a re-mapped+ * element does not quietly blank the picture; the id written here is the+ * fallback for when the index is unreachable or names something else. Every+ * candidate is then asked from the details route, the call the card makes,+ * and only one that answers with a week of hours is written. Senso-ji is the+ * place the read-place guide pictures, so a run that cannot get its hours and+ * phone number fails here rather than promoting a picture of a card without+ * the feature the text describes; the other two only make their own guides'+ * cards look like a real place's, so a thin answer is warned about and the+ * id kept.+ *+ * Nishiki Market is left out on purpose: its OpenStreetMap hours ("Mo-Su,PH+ * 10:00-18:00+") are a shape the server's parser rejects, and Fushimi Inari+ * and Meiji Jingu carry no hours tag at all.+ */+interface OsmPlace {+ /** The seeded place's name. */+ place: string+ /** What the resolver types into the autocomplete. */+ query: string+ /** What the suggestion's name has to contain, letters and digits only. */+ key: string+ /** The element the last probe found, used when the index cannot say. */+ osmId: string+ /** Whether the answer has to carry a phone number as well as the hours. */+ phone: boolean+ /** Fail the run when the details do not come; otherwise warn and keep the id. */+ strict: boolean+}++export const OSM_PLACES: OsmPlace[] = [+ { place: 'Senso-ji Temple', query: 'Senso-ji', key: 'sensoji', osmId: 'way:173154847', phone: true, strict: true },+ { place: 'teamLab Planets', query: 'teamLab Planets', key: 'teamlab', osmId: 'node:6291685287', phone: false, strict: false },+ { place: 'Arashiyama Bamboo Grove', query: 'Arashiyama Bamboo Grove', key: 'bamboo', osmId: 'relation:17656638', phone: false, strict: false },+]++/** The id form the details route resolves (maps.helpers.ts OSM_PLACE_ID). */+const OSM_PLACE_ID = /^(node|way|relation):\d+$/++/** Letters and digits, diacritics dropped: "Sensō-ji" and "Senso-ji Temple" both open with "sensoji". */+const plain = (value: string): string =>+ value.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase().replace(/[^a-z0-9]/g, '')++/** Metres between two pins; flat arithmetic is exact enough for a few hundred of them. */+function metresApart(a: { lat: number; lng: number }, b: { lat: number; lng: number }): number {+ const dLat = (b.lat - a.lat) * 111_320+ const dLng = (b.lng - a.lng) * 111_320 * Math.cos(((a.lat + b.lat) / 2) * (Math.PI / 180))+ return Math.hypot(dLat, dLng)+}++interface Suggestion {+ placeId: string+ mainText: string+ source?: string+ lat?: number+ lng?: number+}++/**+ * The element the index knows the place by: an OpenStreetMap row of TREK's own+ * autocomplete, biased to the seed's pin, called like the place and within a+ * few hundred metres of it. Undefined when the index is unreachable or names+ * nothing that is this place; the caller then falls back to the written id.+ */+async function resolveOsmId(api: APIRequestContext, wanted: OsmPlace, pin: { lat: number; lng: number }): Promise<string | undefined> {+ const res = await api.post('/api/maps/autocomplete', {+ data: {+ input: wanted.query,+ locationBias: { low: { lat: pin.lat - 0.02, lng: pin.lng - 0.02 }, high: { lat: pin.lat + 0.02, lng: pin.lng + 0.02 } },+ },+ })+ if (!res.ok()) return undefined+ const body = (await res.json()) as { suggestions?: Suggestion[] }+ return (body.suggestions ?? []).find(+ s =>+ s.source === 'openstreetmap'+ && OSM_PLACE_ID.test(s.placeId)+ && plain(s.mainText).includes(wanted.key)+ && typeof s.lat === 'number'+ && typeof s.lng === 'number'+ && metresApart(pin, { lat: s.lat, lng: s.lng }) < 600,+ )?.placeId+}++interface ProviderDetails {+ opening_hours?: string[] | null+ phone?: string | null+}++/** Whether a details answer carries what the card is to show for this place. */+const complete = (details: ProviderDetails | null, wanted: OsmPlace): boolean =>+ !!details+ && Array.isArray(details.opening_hours)+ && details.opening_hours.length === 7+ && (!wanted.phone || (typeof details.phone === 'string' && details.phone.length > 0))++/**+ * What the card would get for this id, asked the way the card asks it. The+ * OpenStreetMap path has no server-side cache and Overpass is regularly+ * overloaded, so a thin answer is asked again twice before it counts.+ */+async function providerDetails(api: APIRequestContext, osmId: string, wanted: OsmPlace): Promise<ProviderDetails | null> {+ for (let attempt = 1; ; attempt++) {+ const res = await api.get(`/api/maps/details/${encodeURIComponent(osmId)}?lang=en`)+ const body = res.ok() ? ((await res.json()) as { place: ProviderDetails | null; disabled?: boolean }) : null+ if (body?.disabled) throw new Error('Place Details is switched off in the admin settings, so no card gets hours')+ if (complete(body?.place ?? null, wanted) || attempt === 3) return body?.place ?? null+ await new Promise(resolve => setTimeout(resolve, 2_000))+ }+}+type FixturePlace = {id: numbername: string+ lat?: number | null+ lng?: number | null+ osm_id?: string | nullwebsite?: string | nullratings?: { username?: string | null }[] | null}@@ -525,6 +651,33 @@ export async function ensurePlaceFixtures(api: APIRequestContext): Promise<void>if (!res.ok()) throw new Error(`could not set the website on ${PLACE_WEBSITE.place}: ${res.status()} ${await res.text()}`)}+ // An OpenStreetMap identity on three places, the same PUT: the card then asks+ // the details route for the hours, the ring and the phone number.+ for (const wanted of OSM_PLACES) {+ const place = byName(wanted.place)+ if (!place || typeof place.lat !== 'number' || typeof place.lng !== 'number') continue+ const pin = { lat: place.lat, lng: place.lng }+ const resolved = await resolveOsmId(api, wanted, pin)+ const candidates = [...new Set([resolved, wanted.osmId].filter((id): id is string => !!id))]+ let chosen: string | undefined+ for (const id of candidates) {+ if (complete(await providerDetails(api, id, wanted), wanted)) {+ chosen = id+ break+ }+ }+ if (!chosen) {+ const what = `${wanted.place}: the details route gives no week of opening hours${wanted.phone ? ' and no phone number' : ''} for ${candidates.join(' or ')}`+ if (wanted.strict) throw new Error(what)+ console.warn(`${what}; keeping the id, the card shows what there is`)+ chosen = candidates[0]+ }+ if (place.osm_id !== chosen) {+ const res = await api.put(`/api/trips/${tripId}/places/${place.id}`, { data: { osm_id: chosen } })+ if (!res.ok()) throw new Error(`could not set the OpenStreetMap id on ${wanted.place}: ${res.status()} ${await res.text()}`)+ }+ }+// A note that belongs to the stop rather than to the place, which is the one// box of the card no other guide reaches.const noted = byName(STOP_NOTE.place)@@ -616,7 +769,7 @@ export async function ensureDayDetailFixtures(api: APIRequestContext): Promise<vdata: {title: EVENING_WALK, type: 'tour', status: 'pending', day_id: dayIds[4],place_id: inari.place_id, assignment_id: inari.id,- reservation_time: '2026-09-16T17:00:00', reservation_end_time: '2026-09-16T19:30:00',+ reservation_time: at(-5, '17:00'), reservation_end_time: at(-5, '19:30'),confirmation_number: 'FIT-3390',},})@@ -641,13 +794,13 @@ export async function ensureMapFixtures(api: APIRequestContext): Promise<void> {const created = await api.post(`/api/trips/${tripId}/reservations`, {data: {title: 'Nozomi 21 Tokyo → Kyoto', type: 'train', status: 'confirmed', location: 'Tokyo Station',- reservation_time: '2026-09-16T08:30:00', reservation_end_time: '2026-09-16T10:45:00', confirmation_number: 'JR-58204',+ reservation_time: at(-5, '08:30'), reservation_end_time: at(-5, '10:45'), confirmation_number: 'JR-58204',metadata: { train_number: 'Nozomi 21', platform: '17', seat: '8A' },// Both ends need coordinates or the endpoints are dropped and the booking// draws nothing at all.endpoints: [- { role: 'from', sequence: 0, name: 'Tokyo Station', lat: 35.6812, lng: 139.7671, timezone: 'Asia/Tokyo', local_date: '2026-09-16', local_time: '08:30' },- { role: 'to', sequence: 1, name: 'Kyoto Station', lat: 34.9858, lng: 135.7588, timezone: 'Asia/Tokyo', local_date: '2026-09-16', local_time: '10:45' },+ { role: 'from', sequence: 0, name: 'Tokyo Station', lat: 35.6812, lng: 139.7671, timezone: 'Asia/Tokyo', local_date: day(-5), local_time: '08:30' },+ { role: 'to', sequence: 1, name: 'Kyoto Station', lat: 34.9858, lng: 135.7588, timezone: 'Asia/Tokyo', local_date: day(-5), local_time: '10:45' },],},})@@ -698,11 +851,11 @@ export async function ensureTransportFixtures(api: APIRequestContext): Promise<vdata: {title: 'Rental car in Kyoto', type: 'car', status: 'pending',day_id: dayIds[5], end_day_id: dayIds[7],- reservation_time: '2026-09-17T09:00', reservation_end_time: '2026-09-19T18:00',+ reservation_time: at(-4, '09:00'), reservation_end_time: at(-2, '18:00'),confirmation_number: 'TYT-4417',endpoints: [- { role: 'from', sequence: 0, name: 'Kyoto Station Hachijo Exit', lat: 34.9835, lng: 135.759, timezone: 'Asia/Tokyo', local_date: '2026-09-17', local_time: '09:00' },- { role: 'to', sequence: 1, name: 'Kyoto Station Hachijo Exit', lat: 34.9835, lng: 135.759, timezone: 'Asia/Tokyo', local_date: '2026-09-19', local_time: '18:00' },+ { role: 'from', sequence: 0, name: 'Kyoto Station Hachijo Exit', lat: 34.9835, lng: 135.759, timezone: 'Asia/Tokyo', local_date: day(-4), local_time: '09:00' },+ { role: 'to', sequence: 1, name: 'Kyoto Station Hachijo Exit', lat: 34.9835, lng: 135.759, timezone: 'Asia/Tokyo', local_date: day(-2), local_time: '18:00' },],},})@@ -728,7 +881,7 @@ export async function ensureTransportFixtures(api: APIRequestContext): Promise<vdata: {title: TRANSIT_JOURNEY, type: 'transit', status: 'confirmed',day_id: dayIds[5], end_day_id: dayIds[5],- reservation_time: '2026-09-17T09:48', reservation_end_time: '2026-09-17T10:25',+ reservation_time: at(-4, '09:48'), reservation_end_time: at(-4, '10:25'),location: null, confirmation_number: null, notes: null,metadata: {transit: {@@ -744,9 +897,9 @@ export async function ensureTransportFixtures(api: APIRequestContext): Promise<v},},endpoints: [- { role: 'from', sequence: 0, name: 'Arashiyama Bamboo Grove', lat: 35.017, lng: 135.6716, timezone: 'Asia/Tokyo', local_date: '2026-09-17', local_time: '09:48' },- { role: 'stop', sequence: 1, name: 'Nijō', lat: 35.0109, lng: 135.7386, timezone: 'Asia/Tokyo', local_date: '2026-09-17', local_time: '10:08' },- { role: 'to', sequence: 2, name: 'Nishiki Market', lat: 35.005, lng: 135.7649, timezone: 'Asia/Tokyo', local_date: '2026-09-17', local_time: '10:25' },+ { role: 'from', sequence: 0, name: 'Arashiyama Bamboo Grove', lat: 35.017, lng: 135.6716, timezone: 'Asia/Tokyo', local_date: day(-4), local_time: '09:48' },+ { role: 'stop', sequence: 1, name: 'Nijō', lat: 35.0109, lng: 135.7386, timezone: 'Asia/Tokyo', local_date: day(-4), local_time: '10:08' },+ { role: 'to', sequence: 2, name: 'Nishiki Market', lat: 35.005, lng: 135.7649, timezone: 'Asia/Tokyo', local_date: day(-4), local_time: '10:25' },],needs_review: false,},@@ -794,32 +947,174 @@ export function bookingPdfFixture(id: 'teamlab-tickets' | 'kyoto-vouchers'): str}/** The hotel confirmation the import guide hands to the parser; written on first use. */-export function bookingEmlFixture(): string {+/**+ * The files the import guides hand to the extractor, by name. The widget's+ * card, the drop box and the review's Files row are all found by the name.+ */+export const BOOKING_EML = 'gracery-confirmation.eml'+export const FLIGHT_EML = 'nh203-eticket.eml'++/**+ * A confirmation mail the way a provider's system sends one: an HTML body+ * that carries the reservation as schema.org JSON-LD beside the text a person+ * reads. The structured block is what the extractor reads; the plain-text+ * mail this used to be parsed to nothing, because KDE Itinerary only knows+ * structured tickets and the vendors it has templates for.+ *+ * Written on every call rather than on first use: the dates are offsets from+ * the picture day (`e2e/dates.ts`), so a file left over from an earlier run+ * would carry that run's dates into this one's pictures.+ */+function emlFixture(+ name: string,+ headers: { from: string; subject: string; date: string },+ jsonLd: Record<string, unknown>,+ html: string[],+): string {const dir = path.join(process.cwd(), 'e2e', '.tmp')mkdirSync(dir, { recursive: true })- const file = path.join(dir, 'gracery-confirmation.eml')- if (existsSync(file)) return file- writeFileSync(- file,+ const file = path.join(dir, name)+ const mail = [+ `From: ${headers.from}`,+ 'To: [email protected]',+ `Subject: ${headers.subject}`,+ `Date: ${headers.date}`,+ 'MIME-Version: 1.0',+ 'Content-Type: text/html; charset=utf-8',+ 'Content-Transfer-Encoding: 7bit',+ '',+ '<!DOCTYPE html>',+ '<html><head><meta charset="utf-8">',+ `<title>${headers.subject}</title>`,+ '<script type="application/ld+json">',+ JSON.stringify(jsonLd, null, 2),+ '</script>',+ '</head><body>',+ ...html,+ '</body></html>',+ '',+ ].join('\n')+ // One line ending for the whole mail, headers and body alike.+ writeFileSync(file, mail.replace(/\r?\n/g, '\r\n'), 'utf8')+ return file+}++/**+ * The hotel confirmation the Bookings import guide hands to the extractor:+ * the Granvia stay `booking-hotel` books by hand, nights 5 to 8 of the trip,+ * as a LodgingReservation with the address, the coordinates, the phone, the+ * website and the price, everything `mapLodging` and the review form read.+ * The venue name is the trip place `ensureBookingsFixtures` creates, so the+ * form pre-selects it under Accommodation.+ */+export function bookingEmlFixture(): string {+ return emlFixture(+ BOOKING_EML,+ {+ from: '[email protected]',+ subject: `Your reservation is confirmed - ${HOTEL_TO_BOOK.name}`,+ date: mailHeaderDate(-20, '09:12', '+0900'),+ },+ {+ '@context': 'http://schema.org',+ '@type': 'LodgingReservation',+ reservationNumber: 'GRK-40218',+ reservationStatus: 'http://schema.org/ReservationConfirmed',+ underName: { '@type': 'Person', name: 'Mira Lindberg' },+ reservationFor: {+ '@type': 'LodgingBusiness',+ name: HOTEL_TO_BOOK.name,+ address: {+ '@type': 'PostalAddress',+ streetAddress: 'Shiokoji-sagaru, Karasuma-dori',+ addressLocality: 'Kyoto',+ postalCode: '600-8216',+ addressCountry: 'JP',+ },+ geo: { '@type': 'GeoCoordinates', latitude: HOTEL_TO_BOOK.lat, longitude: HOTEL_TO_BOOK.lng },+ telephone: '+81 75 344 8888',+ url: 'https://www.granviakyoto.example/',+ },+ checkinTime: `${at(-5, '15:00')}+09:00`,+ checkoutTime: `${at(-2, '11:00')}+09:00`,+ totalPrice: '84000',+ priceCurrency: 'JPY',+ },[- 'From: [email protected]',- 'To: [email protected]',- 'Subject: Your reservation is confirmed - Hotel Granvia Kyoto',- 'Date: Tue, 1 Sep 2026 09:12:00 +0900',- 'MIME-Version: 1.0',- 'Content-Type: text/plain; charset=utf-8',- '',- 'Booking reference: GRK-40218',- 'Hotel Granvia Kyoto, Shiokoji-sagaru, Karasuma-dori, Shimogyo-ku, Kyoto',- 'Check-in: Wednesday 16 September 2026, from 15:00',- 'Check-out: Saturday 19 September 2026, until 11:00',- 'Guests: 2 Room: Twin, non-smoking',- 'Total: JPY 84000',- '',- ].join('\r\n'),- 'utf8',+ '<p>Dear Ms Lindberg,</p>',+ `<p>Thank you for choosing ${HOTEL_TO_BOOK.name}. Your reservation is confirmed.</p>`,+ '<table>',+ '<tr><td>Booking reference</td><td>GRK-40218</td></tr>',+ `<tr><td>Check-in</td><td>${emlDate(-5)}, from 15:00</td></tr>`,+ `<tr><td>Check-out</td><td>${emlDate(-2)}, until 11:00</td></tr>`,+ '<tr><td>Guests</td><td>2</td></tr>',+ '<tr><td>Room</td><td>Twin, non-smoking</td></tr>',+ '<tr><td>Total</td><td>JPY 84,000</td></tr>',+ '</table>',+ `<p>${HOTEL_TO_BOOK.name}, ${HOTEL_TO_BOOK.address} 600-8216<br>Tel. +81 75 344 8888</p>`,+ ],+ )+}++/**+ * The flight the Transports import guide reads: the way home on the trip's+ * last day, Haneda to Frankfurt. The seed's own flight is LH716 out, and the+ * AirTrail fixture brings LH717 and NH16 back, so this one is none of those.+ * The mapper builds the title from airline and number, so a guide finds the+ * card by the booking code, which is the fixture's own.+ */+export const FLIGHT_TO_IMPORT = {+ airline: 'All Nippon Airways',+ iata: 'NH',+ number: '203',+ code: 'NH9M4LT',+ from: { iata: 'HND', name: 'Tokyo Haneda International Airport', city: 'Tokyo Haneda' },+ to: { iata: 'FRA', name: 'Frankfurt Main Airport', city: 'Frankfurt' },+}++/**+ * The e-ticket as a FlightReservation: both airports by IATA code, which+ * `mapFlight` resolves through the built-in airport table, so the review opens+ * Add transport with both ends placed; departure in Tokyo's offset, arrival+ * in Frankfurt's, both on the last day of the trip.+ */+export function flightEmlFixture(): string {+ const f = FLIGHT_TO_IMPORT+ return emlFixture(+ FLIGHT_EML,+ {+ from: '[email protected]',+ subject: `Your e-ticket itinerary - ${f.iata} ${f.number} ${f.from.city} to ${f.to.city}`,+ date: mailHeaderDate(-30, '14:40', '+0900'),+ },+ {+ '@context': 'http://schema.org',+ '@type': 'FlightReservation',+ reservationNumber: f.code,+ reservationStatus: 'http://schema.org/ReservationConfirmed',+ underName: { '@type': 'Person', name: 'Mira Lindberg' },+ reservationFor: {+ '@type': 'Flight',+ flightNumber: f.number,+ airline: { '@type': 'Airline', name: f.airline, iataCode: f.iata },+ departureAirport: { '@type': 'Airport', name: f.from.name, iataCode: f.from.iata },+ departureTime: `${at(0, '11:20')}+09:00`,+ arrivalAirport: { '@type': 'Airport', name: f.to.name, iataCode: f.to.iata },+ arrivalTime: `${at(0, '17:05')}+02:00`,+ },+ },+ [+ '<p>Dear Ms Lindberg,</p>',+ `<p>Your booking ${f.code} is confirmed. This is your e-ticket itinerary.</p>`,+ '<table>',+ `<tr><td>Flight</td><td>${f.iata} ${f.number}, operated by ${f.airline}</td></tr>`,+ `<tr><td>From</td><td>${f.from.city} (${f.from.iata}), ${emlDate(0)}, 11:20</td></tr>`,+ `<tr><td>To</td><td>${f.to.city} (${f.to.iata}), ${emlDate(0)}, 17:05</td></tr>`,+ '<tr><td>Passenger</td><td>Mira Lindberg</td></tr>',+ '<tr><td>Class</td><td>Economy</td></tr>',+ '</table>',+ ],)- return file}/** One card of every type the Bookings tab can hold, by title. */@@ -841,32 +1136,32 @@ const BOOKING_FIXTURES: BookingFixture[] = [{// No place on purpose: picking one is what `link-booking` does.title: 'teamLab Planets timed entry', type: 'event', status: 'pending', place: null,- reservation_time: '2026-09-12T14:00:00', reservation_end_time: '2026-09-12T16:00:00',+ reservation_time: at(-9, '14:00'), reservation_end_time: at(-9, '16:00'),confirmation_number: 'TL-88213', location: '6-1-16 Toyosu, Koto City, Tokyo',url: 'https://www.teamlab.art/e/planets/',notes: 'Barefoot from the entrance. Bring shorts, the water room is knee-deep.',},{title: 'Fushimi Inari night walk', type: 'tour', status: 'confirmed', place: 'Fushimi Inari Taisha',- reservation_time: '2026-09-16T18:30:00', reservation_end_time: '2026-09-16T21:00:00',+ reservation_time: at(-5, '18:30'), reservation_end_time: at(-5, '21:00'),confirmation_number: 'KY-4471', location: '68 Fukakusa Yabunouchicho, Fushimi Ward, Kyoto',url: null, notes: null,},{title: 'Kyoto Cycling Tour', type: 'tour', status: 'pending', place: null,- reservation_time: '2026-09-18T09:30:00', reservation_end_time: '2026-09-18T13:00:00',+ reservation_time: at(-3, '09:30'), reservation_end_time: at(-3, '13:00'),confirmation_number: 'KCT-1177', location: 'Kyoto Station, Karasuma exit',url: null, notes: null,},{title: 'Haneda Airport P4', type: 'parking', status: 'pending', place: null,- reservation_time: '2026-09-12T10:00:00', reservation_end_time: '2026-09-21T22:00:00',+ reservation_time: at(-9, '10:00'), reservation_end_time: at(0, '22:00'),confirmation_number: 'HP4-2209', location: 'Haneda Airport Terminal 3, Ota City, Tokyo',url: null, notes: null,},{title: 'Luggage forwarding to Kyoto', type: 'other', status: 'pending', place: null,- reservation_time: '2026-09-16T09:00:00', reservation_end_time: null,+ reservation_time: at(-5, '09:00'), reservation_end_time: null,confirmation_number: 'YMT-30915', location: 'Takkyubin counter, Shinjuku',url: null, notes: 'Two suitcases, delivered by 17:00 the next day.',},@@ -976,7 +1271,7 @@ interface ListsTodo {}const LISTS_TODOS: ListsTodo[] = [- { name: 'Confirm ryokan check-in time', category: 'Before departure', due_date: '2026-09-25', priority: 3, mine: true },+ { name: 'Confirm ryokan check-in time', category: 'Before departure', due_date: day(4), priority: 3, mine: true },{ name: 'Buy a Suica top-up', category: 'On arrival', done: true },]@@ -1047,7 +1342,7 @@ const UNPAID_EXPENSE = {category: 'transport',total_price: 12000,currency: 'JPY',- expense_date: '2026-09-13',+ expense_date: day(-8),note: 'Nobody has booked it yet, so this is the counter fare for three.',}@@ -1080,7 +1375,7 @@ const FILE_PDFS = {},'LH716-boarding-pass': {title: 'Boarding pass LH716',- lines: ['Frankfurt FRA to Tokyo Haneda HND', '12 Sep 2026, boarding 12:20, gate A34', 'Seat 34K, window', 'Booking reference LH-4QK2PZ'],+ lines: ['Frankfurt FRA to Tokyo Haneda HND', `${short(-9)}, boarding 12:20, gate A34`, 'Seat 34K, window', 'Booking reference LH-4QK2PZ'],},'old-draft-itinerary': {title: 'Itinerary, first draft',@@ -1199,11 +1494,10 @@ const tmpDir = (): string => {* A one-page PDF, written by hand because no PDF library is a dependency here.* Five objects and an xref table whose offsets are counted off the assembled* buffer; everything in it is ASCII, so bytes and characters are the same thing.+ * Exported for the document-sync guide, which puts two of these into the store+ * (`external.ts`) rather than into the trip.*/-export function filesPdfFixture(id: keyof typeof FILE_PDFS): string {- const file = path.join(tmpDir(), `${id}.pdf`)- if (existsSync(file)) return file- const { title, lines } = FILE_PDFS[id]+export function drawPdf(title: string, lines: readonly string[]): Buffer {const escape = (s: string) => s.replace(/([\\()])/g, '\\$1')const content = [`BT /F1 26 Tf 64 752 Td (${escape(title)}) Tj ET`,@@ -1226,7 +1520,18 @@ export function filesPdfFixture(id: keyof typeof FILE_PDFS): string {pdf += `xref\n0 ${objects.length + 1}\n0000000000 65535 f \n`for (const offset of offsets) pdf += `${String(offset).padStart(10, '0')} 00000 n \n`pdf += `trailer\n<< /Size ${objects.length + 1} /Root 1 0 R >>\nstartxref\n${startxref}\n%%EOF\n`- writeFileSync(file, pdf, 'latin1')+ return Buffer.from(pdf, 'latin1')+}++/**+ * One of the trip's PDFs as a file in `e2e/.tmp`. Drawn on every call: the+ * boarding pass names its day, which is relative to the picture day, so a+ * file left over from an earlier run would carry that run's date.+ */+export function filesPdfFixture(id: keyof typeof FILE_PDFS): string {+ const file = path.join(tmpDir(), `${id}.pdf`)+ const { title, lines } = FILE_PDFS[id]+ writeFileSync(file, drawPdf(title, lines))return file}@@ -1389,8 +1694,8 @@ export async function ensureCollabFixtures(api: APIRequestContext): Promise<voidif (!voted.ok()) throw new Error(`could not vote on the spare poll: ${voted.status()} ${await voted.text()}`)// What's Next lists a stop on a later day, or one on today whose start has not- // passed yet. The trip's last day IS today on the seed's dates, so both stops- // go there and the time is computed from the clock at fixture time.+ // passed yet. The trip's last day is the picture day by construction, so both+ // stops go there and the time is computed from the pinned clock.const lastDay = dayIds[dayIds.length - 1]const placesRes = await api.get(`/api/trips/${tripId}/places`)const placesBody = (await placesRes.json()) as { places?: { id: number; name: string }[] } | { id: number; name: string }[]diff --git a/client/e2e/help/guide.ts b/client/e2e/help/guide.tsindex a525f1509..88135f7ad 100644--- a/client/e2e/help/guide.ts+++ b/client/e2e/help/guide.ts@@ -1,4 +1,5 @@import { expect, type Locator, type Page } from '@playwright/test'+import { PICTURE_DAY_ISO } from '../dates'import { mkdirSync } from 'node:fs'import path from 'node:path'import type { HelpGuide } from '../../src/help/types'@@ -30,17 +31,18 @@ export const OUT_DIR = path.join(process.cwd(), 'e2e', '.tmp', 'help-media')export const VIEWPORT = { width: 1920, height: 1080 }/**- * The day every picture is taken on.+ * The instant every picture is taken at: nine in the morning, UTC, on the+ * picture day (`e2e/dates.ts`), which is the seeded trip's last day.*- * The seeded trip runs to 2026-09-21, and a picture of it has to look the same- * whoever runs this and whenever: a day later the trip is over, My Trips moves- * it out of the boarding pass and into the grid, What's Next has nothing left- * to list, and the forecast for a day in the past is not a forecast. Only the- * browser's `Date` is pinned, so timers keep running and nothing that waits- * stops waiting; the server keeps its own clock, which none of the pictures- * read.+ * A picture has to look the same whoever runs this and whenever, and the seed+ * is relative to that day, so the browser's clock is pinned to it: were it+ * left on the wall clock, a run late in the evening would see the trip's last+ * stops in the past, and What's Next would have nothing left to list. Only+ * the browser's `Date` is pinned, so timers keep running and nothing that+ * waits stops waiting; the server keeps its own clock, which none of the+ * pictures read.*/-export const PICTURE_DAY = new Date('2026-09-21T09:00:00.000Z')+export const PICTURE_DAY = new Date(`${PICTURE_DAY_ISO}T09:00:00.000Z`)/** Put the page on the day the pictures are taken on. Call before navigating. */async function pinClock(page: Page): Promise<void> {diff --git a/client/e2e/help/media.env.example b/client/e2e/help/media.env.examplenew file mode 100644index 000000000..39d0bdf8d--- /dev/null+++ b/client/e2e/help/media.env.example@@ -0,0 +1,30 @@+# Copy to e2e/help/media.env (not committed). Only the guides that show+# another service need these; every other guide runs without the file.+#+# The addresses must be the machine's LAN address: TREK's SSRF guard refuses+# loopback whatever the flags say, and the two lines at the bottom let the+# media backend reach a private network and find the booking extractor.++# AirTrail (Transports: Import from AirTrail). Key from Settings > Security.+HELP_MEDIA_AIRTRAIL_URL=http://192.168.1.10:3020+HELP_MEDIA_AIRTRAIL_API_KEY=++# Dawarich (Map: recorded route; Atlas: countries and wishes). Key from Account > API key.+HELP_MEDIA_DAWARICH_URL=http://192.168.1.10:3000+HELP_MEDIA_DAWARICH_API_KEY=++# Nextcloud (Files: Document sync). An app password, not the account password.+HELP_MEDIA_NEXTCLOUD_URL=http://192.168.1.10:8803+HELP_MEDIA_NEXTCLOUD_USER=admin+HELP_MEDIA_NEXTCLOUD_PASSWORD=++# For the media backend (client/e2e/server-launch.mjs passes the environment on).+ALLOW_INTERNAL_NETWORK=true+# The booking extractor. On Linux the package's binary; on Windows a small+# program that runs it in the TREK Docker image (see README).+KITINERARY_EXTRACTOR_PATH=/usr/lib/x86_64-linux-gnu/libexec/kf6/kitinerary-extractor++# Optional: the day the seed and the pictures are relative to (YYYY-MM-DD).+# Unset, every run takes today. Pin it while a picture set is made over+# several runs, so every run shows the same calendar.+# E2E_PICTURE_DAY=diff --git a/client/e2e/help/run.mjs b/client/e2e/help/run.mjsindex 87029dc70..e4ecaa7d3 100644--- a/client/e2e/help/run.mjs+++ b/client/e2e/help/run.mjs@@ -6,12 +6,47 @@// Extra arguments go straight to Playwright, e.g.// npm run help:media -- --grep "pictures"import { spawnSync } from 'node:child_process'+import { existsSync, readFileSync } from 'node:fs'import { createRequire } from 'node:module'+import path from 'node:path'+// The guides that show another service (AirTrail, Dawarich, a document store,+// the booking extractor) take its address and key from e2e/help/media.env,+// KEY=VALUE per line, which is not committed. media.env.example lists them.+// The file is read here so the backend inherits it too (server-launch.mjs+// spreads this environment): ALLOW_INTERNAL_NETWORK and the extractor path+// live in the same place.+function mediaEnv() {+ const file = path.join(process.cwd(), 'e2e', 'help', 'media.env')+ if (!existsSync(file)) return {}+ const out = {}+ for (const raw of readFileSync(file, 'utf8').split(/\r?\n/)) {+ const line = raw.trim()+ if (!line || line.startsWith('#')) continue+ const eq = line.indexOf('=')+ if (eq < 1) continue+ out[line.slice(0, eq).trim()] = line.slice(eq + 1).trim().replace(/^"(.*)"$/, '$1')+ }+ return out+}++// The day the pictures are taken on, fixed once for the whole run so the seed+// project and every worker agree even across midnight (see e2e/dates.ts).+function today() {+ const d = new Date()+ const pad = n => String(n).padStart(2, '0')+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`+}++const fromFile = mediaEnv()const env = {+ ...fromFile,...process.env,E2E_WEB_PORT: process.env.E2E_WEB_PORT || '5183',E2E_API_PORT: process.env.E2E_API_PORT || '3011',+ // The shell wins, then media.env (a day pinned there keeps a picture set+ // consistent across several runs), then today.+ E2E_PICTURE_DAY: process.env.E2E_PICTURE_DAY || fromFile.E2E_PICTURE_DAY || today(),}// The CLI's own entry, run by this node: no shell in between, so a --grep// pattern with a `|` reaches Playwright untouched.diff --git a/client/e2e/help/trip-bookings.guide.ts b/client/e2e/help/trip-bookings.guide.tsindex 8e619cf26..c034c4ed6 100644--- a/client/e2e/help/trip-bookings.guide.ts+++ b/client/e2e/help/trip-bookings.guide.ts@@ -1,7 +1,9 @@import { test, expect, type Locator, type Page } from '@playwright/test'import { captureGuide, captureHero, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'-import { seededTrip, ensureBookingsFixtures, bookingPdfFixture, bookingEmlFixture, HOTEL_TO_BOOK, UNATTACHED_FILE } from './fixtures'-import { openTrip, modal, portalDialog } from './trip-shared'+import { dotted } from '../dates'+import { seededTrip, ensureBookingsFixtures, bookingPdfFixture, bookingEmlFixture, BOOKING_EML, HOTEL_TO_BOOK, UNATTACHED_FILE } from './fixtures'+import { openTrip, modal, dialog, portalDialog, importSteps, importTask, dismissImportTask, deleteTripFiles } from './trip-shared'+import { requireExtractor, allowEmlUploads } from './external'import { tripBookingsContext, tripBookingsGuides } from '../../src/help/contexts/tripBookings'import type { HelpGuide } from '../../src/help/types'@@ -55,10 +57,6 @@ const travellers = (page: Page) => page.locator('[aria-label="Travelers"]')/** The card's delete question is its own portal, with no backdrop class to find it by. */const deleteAsk = (page: Page) => portalDialog(page, page.getByText('Delete booking?', { exact: true }))-/** BookingImportModal is another bare portal; the heading is what tells it apart. */-const importDialog = (page: Page) => portalDialog(page, page.getByText('Import booking confirmations', { exact: true }))-/** The background widget's card for the running parse. */-const importTask = (page: Page) => page.locator('.bg-surface-card').filter({ hasText: 'gracery-confirmation.eml' }).last()/** Open the CustomSelect that belongs to a label and take one option out of it. */async function chooseIn(page: Page, field: RegExp, option: RegExp, search?: string): Promise<void> {@@ -128,15 +126,6 @@ async function clearPanelState(page: Page): Promise<void> {}, tripId)}-/**- * Import from file is rendered only when the server can read a confirmation,- * which here means the AI Parsing addon: no extractor binary is installed.- */-async function setAiParsing(page: Page, enabled: boolean): Promise<void> {- const res = await page.request.put('/api/admin/addons/llm_parsing', { data: { enabled } })- if (!res.ok()) throw new Error(`could not switch AI Parsing ${enabled ? 'on' : 'off'}: ${res.status()} ${await res.text()}`)-}-const closeModal = async (page: Page): Promise<void> => {if (await modal(page).isVisible().catch(() => false)) {await page.keyboard.press('Escape')@@ -179,9 +168,9 @@ const SCRIPTS: Record<string, GuideScript> = {},{prepare: async p => {- await setDate(p, 0, '19.09.2026')+ await setDate(p, 0, dotted(-2))await timeBox(p).nth(0).fill('16:30')- await setDate(p, 1, '19.09.2026')+ await setDate(p, 1, dotted(-2))await timeBox(p).nth(1).fill('20:00')await settle(p)},@@ -503,58 +492,54 @@ const SCRIPTS: Record<string, GuideScript> = {},'import-booking-file': {guide: guide('import-booking-file'),+ // The extractor, and no addon: with it answering, the dialog sends mode+ // no-ai and no model is asked. The mail has to be an allowed file type or+ // the review would save the booking and drop the document without a word.start: async p => {- await setAiParsing(p, true)+ await requireExtractor(p.request)+ await allowEmlUploads(p.request, true)await openBookings(p)},steps: [- {- target: p => p.getByRole('button', { name: 'Import from file' }),- act: async p => {- await p.getByRole('button', { name: 'Import from file' }).click()- await expect(importDialog(p)).toBeVisible()- await settle(p)- },- },+ ...importSteps(bookingEmlFixture, BOOKING_EML),{prepare: async p => {- await importDialog(p).locator('input[type="file"]').setInputFiles(bookingEmlFixture())- await expect(importDialog(p).getByText('gracery-confirmation.eml')).toBeVisible()+ // The card is there at once, spinning. The picture wants it finished:+ // the tick and the Import it offers. The extractor has 30 s in the+ // backend, and on a Windows media host that is a docker run, so the+ // wait is generous rather than tight.+ await expect(importTask(p, BOOKING_EML).getByRole('button', { name: 'Import', exact: true })).toBeVisible({ timeout: 90_000 })await settle(p)},- target: p => importDialog(p).getByText('gracery-confirmation.eml').locator('xpath=ancestor::button[1]'),- act: settle,- },- {- target: p => importDialog(p).getByRole('button', { name: 'Import', exact: true }),+ target: p => importTask(p, BOOKING_EML),act: async p => {- await importDialog(p).getByRole('button', { name: 'Import', exact: true }).click()- await expect(importDialog(p)).toHaveCount(0, { timeout: 20_000 })+ await importTask(p, BOOKING_EML).getByRole('button', { name: 'Import', exact: true }).click()+ await expect(modal(p).getByRole('heading', { name: 'New Reservation' })).toBeVisible({ timeout: 20_000 })+ await expect(titleBox(p)).toHaveValue(HOTEL_TO_BOOK.name)+ await expect(codeBox(p)).toHaveValue('GRK-40218')+ await expect(modal(p).getByText(BOOKING_EML)).toBeVisible()await settle(p)},},{- prepare: async p => {- await expect(importTask(p)).toBeVisible({ timeout: 30_000 })+ target: dialog,+ act: async p => {+ await saveButton(p, 'Add').click()+ await expect(modal(p)).toHaveCount(0, { timeout: 20_000 })+ await expect(bookingCard(p, HOTEL_TO_BOOK.name)).toBeVisible({ timeout: 20_000 })await settle(p)},- target: importTask,- act: settle,},],cleanup: async p => {- // The widget only offers its Close once the run has stopped, and a card- // left standing would sit in the corner of every later guide's pictures.- // The wait is bounded well inside the 150 s a help-media test gets- // (playwright.config.ts): the four steps take about 40 s of it, so a- // longer one would fail the whole guide over a card nobody can close.- const close = importTask(p).getByRole('button', { name: 'Close' })- await close.waitFor({ state: 'visible', timeout: 45_000 }).catch(() => {})- if (await close.isVisible().catch(() => false)) await close.click()- await setAiParsing(p, false)+ await closeModal(p)+ await dismissImportTask(p, BOOKING_EML)+ await allowEmlUploads(p.request, false)await clearPanelState(p)- // A parse that did produce something would have left its bookings behind.- await deleteBookings(p, 'Hotel Granvia Kyoto')+ // The route takes the stay and the expense with the booking; the mail it+ // attached stays behind in Files like any unlinked document.+ await deleteBookings(p, HOTEL_TO_BOOK.name)+ await deleteTripFiles(p, BOOKING_EML)},},'edit-booking': {diff --git a/client/e2e/help/trip-collab.guide.ts b/client/e2e/help/trip-collab.guide.tsindex 61efa1776..027d426ac 100644--- a/client/e2e/help/trip-collab.guide.ts+++ b/client/e2e/help/trip-collab.guide.ts@@ -1,5 +1,7 @@import { test, expect, type Locator, type Page } from '@playwright/test'import { captureGuide, captureHero, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'+import { ordinal, short } from '../dates'+import { SEED_CHAT } from '../screenshots/seed'import { seededTrip, ensureCollabFixtures, COLLAB_SPARE_POLL, WHATS_NEXT_STOPS } from './fixtures'import { openTrip } from './trip-shared'import { tripCollabContext, tripCollabGuides } from '../../src/help/contexts/tripCollab'@@ -34,7 +36,7 @@ const POLL = {// Plain text on purpose: a bold run in the question would wrap the paragraph// in one more element and move the card away from `pollCard`'s ancestor depth.question: 'Which evening do we keep for the kaiseki dinner?',- options: ['Wed 16th, after Fushimi Inari', 'Thu 17th, after Arashiyama', 'Either, decide on the day'],+ options: [`${short(-5).split(',')[0]} ${ordinal(-5)}, after Fushimi Inari`, `${short(-4).split(',')[0]} ${ordinal(-4)}, after Arashiyama`, 'Either, decide on the day'],}/** The seeded poll nobody has voted on yet. */const SEEDED_POLL = 'Ryokan or city hotel in Hakone?'@@ -45,7 +47,7 @@ const CHAT = {flag: '🎌',theirs: 'Drop bags. I want to be at Senso-ji before the crowds.',answer: 'Agreed, bags at the hotel first, then Asakusa.',- reactTo: 'Booked the teamLab slot for the 13th, 14:00.',+ reactTo: SEED_CHAT.teamlab,reaction: '👍',}diff --git a/client/e2e/help/trip-costs.guide.ts b/client/e2e/help/trip-costs.guide.tsindex 23fc08c7d..ed22a466a 100644--- a/client/e2e/help/trip-costs.guide.ts+++ b/client/e2e/help/trip-costs.guide.ts@@ -1,5 +1,6 @@import { test, expect, type Locator, type Page } from '@playwright/test'import { captureGuide, captureHero, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'+import { day, long, short } from '../dates'import { seededTrip, ensureCostsFixtures } from './fixtures'import { openTrip, modal, dialog } from './trip-shared'import { tripCostsContext, tripCostsGuides } from '../../src/help/contexts/tripCosts'@@ -28,7 +29,7 @@ const SEEDED_EUR = 'Flights FRA → HND'const BOOKING = 'LH716 FRA → HND'const DINNER = 'Kaiseki dinner in Gion'const UPGRADE = 'Shinkansen seat upgrade'-const LUNCH = { name: 'Nishiki Market lunch', category: 'food', total_price: 4800, currency: 'JPY', expense_date: '2026-09-17' }+const LUNCH = { name: 'Nishiki Market lunch', category: 'food', total_price: 4800, currency: 'JPY', expense_date: day(-4) }/** The Costs tab, waited out: its panel is lazy and its figures come from the server. */const openCosts = async (p: Page): Promise<void> => {@@ -391,16 +392,16 @@ const SCRIPTS: Record<string, GuideScript> = {prepare: async p => {await p.getByRole('button', { name: 'All days' }).first().click()await beat(p, 300)- await dropdown(p).getByRole('button', { name: 'Sat, Sep 12' }).click()- await expect(p.getByText(/^Saturday, September 12$/)).toBeVisible()+ await dropdown(p).getByRole('button', { name: short(-9) }).click()+ await expect(p.getByText(new RegExp(`^${long(-9)}$`))).toBeVisible()await settle(p)},- target: p => p.getByText(/^Saturday, September 12$/).locator('xpath=../..'),+ target: p => p.getByText(new RegExp(`^${long(-9)}$`)).locator('xpath=../..'),act: async p => {- await p.getByRole('button', { name: 'Sat, Sep 12' }).first().click()+ await p.getByRole('button', { name: short(-9) }).first().click()await beat(p, 300)await dropdown(p).getByRole('button', { name: 'All days' }).click()- await expect(p.getByText(/^Saturday, September 12$/)).toHaveCount(0)+ await expect(p.getByText(new RegExp(`^${long(-9)}$`))).toHaveCount(0)await settle(p)},},diff --git a/client/e2e/help/trip-files.guide.ts b/client/e2e/help/trip-files.guide.tsindex d02492da9..226a3ca18 100644--- a/client/e2e/help/trip-files.guide.ts+++ b/client/e2e/help/trip-files.guide.ts@@ -1,7 +1,8 @@import { test, expect, type Page, type Locator } from '@playwright/test'-import { captureGuide, captureHero, typeInto, settle, VIEWPORT, type GuideScript } from './guide'-import { seededTrip, ensureFilesFixtures, filesPdfFixture, filesImageFixture } from './fixtures'-import { openTrip, portalDialog } from './trip-shared'+import { captureGuide, captureHero, typeInto, beat, settle, VIEWPORT, type GuideScript } from './guide'+import { seededTrip, ensureFilesFixtures, filesPdfFixture, filesImageFixture, drawPdf } from './fixtures'+import { openTrip, portalDialog, modal, dialog } from './trip-shared'+import { ensureNextcloudFolder, NEXTCLOUD_CONNECTION, NEXTCLOUD_DOCUMENTS, NEXTCLOUD_FOLDER, resetDocSync, toggleAddon } from './external'import { tripFilesContext, tripFilesGuides } from '../../src/help/contexts/tripFiles'import type { HelpGuide } from '../../src/help/types'@@ -24,7 +25,6 @@ const STARRED = 'JR-Pass-voucher.pdf'const LINKED = 'LH716-boarding-pass.pdf'const DOOMED = 'old-draft-itinerary.pdf'const PHOTO = 'nishiki-market.jpg'-const DOCUMENT = 'travel-notes.md'/** What the upload guide brings in; these two names exist nowhere else, so cleanup can take them out. */const UPLOADED_PDF = 'kyoto-bus-pass.pdf'const UPLOADED_PHOTO = 'arashiyama.jpg'@@ -66,14 +66,40 @@ const noteBox = (page: Page) => assignDialog(page).getByPlaceholder('Add a note.*/const lightbox = (page: Page) =>page.locator('div[role="presentation"]').filter({ has: page.getByRole('button', { name: 'Open in new tab' }) }).first()-/** The preview for everything that is not a picture; markdown renders in `.collab-note-md`. */-const docPreview = (page: Page) => portalDialog(page, page.locator('.collab-note-md'))+/**+ * The preview for everything that is not a picture. For a PDF it is the card+ * around the browser's embedded viewer, found by the one `<object>` only it+ * renders; the markdown preview (`.collab-note-md`) has no step of its own.+ */+const pdfPreview = (page: Page) => portalDialog(page, page.locator('object[type="application/pdf"]'))+const pdfViewer = (page: Page) => pdfPreview(page).locator('object[type="application/pdf"]')/*** The × of a portal. The assign dialog and the document preview have no key* handler at all, so it is their only way out; the lightbox does listen for* Escape, which is what its own step uses.*/const closeX = (dialog: Locator) => dialog.locator('button:has(svg.lucide-x)').first()+/** The toolbar's way into document sync; there only while a store is on offer (see beforeAll). */+const syncButton = (page: Page) => page.getByRole('button', { name: 'Document sync', exact: true })+/** The dialog's title carries the trip's name under it, so the heading is matched by its first line. */+const syncTitle = (page: Page) => modal(page).getByRole('heading', { name: /^Document sync/ })+/**+ * A store row in the dialog's sidebar. Its accessible name runs on into the+ * subtitle (Files in a folder), so it is matched by its start.+ */+const storeRow = (page: Page, name: string) => modal(page).getByRole('button', { name: new RegExp(`^${name}\\b`) })+/**+ * A box of the connection form, by the placeholder the store's field carries.+ * The labels are no good as locators here: the hint under Username says+ * "email address", so a lookup by the label Address finds two boxes.+ */+const formBox = (page: Page, placeholder: string) => dialog(page).getByPlaceholder(placeholder, { exact: true })+/** The folder picker's row for the folder the fixture put in the store; the Create button is not in a list. */+const folderRow = (page: Page) => dialog(page).locator('li button').filter({ hasText: NEXTCLOUD_FOLDER }).first()+/** The binding card, the one <article> in the dialog once a store is bound. */+const bindingCard = (page: Page) => dialog(page).locator('article').first()+/** Reads Syncing, disabled, while a run is going; the locator waits it out. */+const syncNow = (page: Page) => bindingCard(page).getByRole('button', { name: 'Sync now' })interface ApiFile {id: number@@ -345,15 +371,31 @@ const SCRIPTS: Record<string, GuideScript> = {},},{+ // A PDF this time rather than the markdown file: the browser's own+ // viewer draws the page inside the card, which is what a reader sees+ // for a ticket. The card gets its source only once the signed download+ // link is minted (useFileManager.ts: getAuthUrl → setPreviewFileUrl),+ // and no DOM event says when the viewer has painted, so the step waits+ // for the file's own response and then a moment more, as the satellite+ // step of the map guide does for its tiles.prepare: async p => {- await row(p, DOCUMENT).getByRole('button', { name: DOCUMENT }).last().click()- await expect(docPreview(p)).toBeVisible({ timeout: 30_000 })+ const fetched = p+ .waitForResponse(r => r.url().includes('/download?token=') && r.ok(), { timeout: 30_000 })+ .catch(() => null)+ await row(p, LINKED).getByRole('button', { name: LINKED }).last().click()+ await expect(pdfPreview(p)).toBeVisible({ timeout: 30_000 })+ await expect(pdfViewer(p)).toHaveAttribute('data', /\/download\?token=.+#view=FitH$/, { timeout: 30_000 })+ await fetched+ // The fallback link inside the <object> is drawn only where the+ // browser has no viewer; hidden, it proves the picture shows a page.+ await expect(pdfPreview(p).getByRole('button', { name: 'Download PDF' })).toBeHidden()await settle(p)+ await p.waitForTimeout(1500)},- target: docPreview,+ target: pdfPreview,act: async p => {- await closeX(docPreview(p)).click()- await expect(docPreview(p)).toHaveCount(0, { timeout: 20_000 })+ await closeX(pdfPreview(p)).click()+ await expect(pdfPreview(p)).toHaveCount(0, { timeout: 20_000 })await settle(p)},},@@ -422,6 +464,110 @@ const SCRIPTS: Record<string, GuideScript> = {],cleanup: p => untrashFile(p, DOOMED),},++ 'files-sync': {+ guide: guide('files-sync'),+ // The store's address and app password come from media.env (external.ts).+ // They are read inside the guide rather than at import, so a run without+ // the file fails this one guide and not the whole screen.+ start: async p => {+ const { tripId } = seededTrip()+ await resetDocSync(p.request, tripId)+ await ensureNextcloudFolder(drawPdf)+ await openFiles(p)+ await expect(syncButton(p)).toBeVisible({ timeout: 20_000 })+ },+ steps: [+ {+ target: syncButton,+ act: async p => {+ await syncButton(p).click()+ await expect(syncTitle(p)).toBeVisible({ timeout: 20_000 })+ // The stores arrive after a spinner; the heading over them says the list is in.+ await expect(modal(p).getByText('Connect a provider', { exact: true })).toBeVisible({ timeout: 20_000 })+ await settle(p)+ },+ },+ {+ target: p => storeRow(p, 'Nextcloud'),+ act: async p => {+ await storeRow(p, 'Nextcloud').click()+ // The connection dialog stacks on top, so `modal` is now that one.+ await expect(modal(p).getByRole('heading', { name: 'Nextcloud', exact: true })).toBeVisible({ timeout: 20_000 })+ await expect(formBox(p, 'https://cloud.example.com')).toBeVisible()+ await settle(p)+ },+ },+ {+ prepare: async p => {+ const store = NEXTCLOUD_CONNECTION()+ await typeInto(p, formBox(p, 'https://cloud.example.com'), store.baseUrl)+ await typeInto(p, formBox(p, 'username'), store.credentials.login_name)+ await typeInto(p, formBox(p, 'app password'), store.credentials.app_password)+ await typeInto(p, formBox(p, '/TREK'), store.credentials.base_path)+ await beat(p, 300)+ },+ // The whole form, as the create-user step does: the labels and hints belong in the picture.+ target: dialog,+ },+ {+ target: p => dialog(p).getByRole('button', { name: 'Test connection' }),+ act: async p => {+ await dialog(p).getByRole('button', { name: 'Test connection' }).click()+ await expect(+ dialog(p).getByText(`Reached it, signed in as ${NEXTCLOUD_CONNECTION().credentials.login_name}`),+ ).toBeVisible({ timeout: 30_000 })+ await settle(p)+ },+ },+ {+ // Connect saves the credentials and opens the folder picker on top of+ // the dialog; the picture is the picker, with the folder the reader is+ // told to click, because that is the screen the step is about.+ prepare: async p => {+ await dialog(p).getByRole('button', { name: 'Connect', exact: true }).click()+ await expect(modal(p).getByRole('heading', { name: 'Where should this trip live in Nextcloud?' })).toBeVisible({ timeout: 30_000 })+ await expect(folderRow(p)).toBeVisible({ timeout: 30_000 })+ await settle(p)+ },+ target: folderRow,+ act: async p => {+ await folderRow(p).click()+ await expect(bindingCard(p)).toBeVisible({ timeout: 30_000 })+ await settle(p)+ },+ },+ {+ // Binding starts a run of its own, which the button cannot join: a Sync+ // now while it is going answers busy and moves nothing, and the card+ // only learns of that first run from the ping it sends when it is+ // through. So the click is repeated until the card reports In sync,+ // which is a dot with a title once the state is good.+ prepare: async p => {+ await expect(async () => {+ await syncNow(p).click({ timeout: 15_000 })+ await expect(bindingCard(p).getByTitle('In sync')).toBeVisible({ timeout: 15_000 })+ }).toPass({ timeout: 120_000, intervals: [3_000] })+ await settle(p)+ },+ target: bindingCard,+ act: async p => {+ await p.keyboard.press('Escape')+ await expect(modal(p)).toHaveCount(0, { timeout: 20_000 })+ // The run's file:created events put the pulled documents at the top of the list.+ for (const name of NEXTCLOUD_DOCUMENTS) await expect(row(p, name)).toBeVisible({ timeout: 30_000 })+ await settle(p)+ },+ },+ ],+ cleanup: async p => {+ const { tripId } = seededTrip()+ await resetDocSync(p.request, tripId)+ await removeFiles(p, NEXTCLOUD_DOCUMENTS)+ // The run pushed the trip's own documents into the folder; back to its two.+ await ensureNextcloudFolder(drawPdf)+ },+ },}// ── Run ───────────────────────────────────────────────────────────────────────@@ -430,6 +576,17 @@ test.describe.configure({ mode: 'serial' })test.beforeAll(async ({ request }) => {await ensureFilesFixtures(request)+ // A store on offer puts Document sync next to Trash for the trip's owner,+ // which is how bullet 6 of the screen text describes the toolbar; on for the+ // whole file, so the hero and all seven guides show the same toolbar.+ await toggleAddon(request, 'nextcloud', true)+})++test.afterAll(async ({ request }) => {+ // Instance-wide, not trip-scoped: every store ships off, and the other+ // screens' pictures must not grow the button. Here rather than in the last+ // guide's cleanup, so a failed run puts it back too (as trip-roadtrip does).+ await toggleAddon(request, 'nextcloud', false)})test('every registered files guide has a script, and only those', async () => {diff --git a/client/e2e/help/trip-lists.guide.ts b/client/e2e/help/trip-lists.guide.tsindex b64ad8e63..d29bb432e 100644--- a/client/e2e/help/trip-lists.guide.ts+++ b/client/e2e/help/trip-lists.guide.ts@@ -1,5 +1,6 @@import { test, expect, type Page, type Locator } from '@playwright/test'import { captureGuide, captureHero, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'+import { pickerLabel } from '../dates'import { seededTrip, ensureListsFixtures } from './fixtures'import { openTrip, modal } from './trip-shared'import { tripListsContext, tripListsGuides } from '../../src/help/contexts/tripLists'@@ -36,7 +37,7 @@ const OTHER_TASK_LIST = 'Before departure'const EDITED_TASK = 'Activate JR Pass'const ASSIGNEE = 'jonas'/** The date picker labels a day cell with the whole date, in the run's English. */-const DUE_DAY = 'September 25, 2026'+const DUE_DAY = pickerLabel(4)/** The fixtures' template, and the lists it brings with it. */const TEMPLATE = { name: 'Japan autumn basics', category: 'Rain kit', items: ['Umbrella', 'Quick-dry towel', 'Dry bag', 'SIM card', 'Plug adapter'] }const IMPORT_LINES = 'Toiletries, Toothbrush\nToiletries, Sunscreen, 90\nHealth, Plasters, 30'diff --git a/client/e2e/help/trip-map.guide.ts b/client/e2e/help/trip-map.guide.tsindex 730200d5c..ac693c918 100644--- a/client/e2e/help/trip-map.guide.ts+++ b/client/e2e/help/trip-map.guide.ts@@ -2,6 +2,7 @@ import { test, expect, type Locator, type Page } from '@playwright/test'import { captureGuide, captureHero, settle, typeInto, VIEWPORT, type GuideScript } from './guide'import { seededTrip, ensureMapFixtures } from './fixtures'import { openTrip, openTripOnDay, selectDay, modal } from './trip-shared'+import { ensureDawarichConnection, disconnectDawarich } from './external'import { tripMapContext, tripMapGuides } from '../../src/help/contexts/tripMap'import type { HelpGuide } from '../../src/help/types'@@ -54,6 +55,28 @@ const connection = (page: Page, shown: boolean) =>const allConnections = (page: Page, shown: boolean) =>page.locator(`button[aria-label="${shown ? 'Hide' : 'Show'} all booking routes"]`)const overviewPanel = (page: Page) => page.getByTestId('trip-overview-panel')+/** The round Dawarich button under the whole-trip one; its label is its state. */+const trailPill = (page: Page) => page.getByTestId('dawarich-trail-pill')+/**+ * The recorded route. Leaflet writes the dash pattern onto the path, and "6 5"+ * is this layer's alone: the pending booking routes use "6, 6", the picked+ * alternative "2 7", so the dashed days are the one thing on the map with it.+ */+const trail = (page: Page) => page.locator('#trek-map path[stroke-dasharray="6 5"]')+/**+ * The GL renderer. There is no `#trek-map` on it: `MapViewGL` mounts a bare+ * `div.w-full.h-full` and MapLibre puts its own canvas inside, so the compass+ * guide goes by that class. The map itself is reached through+ * `window.__trek_map`, which `MapViewGL` publishes on build for exactly this.+ */+const glCanvas = (page: Page) => page.locator('.maplibregl-canvas')+/**+ * The compass button and the frosted pill around it. The planner renders the+ * pill twice, once in the desktop cluster beside the category row and once for+ * phones, `md:hidden` at this width; `getByRole` leaves the hidden copy out.+ */+const resetNorth = (page: Page) => page.getByRole('button', { name: 'Reset north' })+const compassPill = (page: Page) => resetNorth(page).locator('xpath=..')/** The sheet a booking's endpoint opens. Its own portal, and the only Close on the plan. */const sheetClose = (page: Page) => page.getByRole('button', { name: 'Close', exact: true })/** A row of the places column. */@@ -157,6 +180,38 @@ async function openOnTokyo(page: Page): Promise<void> {await settle(page)}+/**+ * Which renderer draws the planner and the journals. On the account, not on+ * the trip: `MapViewAuto` reads `settings.map_provider`, and `loadSettings`+ * runs on every page load, so a `page.goto` after this sees the new map.+ */+async function setMapProvider(page: Page, provider: 'leaflet' | 'maplibre-gl'): Promise<void> {+ const res = await page.request.post('/api/settings/bulk', { data: { settings: { map_provider: provider } } })+ if (!res.ok()) throw new Error(`could not set map_provider=${provider}: ${res.status()} ${await res.text()}`)+}++/** The slice of the GL map the compass guide reads and moves, on `window.__trek_map`. */+interface TrekGlMap {+ getBearing: () => number+ getPitch: () => number+ loaded: () => boolean+ areTilesLoaded: () => boolean+ isMoving: () => boolean+ easeTo: (o: { bearing: number; pitch: number; duration: number }) => unknown+}++/** Wait until the GL map has its style, its tiles and a still camera. */+async function glMapIdle(page: Page): Promise<void> {+ await page.waitForFunction(+ () => {+ const m = (window as unknown as { __trek_map?: TrekGlMap }).__trek_map+ return !!m && m.loaded() && m.areTilesLoaded() && !m.isMoving()+ },+ undefined,+ { timeout: 60_000 },+ )+}+async function deleteByName(page: Page, ...names: string[]): Promise<void> {const { tripId } = seededTrip()const res = await page.request.get(`/api/trips/${tripId}/places`)@@ -474,6 +529,119 @@ const SCRIPTS: Record<string, GuideScript> = {await p.evaluate(id => localStorage.removeItem(`trek:visible-connections:${id}`), tripId)},},+ 'map-dawarich-trail': {+ guide: guide('map-dawarich-trail'),+ // Day 1 in Tokyo: at the whole-trip zoom the recording is one dashed line+ // along the Shinkansen and the walks through the cities vanish under the+ // pins, so the map is framed on a day before the button is pressed;+ // nothing fits the map to the trail.+ start: openOnTokyo,+ steps: [+ {+ target: trailPill,+ act: async p => {+ await trailPill(p).click()+ // One read of the trip's dates from the Dawarich, thinned to 600+ // points a day. The label is the reliable signal: anything but Hide+ // (nothing recorded, unreachable, offline) is not a picture worth+ // taking, so the wait fails on it rather than shooting an empty map.+ await expect(trailPill(p)).toHaveAttribute('aria-label', 'Hide recorded route', { timeout: 120_000 })+ await expect(trail(p).first()).toBeAttached({ timeout: 30_000 })+ await settle(p)+ await p.waitForTimeout(600)+ },+ },+ {+ // The whole map: the dashed day under the planned route, with the+ // pointer parked on an empty spot so no pin's card is in the picture.+ target: map,+ hover: async p => {+ const box = await map(p).boundingBox()+ if (!box) throw new Error('the map has no box')+ await p.mouse.move(box.x + EMPTY.x, box.y + EMPTY.y)+ },+ },+ {+ target: p => p.getByTestId('trip-overview-pill'),+ act: async p => {+ await p.getByTestId('trip-overview-pill').click()+ // One router request per leg, paced; the total carries an … until+ // every leg has answered, and the result picture waits for that.+ await expect(overviewPanel(p)).toBeVisible({ timeout: 60_000 })+ await expect(overviewPanel(p)).not.toContainText('…', { timeout: 90_000 })+ await settle(p)+ },+ },+ ],+ cleanup: async p => {+ const off = p.getByRole('button', { name: 'Hide whole trip' })+ if (await off.isVisible().catch(() => false)) await off.click()+ if ((await trailPill(p).getAttribute('aria-pressed').catch(() => null)) === 'true') await trailPill(p).click()+ // Per trip and per browser session; the test's context ends here, but+ // be explicit rather than trust that.+ const { tripId } = seededTrip()+ await p.evaluate(id => sessionStorage.removeItem(`trip-dawarich-${id}`), tripId)+ },+ },++ 'map-compass': {+ guide: guide('map-compass'),+ // The compass only exists on the GL renderers, so the guide switches the+ // account to MapLibre GL (no token, OpenFreeMap tiles) before opening the+ // trip, and `cleanup` puts Leaflet back: every other map guide goes by+ // `#trek-map`, which the GL map does not have.+ start: async p => {+ await setMapProvider(p, 'maplibre-gl')+ await openTrip(p)+ // MapViewAuto shows Leaflet while the GL chunk loads, then swaps; WebGL+ // runs on SwiftShader headless at 1920×1080×2, so the style, the vector+ // tiles from tiles.openfreemap.org and the day-1 framing take their time.+ await expect(glCanvas(p)).toBeVisible({ timeout: 60_000 })+ await expect(resetNorth(p)).toBeVisible({ timeout: 30_000 })+ await glMapIdle(p)+ await settle(p)+ // `settle` counts `<img>` loads; a WebGL canvas has none, so give the+ // tiles a moment to paint or the picture catches the blank canvas.+ await p.waitForTimeout(2000)+ },+ steps: [+ {+ // The turn itself is the map's own camera move rather than a synthetic+ // right-button drag: a drag has to start on bare canvas, and the pins,+ // the two floating columns and the explore pill all sit over it. 35°+ // is enough for the streets to lie visibly askew and the arrow to lean.+ prepare: async p => {+ await p.evaluate(() => {+ const m = (window as unknown as { __trek_map?: TrekGlMap }).__trek_map+ if (!m) throw new Error('no GL map on the page')+ m.easeTo({ bearing: 35, pitch: 0, duration: 0 })+ })+ await p.waitForFunction(() => {+ const m = (window as unknown as { __trek_map?: TrekGlMap }).__trek_map+ return !!m && Math.abs(m.getBearing() - 35) < 0.5 && !m.isMoving()+ })+ await settle(p)+ },+ target: compassPill,+ },+ {+ target: compassPill,+ act: async p => {+ await resetNorth(p).click()+ // `easeTo` takes 300 ms; the compass is only upright once it has landed.+ await p.waitForFunction(() => {+ const m = (window as unknown as { __trek_map?: TrekGlMap }).__trek_map+ return !!m && Math.abs(m.getBearing()) < 0.5 && Math.abs(m.getPitch()) < 0.5 && !m.isMoving()+ })+ await settle(p)+ },+ },+ ],+ // The renderer is kept on the account, not on the trip: left on MapLibre it+ // would be the map of every picture taken after this guide, and every+ // `#trek-map` locator in the other guides would find nothing.+ cleanup: p => setMapProvider(p, 'leaflet'),+ },}// ── Run ───────────────────────────────────────────────────────────────────────@@ -482,6 +650,21 @@ test.describe.configure({ mode: 'serial' })test.beforeAll(async ({ request }) => {await ensureMapFixtures(request)+ // The recorded route: the addon on, the signed-in user connected to the+ // Dawarich from media.env, the synthetic recording of the trip uploaded.+ await ensureDawarichConnection(request)+})++test.afterAll(async ({ request }) => {+ // Instance-wide, not trip-scoped: while the addon is on, every trip map+ // carries the round Dawarich button in its bottom-right corner. This file's+ // pictures show it on purpose; the other trip screens' do not, so it goes+ // off again here, whatever happened in between. The renderer likewise: the+ // compass guide puts Leaflet back in its cleanup, but a guide that fails+ // never reaches its cleanup, and every `#trek-map` locator in the files that+ // run after this one would find a GL canvas instead.+ await disconnectDawarich(request)+ await request.post('/api/settings/bulk', { data: { settings: { map_provider: 'leaflet' } } })})test('every registered map guide has a script, and only those', async () => {diff --git a/client/e2e/help/trip-place.guide.ts b/client/e2e/help/trip-place.guide.tsindex 65e0a9c29..8964150e0 100644--- a/client/e2e/help/trip-place.guide.ts+++ b/client/e2e/help/trip-place.guide.ts@@ -2,6 +2,7 @@ import { test, expect, type Page, type Locator } from '@playwright/test'import { captureGuide, captureHero, beat, settle, VIEWPORT, type GuideScript } from './guide'import { seededTrip, coverFixture, ensureTrack, ensureDaysFixtures, ensurePlaceFixtures, PLACE_WEBSITE, RATED_PLACE } from './fixtures'import { openTrip, selectDay, modal, dialog } from './trip-shared'+import { long } from '../dates'import { tripPlaceContext, tripPlaceGuides } from '../../src/help/contexts/tripPlace'import type { HelpGuide } from '../../src/help/types'@@ -31,6 +32,8 @@ const TRACK_PICKED_COLOR = '#ea580c'const BOOKING = 'Lunch at Nishiki'/** The only list the seed creates. */const LIST = 'Kyoto shortlist'+/** The list's row in the picker: its name, then the status chip once the place is in it. */+const LIST_ROW = new RegExp(`^${LIST}(?: (?:Idea|Planned|Visited))?$`)const UPLOADED = 'cover-fixture.jpg'/** The card itself: the scroll body's parent holds head, body and footer. */@@ -56,6 +59,82 @@ const bookingStrip = (page: Page) => card(page).getByRole('button', { name: 'Ediconst bookingFields = (page: Page) => bookingStrip(page).locator('> div').nth(1)const dayHeader = (page: Page, n: number) => page.getByRole('button', { name: new RegExp(`^${n} .*Day ${n} `) })const swatch = (page: Page) => card(page).getByRole('button', { name: TRACK_PICKED_COLOR })+/** The seed's day 1: the trip starts nine days before the picture day (`start_date: day(-9)`). */+const DAY_ONE = -9+/** The weekday the English UI prints for a seeded day, `Saturday` on a run where day 1 is one. */+const weekday = (offset: number) => long(offset).split(',')[0]+/**+ * The Opening Hours row: the one button of the card with a clock in it. Found+ * by the icon rather than the label, because the label is the open day's line+ * ("Saturday: 06:00-17:00") and the day moves with the run.+ */+const hoursRow = (page: Page) => card(page).locator('button:has(svg.lucide-clock)')+/** The hours box: the row and, once unfolded, the week under it. */+const hoursBox = (page: Page) => hoursRow(page).locator('xpath=..')++/** The card's own X, the one in its head; the day panel over the map has another. */+async function closeCard(page: Page): Promise<void> {+ await head(page).locator('button:has(svg.lucide-x)').click()+ await expect(card(page)).toHaveCount(0)+}++/**+ * Put the provider's answer for a place into the card's own cache before the+ * card asks for it. The card reads `sessionStorage` under this key first+ * (PlaceInspector's usePlaceDetails) and only then asks the server, with an+ * eight-second limit that Overpass exceeds as often as not; asked here over+ * the API there is no such limit, and a thin answer is asked again.+ */+async function primeDetails(page: Page, placeName: string): Promise<void> {+ const { tripId } = seededTrip()+ const res = await page.request.get(`/api/trips/${tripId}/places`)+ const body = (await res.json()) as { places?: { name: string; osm_id?: string | null }[] } | { name: string; osm_id?: string | null }[]+ const places = Array.isArray(body) ? body : (body.places ?? [])+ const osmId = places.find(p => p.name === placeName)?.osm_id+ if (!osmId) throw new Error(`${placeName} carries no OpenStreetMap id; ensurePlaceFixtures did not run`)+ type Details = { opening_hours?: string[] | null } | null+ const hasWeek = (d: Details): boolean => Array.isArray(d?.opening_hours) && d.opening_hours.length === 7+ let details: Details = null+ for (let attempt = 1; attempt <= 3 && !hasWeek(details); attempt++) {+ const answer = await page.request.get(`/api/maps/details/${encodeURIComponent(osmId)}?lang=en`, { timeout: 45_000 })+ details = answer.ok() ? ((await answer.json()) as { place: Details }).place : null+ }+ if (!hasWeek(details)) throw new Error(`no opening hours for ${placeName} (${osmId}) from the details route`)+ await page.evaluate(([key, value]) => sessionStorage.setItem(key, value), [`gdetails_${osmId}_en`, JSON.stringify(details)])+}++/**+ * Open a place that carries an OpenStreetMap id and wait until the provider's+ * answer is on the card.+ *+ * The hours, the ring and the phone number arrive one request after the card:+ * the server asks Overpass and Nominatim for them, caches nothing on that path,+ * and the card swallows a lookup that times out. `settle` waits five seconds+ * for the network at most, which a slow mirror exceeds, and the card would then+ * be pictured without the feature the text is about. So this waits for the+ * hours row itself, and when it has not come, closes the card and opens the+ * place again, which fires the lookup afresh (closing clears the id the hook+ * watches). A third miss fails the run. With `day` the row's line is checked+ * against that day's weekday, which is what the step text promises; with+ * `phone` the tel link has to be there too.+ */+async function openWithHours(+ page: Page,+ open: (p: Page) => Promise<void>,+ opts: { day?: number; phone?: RegExp; place?: string } = {},+): Promise<void> {+ await primeDetails(page, opts.place ?? 'Senso-ji Temple')+ for (let attempt = 1; ; attempt++) {+ await open(page)+ const shown = await hoursRow(page).waitFor({ state: 'visible', timeout: 15_000 }).then(() => true, () => false)+ if (shown) break+ if (attempt === 3) throw new Error(`no opening hours on the card after ${attempt} openings`)+ await closeCard(page)+ }+ if (opts.day !== undefined) await expect(hoursRow(page)).toHaveText(new RegExp(`^${weekday(opts.day)}: `))+ if (opts.phone) await expect(card(page).getByRole('link', { name: opts.phone })).toBeVisible()+ await settle(page)+}async function openPlace(page: Page, name: string): Promise<void> {await row(page, name).click()@@ -145,12 +224,23 @@ const SCRIPTS: Record<string, GuideScript> = {steps: [{target: p => stop(p, 'Senso-ji Temple'),- act: p => openStop(p, 'Senso-ji Temple'),+ act: p => openWithHours(p, q => openStop(q, 'Senso-ji Temple'), { day: DAY_ONE, phone: /^\+81/ }),},only(head),only(ratingRow),only(p => card(p).locator('.collab-note-md').first()),only(participants),+ {+ // Unfolded before the picture: the step is about the week, and a ring+ // around the collapsed row would show the reader one line of it.+ prepare: async p => {+ await hoursRow(p).click()+ await expect(hoursRow(p)).toHaveText('Opening Hours')+ await expect(hoursBox(p).getByText(/^Sunday: /)).toBeVisible()+ await settle(p)+ },+ target: hoursBox,+ },only(footer),],},@@ -381,7 +471,7 @@ const SCRIPTS: Record<string, GuideScript> = {guide: guide('place-navigation'),start: async p => {await openTrip(p, { day: null })- await openPlace(p, PLACE_WEBSITE.place)+ await openWithHours(p, q => openPlace(q, PLACE_WEBSITE.place), { place: PLACE_WEBSITE.place })},steps: [{@@ -409,7 +499,7 @@ const SCRIPTS: Record<string, GuideScript> = {start: async p => {await unsaveEverywhere(p, 'Senso-ji Temple')await openTrip(p, { day: null })- await openPlace(p, 'Senso-ji Temple')+ await openWithHours(p, q => openPlace(q, 'Senso-ji Temple'))},steps: [{@@ -422,12 +512,13 @@ const SCRIPTS: Record<string, GuideScript> = {},only(dialog),{- // Exact: the Collections guides leave a list behind whose name opens- // with this one's.- target: p => modal(p).getByRole('button', { name: LIST, exact: true }),+ // Anchored, not exact: the Collections guides leave a list behind whose+ // name opens with this one's, and once the place is saved the row's+ // name grows the status chip (Idea, Planned, Visited).+ target: p => modal(p).getByRole('button', { name: LIST_ROW }),act: async p => {- await modal(p).getByRole('button', { name: LIST, exact: true }).click()- await expect(modal(p).getByRole('button', { name: LIST, exact: true })).toHaveClass(/border-accent/, { timeout: 20_000 })+ await modal(p).getByRole('button', { name: LIST_ROW }).click()+ await expect(modal(p).getByRole('button', { name: LIST_ROW })).toHaveClass(/border-accent/, { timeout: 20_000 })await settle(p)},},@@ -496,7 +587,7 @@ test('hero: trip-place', async ({ page }) => {await captureHero(page, tripPlaceContext.id, async p => {await openTrip(p, { day: null })await selectDay(p, 1)- await openStop(p, 'Senso-ji Temple')+ await openWithHours(p, q => openStop(q, 'Senso-ji Temple'), { day: DAY_ONE, phone: /^\+81/ })})})diff --git a/client/e2e/help/trip-shared.ts b/client/e2e/help/trip-shared.tsindex 72de46d88..97df07163 100644--- a/client/e2e/help/trip-shared.ts+++ b/client/e2e/help/trip-shared.ts@@ -1,6 +1,6 @@import { expect, type Locator, type Page } from '@playwright/test'import { clearNotices } from '../screenshots/shot'-import { dismissReleaseNotice, settle } from './guide'+import { dismissReleaseNotice, settle, type StepAction } from './guide'import { seededTrip } from './fixtures'/**@@ -91,3 +91,84 @@ export async function closeMenu(page: Page): Promise<void> {await page.evaluate(() => document.body.click())await settle(page)}++// ── Import from file ──────────────────────────────────────────────────────────++/**+ * Import from file, on the Bookings and the Transports tab alike. The dialog+ * is another bare portal, told apart by its heading; the parse it starts is+ * reported by the background widget, a fixed portal in the bottom-right+ * corner (the one at z-index 50000) with a card per run.+ */+export const importDialog = (page: Page) =>+ portalDialog(page, page.getByText('Import booking confirmations', { exact: true }))+export const importWidget = (page: Page) => page.locator('body > div[style*="z-index: 50000"]')+/** The widget's card for the run that parses `file`; the card is labelled with the file names. */+export const importTask = (page: Page, file: string) =>+ importWidget(page).locator('.bg-surface-card').filter({ hasText: file }).last()++/**+ * The first three steps of an import guide, the same on either tab: the+ * toolbar button, the drop box with the file named on it, and Import.+ */+export function importSteps(fixture: () => string, file: string): StepAction[] {+ return [+ {+ target: p => p.getByRole('button', { name: 'Import from file' }),+ act: async p => {+ await p.getByRole('button', { name: 'Import from file' }).click()+ await expect(importDialog(p)).toBeVisible()+ await settle(p)+ },+ },+ {+ prepare: async p => {+ // Set the hidden input directly: the box opens the file picker of the+ // operating system, which Playwright cannot photograph.+ await importDialog(p).locator('input[type="file"]').setInputFiles(fixture())+ await expect(importDialog(p).getByText(file)).toBeVisible()+ await settle(p)+ },+ target: p => importDialog(p).getByText(file).locator('xpath=ancestor::button[1]'),+ act: settle,+ },+ {+ target: p => importDialog(p).getByRole('button', { name: 'Import', exact: true }),+ act: async p => {+ await importDialog(p).getByRole('button', { name: 'Import', exact: true }).click()+ await expect(importDialog(p)).toHaveCount(0, { timeout: 20_000 })+ await settle(p)+ },+ },+ ]+}++/**+ * Put the widget away after an import guide. The review takes the card with+ * it when it starts, so one still standing means the run stopped before+ * that, and it would sit in the corner of every later guide's pictures. Close+ * is only offered once the parse has stopped, and the wait is bounded so a+ * card nobody can close does not fail the guide from its cleanup.+ */+export async function dismissImportTask(page: Page, file: string): Promise<void> {+ const task = importTask(page, file)+ if (!(await task.isVisible().catch(() => false))) return+ const close = task.getByRole('button', { name: 'Close' })+ await close.waitFor({ state: 'visible', timeout: 45_000 }).catch(() => {})+ if (await close.isVisible().catch(() => false)) await close.click()+}++/**+ * Take a document a guide uploaded out of the trip for good. DELETE alone is+ * the trash, and the Files guides photograph the trash, so the permanent+ * delete follows.+ */+export async function deleteTripFiles(page: Page, ...names: string[]): Promise<void> {+ const { tripId } = seededTrip()+ const res = await page.request.get(`/api/trips/${tripId}/files`)+ const { files = [] } = (await res.json()) as { files?: { id: number; original_name: string }[] }+ for (const file of files.filter(f => names.includes(f.original_name))) {+ await page.request.delete(`/api/trips/${tripId}/files/${file.id}`)+ await page.request.delete(`/api/trips/${tripId}/files/${file.id}/permanent`)+ }+}diff --git a/client/e2e/help/trip-transports.guide.ts b/client/e2e/help/trip-transports.guide.tsindex 02b1e2444..8c3994a97 100644--- a/client/e2e/help/trip-transports.guide.ts+++ b/client/e2e/help/trip-transports.guide.ts@@ -1,7 +1,8 @@import { test, expect, type Locator, type Page } from '@playwright/test'import { captureGuide, captureHero, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'-import { seededTrip, ensureTransportFixtures, TRANSIT_JOURNEY } from './fixtures'-import { openTrip, openTripOnDay, selectDay, modal, dialog, portalDialog } from './trip-shared'+import { seededTrip, ensureTransportFixtures, TRANSIT_JOURNEY, flightEmlFixture, FLIGHT_EML, FLIGHT_TO_IMPORT } from './fixtures'+import { openTrip, openTripOnDay, selectDay, modal, dialog, portalDialog, importSteps, importTask, dismissImportTask, deleteTripFiles } from './trip-shared'+import { ensureAirtrailConnection, disconnectAirtrail, AIRTRAIL_FLIGHTS, requireExtractor, allowEmlUploads } from './external'import { tripTransportsContext, tripTransportsGuides } from '../../src/help/contexts/tripTransports'import type { HelpGuide } from '../../src/help/types'@@ -88,16 +89,54 @@ async function pickStop(page: Page, box: Locator, name: string): Promise<void> {await expect(box).toHaveValue(name, { timeout: 10_000 })}-async function deleteByTitle(page: Page, ...titles: string[]): Promise<void> {+type ReservationRow = { id: number; title: string; confirmation_number: string | null }++async function deleteWhere(page: Page, matches: (r: ReservationRow) => boolean): Promise<void> {const { tripId } = seededTrip()const res = await page.request.get(`/api/trips/${tripId}/reservations`)- const body = (await res.json()) as { reservations?: { id: number; title: string }[] } | { id: number; title: string }[]+ const body = (await res.json()) as { reservations?: ReservationRow[] } | ReservationRow[]const list = Array.isArray(body) ? body : (body.reservations ?? [])- for (const r of list.filter(x => titles.includes(x.title))) {+ for (const r of list.filter(matches)) {await page.request.delete(`/api/trips/${tripId}/reservations/${r.id}`)}}+const deleteByTitle = (page: Page, ...titles: string[]) => deleteWhere(page, r => titles.includes(r.title))+/** The imported flight's title is the extractor's; its booking code is the fixture's. */+const deleteByCode = (page: Page, code: string) => deleteWhere(page, r => r.confirmation_number === code)++/**+ * What import-transport-file reads out of its e-ticket. The title is the+ * mapper's (airline and number joined), so the form and the card are checked+ * by what the fixture owns: the code, and the two airports the built-in table+ * resolves from their IATA codes.+ */+const IMPORTED = { code: FLIGHT_TO_IMPORT.code, from: /\(HND\)$/, to: /\(FRA\)$/ }+/** The two AirportSelect boxes of a flight's form, departure first. */+const airportBoxes = (page: Page) => modal(page).getByPlaceholder('Airport code or city (e.g. FRA)')++/**+ * What the AirTrail account holds (external.ts): two flights home on the last+ * day that connect in Tokyo, which the picker offers to join, and the Lisbon+ * weekend in spring for its Other flights. The joined booking's title is the+ * mapper's route, the airport codes joined by arrows (airtrail.mapper.ts).+ */+const [OUT_LEG, HOME_LEG, , OTHER] = AIRTRAIL_FLIGHTS+const JOINED = { title: `${OUT_LEG.from} → ${OUT_LEG.to} → ${HOME_LEG.to}`, layover: OUT_LEG.to }++/** The toolbar's AirTrail button; its label is visible at this viewport, the title is the picker's name. */+const airtrailButton = (page: Page) => page.getByRole('button', { name: 'AirTrail', exact: true })+/** The flight picker is a bare portal like the booking import; its title tells it apart. */+const airtrailPicker = (page: Page) => portalDialog(page, page.getByText('Import from AirTrail', { exact: true }))+/** A flight's row in the picker: a button named by the airline and the flight number. */+const flightRow = (page: Page, flightNumber: string) =>+ airtrailPicker(page).getByRole('button', { name: new RegExp(`\\b${flightNumber}\\b`) })+/** The join tick under a connection's legs, and the framed group it belongs to. */+const joinToggle = (page: Page) =>+ airtrailPicker(page).getByRole('button', { name: /^Import as one flight with a layover in / })+const connectionGroup = (page: Page) => joinToggle(page).locator('xpath=..')+const importCta = (page: Page) => airtrailPicker(page).getByRole('button', { name: /^Import \d+$/ })+/** Give a day's legs back to the day's own mode, whichever stop carries the one that was set. */async function resetLegModes(page: Page, dayIndex: number): Promise<void> {const { tripId, dayIds } = seededTrip()@@ -225,6 +264,57 @@ const SCRIPTS: Record<string, GuideScript> = {],cleanup: p => deleteByTitle(p, TAXI.title),},+ 'import-transport-file': {+ guide: guide('import-transport-file'),+ // See import-booking-file: the extractor and no addon, and the mail has to+ // be an allowed file type for the review to keep it under Files.+ start: async p => {+ await requireExtractor(p.request)+ await allowEmlUploads(p.request, true)+ await openTrip(p, { tab: 'transports' })+ },+ steps: [+ ...importSteps(flightEmlFixture, FLIGHT_EML),+ {+ prepare: async p => {+ await expect(importTask(p, FLIGHT_EML).getByRole('button', { name: 'Import', exact: true })).toBeVisible({ timeout: 90_000 })+ await settle(p)+ },+ target: p => importTask(p, FLIGHT_EML),+ act: async p => {+ await importTask(p, FLIGHT_EML).getByRole('button', { name: 'Import', exact: true }).click()+ await expect(modal(p).getByRole('heading', { name: 'Add transport' })).toBeVisible({ timeout: 20_000 })+ await expect(modal(p).getByPlaceholder('e.g. Lufthansa LH123, Hotel Adlon, ...')).toHaveValue(/203/)+ // Both airports came out of the built-in table by their codes: the+ // airport boxes are the two with an airport code in brackets.+ await expect(airportBoxes(p).nth(0)).toHaveValue(IMPORTED.from)+ await expect(airportBoxes(p).nth(1)).toHaveValue(IMPORTED.to)+ await expect(modal(p).getByPlaceholder('e.g. ABC12345')).toHaveValue(IMPORTED.code)+ await expect(modal(p).getByText(FLIGHT_EML)).toBeVisible()+ await settle(p)+ },+ },+ {+ target: dialog,+ act: async p => {+ await modal(p).getByRole('button', { name: 'Add', exact: true }).click()+ await expect(modal(p)).toHaveCount(0, { timeout: 20_000 })+ await expect(card(p, IMPORTED.code)).toBeVisible({ timeout: 20_000 })+ await settle(p)+ },+ },+ ],+ cleanup: async p => {+ await closeModal(p)+ await dismissImportTask(p, FLIGHT_EML)+ await allowEmlUploads(p.request, false)+ await p.evaluate(() => {+ try { localStorage.removeItem('trek.bg-import-tasks') } catch { /* nothing was stored */ }+ })+ await deleteByCode(p, IMPORTED.code)+ await deleteTripFiles(p, FLIGHT_EML)+ },+ },'plan-transit': {guide: guide('plan-transit'),start: p => openTrip(p),@@ -453,6 +543,81 @@ const SCRIPTS: Record<string, GuideScript> = {}, tripId)},},+ 'airtrail-import': {+ guide: guide('airtrail-import'),+ // The connection is made here and taken away in cleanup, so the hero and+ // the guides before this one keep a toolbar without the AirTrail button.+ start: async p => {+ await ensureAirtrailConnection(p.request)+ await openTrip(p, { tab: 'transports' })+ // The addon list and the connection probe are read once, when the app+ // loads. One more load now that the connection exists, and the button+ // is waited for, so a missing connection fails here and not at step 1.+ await p.reload()+ await expect(p.getByRole('button', { name: 'Share', exact: true })).toBeVisible({ timeout: 30_000 })+ await expect(airtrailButton(p)).toBeVisible({ timeout: 30_000 })+ await settle(p)+ },+ steps: [+ {+ target: airtrailButton,+ act: async p => {+ await airtrailButton(p).click()+ await expect(airtrailPicker(p)).toBeVisible()+ // The rows come from the AirTrail instance itself, over the LAN.+ await expect(flightRow(p, HOME_LEG.flightNumber)).toBeVisible({ timeout: 30_000 })+ await expect(flightRow(p, OTHER.flightNumber)).toBeVisible()+ await settle(p)+ },+ },+ // The whole picker: During this trip with its ticked rows, Other flights below.+ only(airtrailPicker),+ // A row under Other flights, unticked, as the text says those are. Not+ // clicked: a spring flight imported into an autumn trip would be clamped+ // onto day 1 and spoil the result picture.+ only(p => flightRow(p, OTHER.flightNumber)),+ {+ // Joined by default: the tick under the two legs is on before anyone touches it.+ prepare: async p => {+ await expect(joinToggle(p)).toContainText(`Import as one flight with a layover in ${JOINED.layover}`)+ await expect(joinToggle(p).locator('svg.lucide-check')).toBeVisible()+ },+ target: connectionGroup,+ },+ {+ // The two flights home and nothing else are ticked.+ prepare: async p => {+ await expect(importCta(p)).toHaveText('Import 2')+ },+ target: importCta,+ act: async p => {+ await importCta(p).click()+ await expect(p.getByText('Import from AirTrail', { exact: true })).toHaveCount(0, { timeout: 30_000 })+ // The toast counts flight ids, so the joined pair reports two.+ const toast = p.getByText('2 flight(s) imported', { exact: true })+ await expect(toast).toBeVisible({ timeout: 15_000 })+ await expect(card(p, JOINED.title)).toBeVisible({ timeout: 20_000 })+ // The toast fades after three seconds; the card's picture and the+ // result are taken without a half-faded message in the corner.+ await expect(toast).toHaveCount(0, { timeout: 10_000 })+ await settle(p)+ },+ },+ {+ prepare: async p => {+ await expect(card(p, JOINED.title).getByText('AirTrail', { exact: true })).toBeVisible()+ },+ target: p => card(p, JOINED.title),+ },+ ],+ cleanup: async p => {+ // By every title the import can produce: the joined route, or one+ // flight number per card when the join was off.+ await deleteByTitle(p, JOINED.title, ...AIRTRAIL_FLIGHTS.map(f => f.flightNumber))+ await disconnectAirtrail(p.request)+ await p.evaluate(() => { try { sessionStorage.clear() } catch { /* a locked-down browser keeps its filters */ } })+ },+ },}// ── Run ───────────────────────────────────────────────────────────────────────diff --git a/client/e2e/help/vacay.guide.ts b/client/e2e/help/vacay.guide.tsindex 3f4f55083..0eb47bd9b 100644--- a/client/e2e/help/vacay.guide.ts+++ b/client/e2e/help/vacay.guide.ts@@ -1,6 +1,7 @@import { test, expect, type Page, type Locator } from '@playwright/test'import { clearNotices } from '../screenshots/shot'import { captureGuide, captureHero, dismissReleaseNotice, beat, typeInto, settle, VIEWPORT, type GuideScript } from './guide'+import { monthName, year } from '../dates'import { vacayGuides, vacayContext } from '../../src/help/contexts/vacay'import type { HelpGuide } from '../../src/help/types'@@ -12,7 +13,9 @@ import type { HelpGuide } from '../../src/help/types'* looks like anyway.*/-const YEAR = 2026+const YEAR = year()+/** The month after the picture day's: the first one the planner draws after the current. */+const NEXT_MONTH = monthName(1)const guide = (id: string): HelpGuide => {const g = vacayGuides.find(x => x.id === id)@@ -25,7 +28,7 @@ async function openVacay(page: Page): Promise<void> {await clearNotices(page)await dismissReleaseNotice(page)await expect(toolbar(page)).toBeVisible()- await expect(monthCard(page, 'October')).toBeVisible()+ await expect(monthCard(page, NEXT_MONTH)).toBeVisible()}/** The floating mode toolbar under the grid. */@@ -78,16 +81,16 @@ const SCRIPTS: Record<string, GuideScript> = {steps: [{ target: p => toolbar(p).getByRole('button').first() },{- target: p => day(p, 'October', 14),- act: async p => { await day(p, 'October', 14).click(); await beat(p, 600) },+ target: p => day(p, NEXT_MONTH, 14),+ act: async p => { await day(p, NEXT_MONTH, 14).click(); await beat(p, 600) },},{- target: p => day(p, 'October', 14),+ target: p => day(p, NEXT_MONTH, 14),act: async p => {- await day(p, 'October', 14).click()+ await day(p, NEXT_MONTH, 14).click()await beat(p, 600)// Leave the day logged for the after-picture and the guides that follow.- await day(p, 'October', 14).click()+ await day(p, NEXT_MONTH, 14).click()await settle(p)},},@@ -103,8 +106,8 @@ const SCRIPTS: Record<string, GuideScript> = {act: async p => { await p.getByRole('button', { name: 'Half day' }).click() },},{- target: p => day(p, 'October', 15),- act: async p => { await day(p, 'October', 15).click(); await settle(p) },+ target: p => day(p, NEXT_MONTH, 15),+ act: async p => { await day(p, NEXT_MONTH, 15).click(); await settle(p) },},{target: p => p.getByRole('button', { name: 'Half day' }),@@ -122,9 +125,9 @@ const SCRIPTS: Record<string, GuideScript> = {act: async p => { await p.getByRole('button', { name: 'Comp / Flex' }).click() },},{- target: p => day(p, 'October', 16),+ target: p => day(p, NEXT_MONTH, 16),act: async p => {- await day(p, 'October', 16).click()+ await day(p, NEXT_MONTH, 16).click()await settle(p)await p.getByRole('button', { name: 'Comp / Flex' }).click()},diff --git a/client/e2e/screenshots/seed.ts b/client/e2e/screenshots/seed.tsindex 898b73193..71f7c321c 100644--- a/client/e2e/screenshots/seed.ts+++ b/client/e2e/screenshots/seed.ts@@ -1,5 +1,6 @@import path from 'node:path'import type { APIRequestContext } from '@playwright/test'+import { at, day, ordinal, short } from '../dates'/*** Demo data for the documentation screenshots.@@ -15,15 +16,16 @@ import type { APIRequestContext } from '@playwright/test'* settle-up) — the reader would see nothing new.* - Two extra members exist so splits, avatars and sharing tiers render with* real names instead of a lonely single-user state.- * - Dates sit ~2 months out so "upcoming" surfaces (What's Next, reservations)- * have something to show.+ * - Dates are relative to the run day (e2e/dates.ts): the trip ends today, so+ * the running surfaces (boarding pass, What's Next, forecast, reminders) have+ * something to show whenever the seed runs.*/const TRIP = {title: 'Autumn in Japan',description: 'Two weeks chasing momiji season from Tokyo down to Kyoto.',- start_date: '2026-09-12',- end_date: '2026-09-21',+ start_date: day(-9),+ end_date: day(0),currency: 'JPY',reminder_days: 3,}@@ -64,15 +66,15 @@ const PLACES = [const EXPENSES = [{ name: 'Flights FRA → HND', category: 'transport', total_price: 890, currency: 'EUR',- expense_date: '2026-09-12', note: 'Booked with miles, taxes only.' },+ expense_date: day(-9), note: 'Booked with miles, taxes only.' },{ name: 'Ryokan in Hakone', category: 'accommodation', total_price: 48000, currency: 'JPY',- expense_date: '2026-09-15', note: '2 nights, kaiseki dinner included.' },+ expense_date: day(-6), note: '2 nights, kaiseki dinner included.' },{ name: 'JR Pass (14 days)', category: 'transport', total_price: 80000, currency: 'JPY',- expense_date: '2026-09-12', note: 'Green car, activated on arrival.' },+ expense_date: day(-9), note: 'Green car, activated on arrival.' },{ name: 'teamLab Planets tickets', category: 'activities', total_price: 11400, currency: 'JPY',- expense_date: '2026-09-13' },+ expense_date: day(-8) },{ name: 'Dinner at Nishiki', category: 'food', total_price: 7200, currency: 'JPY',- expense_date: '2026-09-17' },+ expense_date: day(-4) },]const PACKING = [@@ -81,10 +83,15 @@ const PACKING = [{ category: 'Electronics', items: ['Type-A adapter', 'Power bank', 'Camera'] },]+/** Chat lines the collab guides look for by their text. */+export const SEED_CHAT = {+ teamlab: `Booked the teamLab slot for the ${ordinal(-8)}, 14:00. Tickets are in the Files tab.`,+}+const TODOS = [- { name: 'Book teamLab Planets slot', category: 'Before departure', due_date: '2026-08-15', priority: 2 },- { name: 'Activate JR Pass', category: 'On arrival', due_date: '2026-09-12', priority: 1 },- { name: 'Reserve ryokan dinner', category: 'Before departure', due_date: '2026-08-20' },+ { name: 'Book teamLab Planets slot', category: 'Before departure', due_date: day(-37), priority: 2 },+ { name: 'Activate JR Pass', category: 'On arrival', due_date: day(-9), priority: 1 },+ { name: 'Reserve ryokan dinner', category: 'Before departure', due_date: day(-32) },]export interface SeedResult {@@ -212,8 +219,8 @@ export async function seedDemoData(await call(api, 'post', `/api/trips/${tripId}/reservations`, {title: 'LH716 FRA → HND',type: 'flight',- reservation_time: '2026-09-12T13:05:00',- reservation_end_time: '2026-09-13T08:25:00',+ reservation_time: at(-9, '13:05'),+ reservation_end_time: at(-8, '08:25'),confirmation_number: 'X7K2QP',status: 'confirmed',location: 'Frankfurt Airport',@@ -222,10 +229,10 @@ export async function seedDemoData(endpoints: [{ role: 'from', sequence: 0, name: 'Frankfurt Airport', code: 'FRA',lat: 50.0379, lng: 8.5622, timezone: 'Europe/Berlin',- local_date: '2026-09-12', local_time: '13:05' },+ local_date: day(-9), local_time: '13:05' },{ role: 'to', sequence: 1, name: 'Tokyo Haneda', code: 'HND',lat: 35.5494, lng: 139.7798, timezone: 'Asia/Tokyo',- local_date: '2026-09-13', local_time: '08:25' },+ local_date: day(-8), local_time: '08:25' },],}).catch(() => {})@@ -293,7 +300,7 @@ export async function seedDemoData(const pollRes = await api.post(`${collab}/polls`, {data: {question: 'Which day should we keep free for Nara?',- options: ['Wed, Sep 16', 'Thu, Sep 17', 'Sat, Sep 19'],+ options: [short(-5), short(-4), short(-2)],multiple: false,},})@@ -308,13 +315,13 @@ export async function seedDemoData(}).catch(() => {})const conversation: Array<[string, string]> = [- ['admin', 'Flights are booked — we land at Haneda 08:25 on the 13th.'],+ ['admin', `Flights are booked, we land at Haneda 08:25 on the ${ordinal(-8)}.`],['mira', 'Nice. Should we go straight to the hotel or drop bags and head out?'],['jonas', 'Drop bags. I want to be at Senso-ji before the crowds.'],['admin', "Agreed. I've put it on day 1 with a note to go before 08:00."],- ['mira', 'Booked the teamLab slot for the 13th, 14:00. Tickets are in the Files tab.'],+ ['mira', SEED_CHAT.teamlab],['jonas', 'Do we need to reserve the ryokan dinner separately?'],- ['admin', "It's included — kaiseki, 18:30. Added it to the to-dos so we don't forget to confirm."],+ ['admin', "It's included: kaiseki, 18:30. Added it to the to-dos so we don't forget to confirm."],]for (const [who, text] of conversation) {const ctx = who === 'admin' ? api : as(who)diff --git a/client/playwright.config.ts b/client/playwright.config.tsindex ef9633d1e..d139843b2 100644--- a/client/playwright.config.ts+++ b/client/playwright.config.ts@@ -21,6 +21,15 @@ const WEB_PORT = Number(process.env.E2E_WEB_PORT) || 5173const API_PORT = Number(process.env.E2E_API_PORT) || 3001export const E2E_BASE_URL = `http://localhost:${WEB_PORT}`+// The day the seed and the pictures are relative to (e2e/dates.ts). Fixed here+// for every project and worker that loads this file, so a run that crosses+// midnight still agrees with itself; `help:media` sets it before this runs.+if (!process.env.E2E_PICTURE_DAY) {+ const d = new Date()+ const pad = (n: number) => String(n).padStart(2, '0')+ process.env.E2E_PICTURE_DAY = `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`+}+export default defineConfig({testDir: './e2e',fullyParallel: false,@@ -84,6 +93,11 @@ export default defineConfig({timeout: 240_000,use: {...devices['Desktop Chrome'],+ // The full Chrome for Testing build rather than the headless shell the+ // other projects run on. Only the full build carries the PDF viewer,+ // and the Files tab's preview embeds a PDF as <object>, which the+ // shell leaves as a "Download PDF" link. Still headless.+ channel: 'chromium',storageState: 'e2e/.tmp/state.json',viewport: { width: 1920, height: 1080 },deviceScaleFactor: 2,diff --git a/client/src/components/Help/helpIcons.ts b/client/src/components/Help/helpIcons.tsindex c630b103e..188192f53 100644--- a/client/src/components/Help/helpIcons.ts+++ b/client/src/components/Help/helpIcons.ts@@ -4,7 +4,7 @@ import {Repeat, UserPlus, Share2, Globe, MapPin, Search, Star, Eye, LandPlot, BarChart3, MinusCircle, Landmark,DownloadCloud, CheckCircle2, PanelRight, Tags, Upload, FileInput, Library, Bookmark, BookOpen, Sparkles, ThumbsUp, Images, Link,Book, Palette, Map, Bell, Plug, CloudOff, User, Lock, ShieldCheck, Fingerprint, KeyRound,- Route, Users, UserRound, Crown, PanelLeftClose, Undo2, Ticket, Train, ListChecks, Wallet, FolderOpen, MessagesSquare,+ Route, Users, UserRound, Crown, PanelLeftClose, Undo2, Ticket, Train, Plane, ListChecks, Wallet, FolderOpen, MessagesSquare,type LucideIcon,} from 'lucide-react'import type { HelpIcon } from '../../help/types'@@ -78,6 +78,7 @@ const ICONS: Record<HelpIcon, LucideIcon> = {undo: Undo2,ticket: Ticket,train: Train,+ plane: Plane,listChecks: ListChecks,wallet: Wallet,folder: FolderOpen,diff --git a/client/src/help/contexts/admin.ts b/client/src/help/contexts/admin.tsindex f365f31e2..2b5578b83 100644--- a/client/src/help/contexts/admin.ts+++ b/client/src/help/contexts/admin.ts@@ -44,7 +44,8 @@ export const adminGuides: HelpGuide[] = [guide('places-transit', 'admin-settings', 'search', 'quick', 2, 2, { slug: 'Places-and-Search' }, ['instance-keys']),guide('file-types', 'admin-settings', 'fileInput', 'quick', 1, 1, { slug: 'Documents-and-Files' }, ['storage-backends']),// Addons- guide('toggle-addon', 'admin-addons', 'sliders', 'quick', 2, 2, { slug: ADDONS }, ['install-plugin']),+ guide('toggle-addon', 'admin-addons', 'sliders', 'quick', 2, 2, { slug: ADDONS }, ['install-plugin', 'document-providers']),+ guide('document-providers', 'admin-addons', 'plug', 'quick', 2, 2, { slug: 'Document-Sync', anchor: 'switching-stores-on' }, ['toggle-addon', 'files-sync']),// Pluginsguide('install-plugin', 'admin-plugins', 'plug', 'guide', 3, 2, { slug: PLUGINS }, ['toggle-addon']),// Storagediff --git a/client/src/help/contexts/atlas.ts b/client/src/help/contexts/atlas.tsindex 4f92a17ef..fbe803334 100644--- a/client/src/help/contexts/atlas.ts+++ b/client/src/help/contexts/atlas.ts@@ -7,6 +7,7 @@ import type { HelpContext, HelpGuide } from '../types'*/const ATLAS = 'Atlas'+const DAWARICH = 'Dawarich'export const atlasGuides: HelpGuide[] = [{@@ -108,6 +109,28 @@ export const atlasGuides: HelpGuide[] = [docs: { slug: ATLAS, anchor: 'statistics' },related: ['country-details'],},+ {+ id: 'dawarich-countries',+ context: 'atlas',+ icon: 'globe',+ size: 'guide',+ steps: 3,+ tips: 2,+ media: { steps: true, result: true },+ docs: { slug: DAWARICH, anchor: 'countries' },+ related: ['mark-country', 'dawarich-wishes', 'stats'],+ },+ {+ id: 'dawarich-wishes',+ context: 'atlas',+ icon: 'checkCircle',+ size: 'guide',+ steps: 3,+ tips: 2,+ media: { steps: true, result: true },+ docs: { slug: DAWARICH, anchor: 'wishlist' },+ related: ['bucket-place', 'bucket-country', 'dawarich-countries'],+ },]export const atlasContext: HelpContext = {@@ -116,6 +139,6 @@ export const atlasContext: HelpContext = {icon: 'globe',bullets: 6,guides: atlasGuides.map(g => g.id),- docs: [{ slug: ATLAS }, { slug: 'Dawarich' }, { slug: 'Admin-Addons' }],+ docs: [{ slug: ATLAS }, { slug: DAWARICH }, { slug: 'Admin-Addons' }],hero: true,}diff --git a/client/src/help/contexts/settings.ts b/client/src/help/contexts/settings.tsindex 6e55d02cb..e794af493 100644--- a/client/src/help/contexts/settings.ts+++ b/client/src/help/contexts/settings.ts@@ -29,7 +29,7 @@ export const settingsGuides: HelpGuide[] = [guide('readability', 'settings-appearance', 'eye', 'quick', 2, 2, { slug: APPEARANCE }, ['theme-scheme'], false),guide('dashboard-widgets', 'settings-appearance', 'layout', 'quick', 2, 2, { slug: APPEARANCE }, ['theme-scheme'], false),// Map- guide('map-provider', 'settings-map', 'map', 'guide', 3, 2, { slug: MAP }, ['travel-map-prefs'], false),+ guide('map-provider', 'settings-map', 'map', 'guide', 3, 2, { slug: MAP }, ['travel-map-prefs', 'map-compass'], false),// Notificationsguide('notification-channels', 'settings-notifications', 'bell', 'guide', 3, 2, { slug: NOTIFICATIONS, anchor: 'notification-channels' }, [], false),// Integrationsdiff --git a/client/src/help/contexts/tripBookings.ts b/client/src/help/contexts/tripBookings.tsindex b742d1671..e95736d51 100644--- a/client/src/help/contexts/tripBookings.ts+++ b/client/src/help/contexts/tripBookings.ts@@ -30,7 +30,7 @@ export const { context: tripBookingsContext, guides: tripBookingsGuides } = defi['booking-files', 'folder', 'guide', 4, 3, { slug: 'Documents-and-Files', anchor: 'linking-files-to-places-reservations-or-assignments' }, ['create-booking', 'import-booking-file', 'files-link']],['booking-cost', 'coins', 'guide', 5, 3, { slug: 'Budget-Tracking', anchor: 'expenses-linked-to-a-booking-or-a-place' }, ['create-booking', 'edit-booking', 'expense-from-booking'], true],['filter-bookings', 'filter', 'quick', 5, 2, SECTIONS, ['booking-travelers', 'edit-booking']],- ['import-booking-file', 'fileInput', 'guide', 4, 3, IMPORT, ['booking-files', 'create-booking']],+ ['import-booking-file', 'fileInput', 'guide', 5, 3, IMPORT, ['booking-files', 'create-booking', 'import-transport-file'], true],['edit-booking', 'pencil', 'quick', 4, 3, CHANGE, ['create-booking', 'delete-booking']],['delete-booking', 'trash', 'quick', 3, 2, CHANGE, ['edit-booking', 'booking-hotel']],],diff --git a/client/src/help/contexts/tripFiles.ts b/client/src/help/contexts/tripFiles.tsindex f8fe17d33..1f19d965f 100644--- a/client/src/help/contexts/tripFiles.ts+++ b/client/src/help/contexts/tripFiles.ts@@ -24,5 +24,8 @@ export const { context: tripFilesContext, guides: tripFilesGuides } = defineScre['files-filter', 'filter', 'quick', 4, 2, { slug: FILES, anchor: 'browsing-and-filtering' }, ['files-star', 'files-preview']],['files-preview', 'eye', 'guide', 5, 3, { slug: FILES, anchor: 'previewing-files' }, ['files-filter', 'files-upload']],['files-trash', 'trash', 'guide', 5, 3, { slug: FILES, anchor: 'trash' }, ['files-upload', 'files-star'], true],+ // Last: the one guide of this screen that needs a document store on the+ // network; a missing one fails this picture and none of the others.+ ['files-sync', 'repeat', 'guide', 6, 3, { slug: 'Document-Sync', anchor: 'binding-a-trip' }, ['files-upload', 'document-providers'], true],],})diff --git a/client/src/help/contexts/tripMap.ts b/client/src/help/contexts/tripMap.tsindex 0df63bb54..931f9d607 100644--- a/client/src/help/contexts/tripMap.ts+++ b/client/src/help/contexts/tripMap.ts@@ -16,14 +16,18 @@ export const { context: tripMapContext, guides: tripMapGuides } = defineScreen({parent: 'trip',route: '/trips/:id?tab=plan',icon: 'map',- bullets: 7,+ bullets: 8,docs: [{ slug: MAP }, { slug: SETTINGS }],guides: [['map-markers', 'mapPin', 'guide', 5, 3, { slug: MAP, anchor: 'place-markers' }, ['read-day-plan', 'place-detail', 'day-route']],['map-nearby-places', 'search', 'guide', 6, 3, { slug: 'Places-and-Search', anchor: 'exploring-the-map-by-category' }, ['map-add-place', 'create-place'], true],['map-add-place', 'plus', 'guide', 4, 2, { slug: MAP, anchor: 'right-click-middle-click-to-create-a-place' }, ['create-place', 'map-nearby-places'], true],- ['map-satellite', 'globe', 'quick', 3, 2, { slug: MAP, anchor: 'satellite-view' }, ['map-provider', 'default-map']],+ ['map-satellite', 'globe', 'quick', 3, 2, { slug: MAP, anchor: 'satellite-view' }, ['map-provider', 'default-map', 'map-compass']],['map-whole-trip', 'route', 'guide', 4, 3, { slug: MAP, anchor: 'the-whole-trip-at-once' }, ['day-route', 'export-plan'], true],['map-booking-routes', 'ticket', 'guide', 5, 3, OVERLAY, ['bookings-in-plan', 'travel-map-prefs', 'add-transport', 'create-booking']],+ ['map-dawarich-trail', 'route', 'guide', 3, 2, { slug: 'Dawarich', anchor: 'on-the-trip-map' }, ['map-whole-trip', 'map-markers'], true],+ // Last: it switches the account to the MapLibre renderer and puts Leaflet+ // back in its cleanup, and nothing in the file runs after it if that fails.+ ['map-compass', 'compass', 'quick', 2, 2, { slug: SETTINGS, anchor: 'map-provider' }, ['map-provider', 'map-satellite']],],})diff --git a/client/src/help/contexts/tripPlace.ts b/client/src/help/contexts/tripPlace.tsindex 5c0548b9c..e06ae9525 100644--- a/client/src/help/contexts/tripPlace.ts+++ b/client/src/help/contexts/tripPlace.ts@@ -19,7 +19,7 @@ export const { context: tripPlaceContext, guides: tripPlaceGuides } = defineScrebullets: 6,docs: [{ slug: PLACES }, { slug: 'Trip-Planner-Overview' }],guides: [- ['read-place', 'eye', 'guide', 6, 3, FIELDS, ['rate-place', 'place-day-assign', 'edit-place'], true],+ ['read-place', 'eye', 'guide', 7, 3, FIELDS, ['rate-place', 'place-day-assign', 'edit-place'], true],['rate-place', 'star', 'quick', 4, 3, { slug: PLACES, anchor: 'rating-a-place' }, ['read-place', 'filter-places'], true],['place-image', 'image', 'guide', 4, 3, { slug: PLACES, anchor: 'custom-place-image' }, ['read-place', 'edit-place'], true],['place-day-assign', 'calendarCheck', 'guide', 5, 3, { slug: 'Day-Plans-and-Notes', anchor: 'assigning-places-to-a-day' }, ['place-onto-day', 'remove-from-day', 'undo-change']],diff --git a/client/src/help/contexts/tripTransports.ts b/client/src/help/contexts/tripTransports.tsindex 6c9986001..5f6be6b16 100644--- a/client/src/help/contexts/tripTransports.ts+++ b/client/src/help/contexts/tripTransports.ts@@ -11,6 +11,8 @@ import { defineScreen } from '../defineScreen'const TRANSPORT = 'Transport-Flights-Trains-Cars'const MAP = 'Map-Features'const OVERLAY = { slug: MAP, anchor: 'reservation-and-transport-overlay' }+const BOOKINGS = 'Reservations-and-Bookings'+const IMPORT = { slug: BOOKINGS, anchor: 'import-from-booking-confirmation' }export const { context: tripTransportsContext, guides: tripTransportsGuides } = defineScreen({id: 'trip-transports',@@ -20,12 +22,17 @@ export const { context: tripTransportsContext, guides: tripTransportsGuides } =bullets: 6,docs: [{ slug: TRANSPORT }, OVERLAY],guides: [- ['transports-list', 'eye', 'guide', 5, 2, { slug: TRANSPORT, anchor: 'where-to-create' }, ['edit-transport', 'bookings-in-plan', 'filter-bookings']],+ ['transports-list', 'eye', 'guide', 5, 2, { slug: TRANSPORT, anchor: 'where-to-create' }, ['edit-transport', 'bookings-in-plan', 'filter-bookings', 'import-transport-file', 'airtrail-import']],['add-transport', 'plus', 'guide', 6, 3, { slug: TRANSPORT, anchor: 'common-fields' }, ['plan-transit', 'edit-transport', 'transports-list'], true],+ ['import-transport-file', 'fileInput', 'guide', 5, 2, IMPORT, ['add-transport', 'import-booking-file', 'transports-list'], true],['plan-transit', 'train', 'guide', 6, 3, { slug: TRANSPORT, anchor: 'public-transit-search' }, ['change-transit-route', 'leg-travel-mode', 'add-transport'], true],['change-transit-route', 'repeat', 'quick', 4, 2, { slug: TRANSPORT, anchor: 'public-transit-search' }, ['plan-transit', 'edit-transport']],['leg-travel-mode', 'route', 'quick', 4, 3, { slug: MAP, anchor: 'travel-times-between-stops' }, ['plan-transit', 'day-route', 'read-day-plan']],['edit-transport', 'pencil', 'quick', 4, 2, { slug: TRANSPORT, anchor: 'in-the-day-plan' }, ['add-transport', 'transports-list', 'bookings-in-plan']],['transport-on-map', 'map', 'guide', 5, 3, OVERLAY, ['transports-list', 'day-route'], true],+ // Last: the guide connects an AirTrail in its start and takes the connection+ // away in its cleanup, so the hero and the guides before it keep a toolbar+ // without the AirTrail button.+ ['airtrail-import', 'plane', 'guide', 6, 3, { slug: BOOKINGS, anchor: 'import-from-airtrail' }, ['transports-list', 'add-transport', 'edit-transport'], true],],})diff --git a/client/src/help/types.ts b/client/src/help/types.tsindex 7c0b56f93..ebd87d8f9 100644--- a/client/src/help/types.ts+++ b/client/src/help/types.ts@@ -96,6 +96,7 @@ export type HelpIcon =| 'undo'| 'ticket'| 'train'+ | 'plane'| 'listChecks'| 'wallet'| 'folder'diff --git a/shared/src/i18n/en/help.ts b/shared/src/i18n/en/help.tsindex 2b28a9757..6e902eb5f 100644--- a/shared/src/i18n/en/help.ts+++ b/shared/src/i18n/en/help.ts@@ -454,6 +454,38 @@ const help: TranslationStrings = {'help.guide.stats.tip.2':'Countries you marked by hand count in Countries and the continents, but bring no trips, places or days.',+ // dawarich-countries+ 'help.guide.dawarich-countries.title': 'Add countries from your recordings',+ 'help.guide.dawarich-countries.goal':+ 'Let Dawarich say which countries you were in over the last year, and put the ones you confirm on the map.',+ 'help.guide.dawarich-countries.step.1':+ 'With the Dawarich addon connected, a Dawarich panel sits at the bottom of the map, left of the statistics, with two tiles. Click Countries.',+ 'help.guide.dawarich-countries.step.2':+ 'The dialog opens on its Countries tab. Click Look for countries: TREK reads the countries and cities your recordings cover in the last 12 months, a month at a time, so give it a moment. Every country your Atlas does not have yet is listed with its flag, how many cities, and the first of them by name, and starts ticked; click a row to leave it out.',+ 'help.guide.dawarich-countries.step.3':+ 'Confirm with the button at the bottom right, which reads Add 5 countries when five rows are ticked. The dialog says how many were added; close it and the map has re-read itself.',+ 'help.guide.dawarich-countries.result':+ 'The confirmed countries carry a colour on the map and count in Countries, recorded as coming from Dawarich. What you marked by hand is untouched.',+ 'help.guide.dawarich-countries.tip.1':+ 'Countries the Atlas already shows as visited, by hand, from a trip or from an earlier check, are left out, so your own marks are never relabelled. A country you removed from the Atlas earlier comes back when you confirm it here.',+ 'help.guide.dawarich-countries.tip.2':+ 'A country name TREK cannot match is listed under the rows rather than dropped, and Check again asks Dawarich once more. The note under the list says that the last 12 months were looked at; that window is fixed.',+ // dawarich-wishes+ 'help.guide.dawarich-wishes.title': 'Tick off wishes from your recordings',+ 'help.guide.dawarich-wishes.goal':+ 'Find out which places on your bucket list you have actually reached, and tick them off on the day it happened.',+ 'help.guide.dawarich-wishes.step.1':+ 'In the Dawarich panel at the bottom of the map, left of the statistics, click Wishlist.',+ 'help.guide.dawarich-wishes.step.2':+ 'The dialog opens on its Wishlist tab. Click Check wishlist: TREK looks through your recordings for every entry that has coordinates. A wish you reached is listed with how close you got, how long you stayed and the day, and starts ticked; one you already ticked off says Already ticked off. Under the list a note counts the entries without coordinates, and the rule stands there too: A wish counts as reached within 250 m and after 20 minutes on the spot.',+ 'help.guide.dawarich-wishes.step.3':+ 'Confirm with the button at the bottom right, which reads Tick off 2 when two rows are ticked. Then close the dialog and open the Bucket List tab of the panel beside it.',+ 'help.guide.dawarich-wishes.result':+ 'Each wish carries a green tick with the date of the stay, not of today; its tooltip says Ticked off from your Dawarich recordings, and a click on the date undoes it.',+ 'help.guide.dawarich-wishes.tip.1':+ 'Driving past does not count: the rule needs both closeness and time, and of several stays that qualify the longest wins. A wish without coordinates cannot be checked, so add places through the search in Add place rather than by name alone.',+ 'help.guide.dawarich-wishes.tip.2':+ 'One check looks at up to 50 entries, the ones not ticked off yet first, and says so when there were more. A wish that was already ticked off keeps its own date.',// ── Screen: collections ────────────────────────────────────────────────────'help.ctx.collections.title': 'Collections','help.ctx.collections.summary':@@ -1510,6 +1542,19 @@ const help: TranslationStrings = {'help.guide.toggle-addon.tip.1': 'MCP off removes the endpoint and the Integrations sections that depend on it.','help.guide.toggle-addon.tip.2':'Vacay, Atlas and Journey are the addons users ask for most; Documents needs storage for uploads.',+ // document-providers+ 'help.guide.document-providers.title': 'Offer a document store',+ 'help.guide.document-providers.goal': 'Decide which stores a trip may keep its documents in step with.',+ 'help.guide.document-providers.step.1':+ 'The Documents tile carries the stores as rows on its shelf: Paperless-ngx, Papra, Nextcloud, OpenCloud and Synology Drive. All five start switched off, and the shelf is only there while Documents itself is on.',+ 'help.guide.document-providers.step.2':+ 'Flip the switch on the Nextcloud row. The message reads Addon updated, and from now on trip owners find Document sync in the Files tab of their trips, with Nextcloud under Connect a provider.',+ 'help.guide.document-providers.result':+ 'The store is on offer on every trip of this TREK; nothing is connected until a trip owner does it.',+ 'help.guide.document-providers.tip.1':+ 'Only whether a store may be offered is decided here. The address and the credentials belong to a trip and are entered in its Files tab by the trip’s owner, never in the admin panel.',+ 'help.guide.document-providers.tip.2':+ 'Switching Documents off switches every store off with it, and a store cannot be switched on while Documents is off: the server answers Enable the Documents addon first. A store on your own network also needs ALLOW_INTERNAL_NETWORK=true on the server.',// install-plugin'help.guide.install-plugin.title': 'Install a plugin','help.guide.install-plugin.goal': 'Add a third-party plugin and give it exactly the permissions it asks for.',@@ -2046,30 +2091,32 @@ const help: TranslationStrings = {'help.ctx.trip-place.bullet.5':'The row at the bottom: Add to Day or Remove from Day while a day is open, then Save to Collection, Navigation, Open Website, Edit and Delete.','help.ctx.trip-place.bullet.6':- 'A place TREK matched with a map provider shows more: that provider’s rating with a review, the phone number, and an Open or Closed ring around the picture with the week’s opening hours behind it.',+ 'A place picked out of the search carries what the TREK index or OpenStreetMap know about it: a green Open or red Closed ring around the picture, judged by the place’s own clock, the phone number under the stars, Opening Hours further down with the day’s line on the row and the whole week behind a click, and its website behind Open Website. Google’s rating shows only on a place found through Google, on a TREK with a Google key.',// read-place'help.guide.read-place.title': 'What the card tells you about a place','help.guide.read-place.goal': 'Read everything the trip knows about one place, in one card.','help.guide.read-place.step.1':'In the days column, click the stop you want to read. The card opens over the map and the stop stays marked in its day.','help.guide.read-place.step.2':- 'The head: the round picture, the name, the address and the exact coordinates. The X on the right closes the card again.',+ 'The head: the round picture, the name, the address and the exact coordinates. A green ring with Open, or a red one with Closed, around the picture says whether the place is open right now, by its own clock, once TREK knows its hours. The X on the right closes the card again.','help.guide.read-place.step.3':- 'Under it the stars every traveller gave the place, with the average and how many voted. Not rated yet while nobody has.',+ 'Under it the stars every traveller gave the place, with the average and how many voted. Not rated yet while nobody has. Right below, the phone number where the place has one: a click on it hands the number to your phone app.','help.guide.read-place.step.4':'Then the description and, below it, the notes. Both are the text from the place’s form, rendered: lists, links and bold all work.','help.guide.read-place.step.5':'Participants says who is going to this stop. Everybody is in until you take somebody out.','help.guide.read-place.step.6':+ 'Opening Hours, further down: the row carries the hours of the day you are looking at, and a click on it unfolds the whole week with that day in bold. Files stands beside it.',+ 'help.guide.read-place.step.7':'The row at the bottom is what you can do from here: take the place off the open day or put it on, save it to a list, open it in a map app, edit it or delete it.','help.guide.read-place.result':- 'The card stays open until you close it with the X or pick another place, and the stop it belongs to stays marked in the days column.',+ 'The card stays open until you close it with the X or pick another place, the week’s hours stay unfolded, and the stop it belongs to stays marked in the days column.','help.guide.read-place.tip.1':'Picked out of the places column the card knows the place but not a stop, so it shows no participants and no booking. Pick the stop inside the day instead and both are there.','help.guide.read-place.tip.2':'Double-click the name to rename the place without opening the form. Enter saves, Escape drops the change.','help.guide.read-place.tip.3':- 'A place TREK could match with a map provider also shows that provider’s rating, a review, the phone number and the opening hours.',+ 'A place typed in by hand shows none of that: the card knows only what its form holds. Open it with Edit, pick it from the suggestions under Search places… and click Update, and the hours, the phone number and the website come with it. Google’s rating needs a Google key.',// rate-place'help.guide.rate-place.title': 'Rate a place','help.guide.rate-place.goal': 'Give a place your own stars, and see what everybody else gave it.',@@ -2378,6 +2425,8 @@ const help: TranslationStrings = {'Right-click anywhere on the map to open the place form at that point, with the address already looked up. The round button at the bottom left swaps the drawn map for aerial imagery.','help.ctx.trip-map.bullet.7':'Show whole trip at the bottom right draws every travel day at once and lists what each one covers; the route icon on a booking’s row draws that booking, and the one in the toolbar above the days draws them all.',+ 'help.ctx.trip-map.bullet.8':+ 'With the Dawarich addon on, the round Dawarich button under Show whole trip draws the route your phone actually recorded: Show recorded route lays it dashed under the planned route, one colour per day, and the button’s label says why there is no line when there is none.',// map-markers'help.guide.map-markers.title': 'Read the map','help.guide.map-markers.goal': 'Know what every pin, badge and bubble on the map is telling you.',@@ -2497,6 +2546,36 @@ const help: TranslationStrings = {'help.guide.map-booking-routes.tip.3':'A booking needs two ends with coordinates before it can be drawn, so a hotel or a restaurant carries no route icon.',+ // map-dawarich-trail+ 'help.guide.map-dawarich-trail.title': 'Show the route you actually travelled',+ 'help.guide.map-dawarich-trail.goal':+ 'Lay the route Dawarich recorded on your phone over the map, dashed beside the one you planned, and read the trip day by day as it really went.',+ 'help.guide.map-dawarich-trail.step.1':+ 'The round Dawarich button sits at the bottom right of the map, under Show whole trip; hovering it says Show recorded route. Click it. TREK asks your Dawarich for the trip’s dates, and a ring spins around the button while the answer is on its way.',+ 'help.guide.map-dawarich-trail.step.2':+ 'The recorded route lands as a dashed line, one colour per day, drawn underneath the planned route so the plan stays readable. The button now reads Hide recorded route. Days are cut at local midnight, and a day folded shut in the days column takes its dashed line off the map along with its stops.',+ 'help.guide.map-dawarich-trail.step.3':+ 'Click Show whole trip as well and every planned day is drawn solid beside the dashed recording. Where the two run together the day went as planned; where the dashed line wanders off is where it did not.',+ 'help.guide.map-dawarich-trail.result':+ 'What you planned and what you actually did are on the map together, dashed against solid, and the card above the buttons still lists the planned days and their distances.',+ 'help.guide.map-dawarich-trail.tip.1':+ 'On or off is remembered per trip for this browser session. While the route is on, TREK asks Dawarich again every two minutes, so a trip under way catches up without a reload; the route itself is never stored, so it is not in TREK’s database, not in backups and not there offline.',+ 'help.guide.map-dawarich-trail.tip.2':+ 'The button’s label explains an empty map: Loading the recorded route… while it is on its way, Nothing was recorded on these dates, The recorded route could not be loaded, or The recorded route needs a connection when TREK is offline.',+ // map-compass+ 'help.guide.map-compass.title': 'Turn the map and find north again',+ 'help.guide.map-compass.goal':+ 'Rotate the map to face the way you are going, and snap it back to north with one click.',+ 'help.guide.map-compass.step.1':+ 'Turn the map with a right-button drag, or hold Ctrl and drag with the left button; on a touch screen, twist with two fingers. The round compass next to the row of category icons at the top of the map turns with it: its arrow always points north, so it leans as far as you have turned.',+ 'help.guide.map-compass.step.2':+ 'Click the compass. Reset north, as the button is called, eases the map back to north at the top and to a flat view, and the arrow stands upright again.',+ 'help.guide.map-compass.result':+ 'The map is north-up and level again, and nothing on the trip has changed: the compass only moves the camera.',+ 'help.guide.map-compass.tip.1':+ 'The compass exists on the MapLibre GL and Mapbox GL maps only; the Leaflet map cannot be turned, so it has none. Map Provider in Settings, under Map, decides which one you use, and Save Map keeps the choice.',+ 'help.guide.map-compass.tip.2':+ 'The click also takes the tilt out: a right-button drag up or down pitches the view, and Reset north levels it along with the turn. On Mapbox GL with 3D Buildings & Terrain on, that flattens the 3D view too, until you tilt it again.',// ── Screen: trip-transports ───────────────────────────────────────────────────────────'help.ctx.trip-transports.title': 'Transports','help.ctx.trip-transports.summary':@@ -2554,6 +2633,26 @@ const help: TranslationStrings = {'Attach file under Files takes the ticket, and Create expense under Costs saves the booking and opens the Costs editor for the fare.','help.guide.add-transport.tip.3':'Travelers marks who is on this ride. As soon as one transport has travelers, the toolbar of the tab grows their avatars and filters the list by them.',+ // import-transport-file+ 'help.guide.import-transport-file.title': 'Read a flight out of its e-ticket',+ 'help.guide.import-transport-file.goal':+ 'Let TREK pull a flight, a train or a ferry out of the ticket the carrier sent, and check it before it is saved.',+ 'help.guide.import-transport-file.step.1':+ 'Click Import from file in the toolbar of the Transports tab, next to Transport. Import booking confirmations opens, the same dialog the Bookings tab has.',+ 'help.guide.import-transport-file.step.2':+ 'Drop the ticket on the box, or click it and pick it: EML, PDF, PKPass, HTML and TXT, up to five files of 10 MB each. The files you chose are named on the box.',+ 'help.guide.import-transport-file.step.3':+ 'Click Import. The dialog closes at once; the reading happens in the background.',+ 'help.guide.import-transport-file.step.4':+ 'A card at the bottom right reports the run under the file’s name. Parsing files… turns into a tick when the reading is done, and the card offers Import. Click it.',+ 'help.guide.import-transport-file.step.5':+ 'A flight opens in Add transport, already filled in: Booking Type on Flight, the airline and the flight number in Title, both airports under Route with Departure and Arrival, their times and their time zones, Airline and Flight No., the Booking Code and the ticket under Files. Check it and click Add.',+ 'help.guide.import-transport-file.result':+ 'The flight is a card in Pending on the Transports tab and a row on the day it leaves, with the ticket under Files, and with both airports known it draws its curve on the map.',+ 'help.guide.import-transport-file.tip.1':+ 'The two tabs share one import: a file that holds a flight and a hotel opens the flight in Add transport and the hotel in New Reservation, one after the other, whichever tab you started from.',+ 'help.guide.import-transport-file.tip.2':+ 'Airports are placed by their code. A station or a port the reading could not locate is named in amber on the card; pick it by hand under Route before you click Add, or the transport draws nothing on the map.',// plan-transit'help.guide.plan-transit.title': 'Plan a public-transit connection','help.guide.plan-transit.goal':@@ -2651,6 +2750,30 @@ const help: TranslationStrings = {'help.guide.transport-on-map.tip.3':'Show all booking routes is a clean slate, not a layer: it discards what the single icons had set, so pressing it twice leaves you with everything on or everything off.',+ // airtrail-import+ 'help.guide.airtrail-import.title': 'Import flights from AirTrail',+ 'help.guide.airtrail-import.goal':+ 'Bring the flights you already keep in AirTrail into the trip in one go, and let them follow AirTrail from then on.',+ 'help.guide.airtrail-import.step.1':+ 'With the AirTrail addon on and your instance connected under Integrations in Settings, the toolbar of the Transports tab carries an AirTrail button beside Transport. Click it.',+ 'help.guide.airtrail-import.step.2':+ 'Import from AirTrail lists the flights of your account in two groups. During this trip holds the ones dated inside the trip, already ticked; Other flights holds the rest, unticked. A flight that is in the trip already is greyed out and marked Imported.',+ 'help.guide.airtrail-import.step.3':+ 'Every row is a tick box with the airline and flight number, the two airports and the date. Click a row to take the flight in or to leave it out; the ones under Other flights come in only when you tick them.',+ 'help.guide.airtrail-import.step.4':+ 'Flights that connect, each leaving from the airport the one before landed at within a day, are framed together. The tick underneath, Import as one flight with a layover in that airport, is on already: leave it on for one booking with a stop, or switch it off to import the legs as separate flights.',+ 'help.guide.airtrail-import.step.5':+ 'Click Import. The button counts the ticked flights, and the message afterwards says how many came in.',+ 'help.guide.airtrail-import.step.6':+ 'The flights are cards under Confirmed, each with a blue AirTrail badge beside its status, and rows on the days they run. A joined connection is one card, with its route running through the layover.',+ 'help.guide.airtrail-import.result':+ 'The flights from AirTrail are cards in the Transports tab and rows on their days, each wearing the AirTrail badge that says where it came from.',+ 'help.guide.airtrail-import.tip.1':+ 'A flight that is in the trip already under the same number and date is skipped, and a message says how many were. Undo in the toolbar above the days takes the whole import back.',+ 'help.guide.airtrail-import.tip.2':+ 'AirTrail stays the source of truth. TREK reads its changes when you open the trip and every few minutes in the background; a flight deleted there keeps its card, with the badge turned to Not synced. Edits made in TREK travel back only with Write changes back to AirTrail switched on under Integrations.',+ 'help.guide.airtrail-import.tip.3':+ 'A joined connection has no single AirTrail flight to follow, so it is a one-time import: it keeps the blue badge, and hovering the badge says so. The same happens to a synced flight you give a stop by hand.',// ── Screen: trip-bookings ─────────────────────────────────────────────────────────────'help.ctx.trip-bookings.title': 'Bookings','help.ctx.trip-bookings.summary':@@ -2802,15 +2925,17 @@ const help: TranslationStrings = {'help.guide.import-booking-file.step.3':'Click Import. The dialog closes at once, because the reading happens in the background.','help.guide.import-booking-file.step.4':- 'A card at the bottom right reports the run, and it follows you through the app and through a reload. When it is done it offers Import, which starts the review: every booking it found opens in the ordinary form, filled in and with its document attached, for you to check and to Add one after another.',+ 'A card at the bottom right reports the run under the file’s name, and it follows you through the app and through a reload. Parsing files… turns into a tick when the reading is done, and the card offers Import. Click it.',+ 'help.guide.import-booking-file.step.5':+ 'Every booking that was found opens in New Reservation, one after another, already filled in. For a hotel that is the name in Title and, when the trip has the place, under Accommodation, its Location / Address, From and To on its nights, Check-in and Check-out, the Booking Code, the confirmation under Files and, with Costs on, the price as Linked expense. Check it and click Add.','help.guide.import-booking-file.result':- 'Each booking you confirmed is a card of its own with its code, its dates and the document it came from; an accommodation also got its nights, and with Costs on, a price that was in the confirmation became an expense.',+ 'The booking is a card in Pending with its nights, its code and the confirmation under Files, the stay sits on those days of the plan, and with Costs on the price is an expense tied to it.','help.guide.import-booking-file.tip.1':'Import from file is there only when the server can read confirmations, which takes either the extractor or the AI Parsing addon. The administrator switches that one under Addons.','help.guide.import-booking-file.tip.2':- 'If nothing could be read the card says so and offers Try AI parsing, which sends the same files straight to the model.',+ 'If nothing could be read the card says so and offers Try AI parsing, which sends the same files straight to the model. A finished parse is kept for ten minutes; start the review inside that window.','help.guide.import-booking-file.tip.3':- 'A finished parse is kept for ten minutes. Start the review inside that window.',+ 'The confirmation is attached only when its type is on the Allowed File Types of the admin settings. PDF is there out of the box; a mail, EML, has to be added first, or the booking is saved without it.',// edit-booking'help.guide.edit-booking.title': 'Change a booking','help.guide.edit-booking.goal':@@ -3318,6 +3443,30 @@ const help: TranslationStrings = {'Throwing a file away and getting it back needs the right to delete files. A member without it sees neither Delete on the row nor the buttons in the trash.','help.guide.files-trash.tip.3': 'A file deleted for good in the trash cannot be brought back.',+ // files-sync+ 'help.guide.files-sync.title': 'Keep the documents in step with a Nextcloud folder',+ 'help.guide.files-sync.goal':+ 'Bind the trip to a folder in your own document store, so that what is uploaded here lands there and what is filed there turns up here.',+ 'help.guide.files-sync.step.1':+ 'Click Document sync, next to Trash at the right end of the toolbar. The dialog opens with the trip’s name under its title. On the left, under Connect a provider, stand the stores an administrator has switched on, each with a line on how it files things, Files in a folder for Nextcloud; on the right it reads Nothing connected yet.',+ 'help.guide.files-sync.step.2':+ 'Click Nextcloud. A smaller dialog opens for the connection, named after the store, with the reminder at the top to use an app password rather than your account password.',+ 'help.guide.files-sync.step.3':+ 'Fill in Address, Username, your Nextcloud login name rather than your email address, and App password, which Nextcloud makes under Settings, Security. Base folder is optional: it is where TREK looks for trip folders, /TREK unless you say otherwise, here /Reisen. Accept a self-signed certificate at the bottom is only for an instance on your own network with such a certificate.',+ 'help.guide.files-sync.step.4':+ 'Click Test connection. TREK reaches the store with what you typed and the footer reads Reached it, signed in as followed by the account’s name, here admin. A password that is refused or an address that cannot be reached is named there instead, and nothing is saved either way.',+ 'help.guide.files-sync.step.5':+ 'Click Connect. The connection is saved with the trip and TREK asks Where should this trip live in Nextcloud? Only what is in that folder is synced. Make a new one creates a folder under the base folder on Create, with a name prefilled from the trip’s title; under Or use one you already have stand the folders that are there already. Click one, here Autumn in Japan.',+ 'help.guide.files-sync.step.6':+ 'The dialog is back: Nextcloud stands under This trip on the left, and its card on the right carries the folder, when it last ran and Sync now. A first run starts by itself; Sync now runs one whenever you like. Once a run is through, the Not synced yet badge beside the name gives way to a green dot, In sync when you point at it, and the flow bar counts the documents TREK and Nextcloud each hold, with the lanes Out to the store and In from the store between them. Close the dialog with the ×.',+ 'help.guide.files-sync.result':+ 'The two documents that were already in the folder stand at the top of the list, uploaded in your name, and every document of the trip is in the folder as well. From now on TREK checks the folder in the background and the folder follows the list.',+ 'help.guide.files-sync.tip.1':+ 'Only the trip’s owner or an instance administrator can bind a trip, since the app password reaches that whole Nextcloud account. Every member can open Document sync, read the card and press Sync now.',+ 'help.guide.files-sync.tip.2':+ 'A store on your own network needs ALLOW_INTERNAL_NETWORK=true on the TREK server, and its address has to be the machine’s address on the network, never localhost. Without that, Test connection answers That address is not allowed.',+ 'help.guide.files-sync.tip.3':+ 'Disconnect on the card ends the pairing and keeps every document on both sides. A folder bound a second time is treated as new, and everything in it comes in again, so after a Disconnect bind an empty folder rather than the old one.',// ── Screen: trip-collab ───────────────────────────────────────────────────────────────'help.ctx.trip-collab.title': 'Collab','help.ctx.trip-collab.summary':