Commit Graph

2736 Commits

Author SHA1 Message Date
Maurice 17b47b38b9 test(places): wait for the new tag's tick, not only the tag
The tag reaches the trip's list before the form ticks it, so the button
could be found in the moment between and read as not pressed.
2026-11-17 10:12:33 +01:00
Maurice c203b0a597 test(places): look for the hidden tab's formatting buttons too 2026-11-17 09:27:49 +01:00
Maurice b36fefdf5d test(places): keep the place form's test file at its size
The tab changes had grown it past its line budget; the labels of the texts
are covered by PlaceFormTexts' own tests.
2026-11-17 09:20:46 +01:00
Maurice c8e48460b6 fix(places): settle the gates for the place form rework
The text tabs name their field type for the switch, so it type-checks. The
colour field's sliders run left to right in every language and say so with
dir=ltr and a logical inset. The new phone fields take their sizes from the
type tiers or fs() instead of rem literals, the category field builds its
icon as an element, and the ESLint and theme baselines come down to what the
tree now holds. The tests follow the tabs (only the open tab's field and
formatting bar are shown), the category list and the files row, whose link
button keeps its place before attach.
2026-11-17 09:08:41 +01:00
Maurice 5ecf3001af fix(places): keep the hooks' helper types to their files
knip counts an exported type nothing imports; the tabs' row type and the
hours' field type are only used where they are declared.
2026-11-17 08:57:18 +01:00
Maurice a3f6635633 feat(places): colour tags, tabs for the texts and opening hours on the phone
Tags on the place form are pills in their own colour, with a palette under
the dot that recolours a tag for the whole trip (PUT /trips/:id/tags/:id was
there already, the client now reaches it through repo and store) and a
custom colour field of its own instead of the system picker. A new tag is
made in a colour picked the same way.

Description, notes and the note for one day's visit sit in one card under a
switch, each with a line on where the text shows up; the day tab is named
after its day and is only there with one visit in context. Nothing about the
three fields changes underneath.

Opening hours get a switch for open around the clock next to closed. Google
writes a place open all week as one period on Sunday that never closes; it
read as Sunday open and every other day closed, and now opens every day.

The phone form follows the desktop: category as one field with a list, tags
in one field, the texts switch, and phone, e-mail and opening hours, which it
did not have. The hours and the text tabs are shared hooks (usePlaceHours,
usePlaceTextTabs). Files and costs on the phone sheets are drawn as fields
like the rest, and the paste hint, a keyboard shortcut a phone has no use
for, is gone with its key.
2026-11-17 08:44:46 +01:00
Mariano 33d074c786 feat(places): tags on places, owned by the trip
A place keeps its one category, which decides its marker, and can now carry
any number of tags as extra labels to filter by.

- Tags belong to the trip (tags.trip_id): every member sees the same list and
  whoever may edit the trip's places adds, renames and deletes. Personal tags
  stay what they were.
- The place form picks them on desktop and mobile through one shared hook,
  usePlaceTags, and can add a new tag to the trip on the spot.
- The existing category filter of the places list lists the tags as well.
- Tags show on the place (inspector pills, phone place sheet); the marker is
  untouched.
- MCP: create_place, create_and_assign_place and update_place take `tags`,
  and list/create/update/delete_trip_tag manage a trip's tags.
- /api/trips/:tripId/tags and the tripTags:changed event keep every client
  of the trip in step.
2026-11-17 08:44:10 +01:00
Maurice 35dbcc2103 chore(deps): bump npm dependencies, jsdom 31, isomorphic-dompurify 4 and dotenv 18
The minor and patch group of #3108 without MikroORM: 7.2.9 refuses to set
the OAuth client reference from its client_id (the Postgres probe fails on
OauthTokens.insertToken and OauthConsents.upsertGrant), so MikroORM stays on
7.2.8 and with it better-sqlite3 and kysely, which it pins exactly.

mapbox-gl 3.33 shapes right-to-left text itself and removed setRTLTextPlugin,
so the engine registers nothing any more and @mapbox/mapbox-gl-rtl-text, its
Vite alias and the registration guard go. The WebAssembly module it loads
instead comes from api.mapbox.com, which the CSP already allows.

jsdom 31 and isomorphic-dompurify 4 move together, since the sanitizer needs
jsdom 31. jsdom is also a root devDependency now: listed only in the client,
npm nests it under client/ where vitest's built-in jsdom environment does not
find it.

dotenv 18 is loaded through `import 'dotenv/config'` only, which stays quiet.

Closes #3108, closes #3109, closes #3110, closes #3112
2026-11-16 21:20:33 +01:00
Maurice eb56e77600 fix(studio): hold photos back only in the export's sheets
The print-mode photos held their source back for the print view, but the
assistant also draws pages in print mode and needs its photos loaded. Only
the export's sheets now ask for it, the loader reads a minimal print
document like whenReady, and the new test helpers stay within the client's
TypeScript target and lint baseline.
2026-11-16 10:47:50 +01:00
Maurice 1a50e7f0ac fix(costs): settle up only in the currency the debts were read in
After switching the display currency the flows stayed in the old one until
the new read landed, or for good when it failed offline, and a settle-up
booked those amounts in the new currency. The ledger now remembers the
currency it read, drops answers to older reads and only settles flows read
in the one shown.
2026-11-16 10:45:24 +01:00
Maurice 856d1e5ea5 fix(flight-live): keep a past flight's times in its booking view
The booking dialog and the phone sheet hid their departure and arrival tiles
as soon as the store held any leg of the flight, but a leg long over or never
seen by the feed draws no live card, so such a flight showed no times at
all. Both views now hide the tiles only for legs that get a card.
2026-11-16 10:45:23 +01:00
Maurice aa8d041a33 fix(studio): load a large book's photos a few at a time for the PDF export
Every printed photo got its src at once, off screen in the editor and again
in the print frame, so a journey with a few hundred photos asked for every
original in parallel and the browser failed with insufficient resources.

The print markup now holds the source back, and the print view hands it over
four at a time, retries a failed photo once, gives up on one that never
answers and shows the progress on the Save button.

Closes #3102
2026-11-16 10:30:32 +01:00
Maurice 24bc132476 fix(planner): keep an untimed stop between the bookings it was dropped between
The desktop day list hides the stop a lodging booking puts on the day, but
the places are stored across the full day. Bookings and notes were positioned
by counting only the visible places, so every hidden row ahead of a stop
pushed it one slot behind the booking it was dropped above, and it fell
below the evening flight on every drag or arrow move.

Position bookings and notes in the same full-day count the places are
stored in, and share that count with the page's reorder.

Closes #3100
2026-11-16 10:29:47 +01:00
Maurice f728b568ed test(plugins): avoid a non-null assertion in the new frame visibility tests
The added test used querySelector('iframe')! which pushes the tests
no-non-null-assertion count one over its frozen baseline; cast instead.
2026-11-15 20:39:19 +01:00
Maurice c4a2a91578 fix(plugins): pause and suspend plugin frames when they leave the screen
A tester reported that their own plugin, fine on the web, slowed the app down
badly on a phone. A sandboxed plugin iframe keeps running its timers, polling and
animation even off screen, and on a phone it shares the WebView's main thread with
the whole app, so a heavy one janks everything.

The frame now watches whether it is on screen and the app in the foreground
(IntersectionObserver + page visibility) and forwards it as trek:visibility, so a
plugin can pause its work while hidden; the design kit exposes trek.onVisibility /
trek.isVisible and pauses its own CSS animations via data-hidden. On a phone a
dashboard-widget plugin scrolled well out of view is suspended outright: its iframe
is unmounted and a placeholder holds the widget's height, so an offscreen widget
costs nothing and remounts when it scrolls back.
2026-11-15 20:33:27 +01:00
Maurice a58d0117c6 fix(packing): a lighter visibility switch and bringers side by side in the item window
The picked visibility is a raised light segment on the grey track, like the
other pills in the window, instead of a black block, and the +N of further
bringers sits beside the first picture rather than over its initial.
2026-11-15 15:08:26 +01:00
Maurice 439736e904 fix(packing): stack the item window and the Lists menu on the app's layers
The item window sits on the layer of the other floating menus and the Lists
menu just above the bars, through the z-index tokens instead of numbers, and
the theme baseline follows the files the redesign left with fewer literals.
2026-11-15 12:51:20 +01:00
Maurice a65342574a test: bring the packing, todo and dashboard changes in line with the CI gates
Lower the lint and strict baselines the redesign made smaller, keep the
detail window and the todo tab under the complexity limit by moving their
choices into helpers, read the toast in the detail test through its module
rather than a window global, keep the new dialog focus case in the module's
existing test file, show the panel's progress once in the standalone header,
and point the planner wiring tests at the Lists menu.
2026-11-15 12:30:14 +01:00
Maurice 783a697d95 fix(dashboard): a long trip name in an upcoming booking ends in an ellipsis
The badge holds its text in an element of its own, which the ellipsis needs
inside a flex badge, and the row's middle column may shrink below its content.
2026-11-15 12:23:27 +01:00
Maurice b8966330e0 test: keep the bringer and panel width changes within the lint and RTL ratchets
The bringer tests read their items through a small type instead of any, the
panel hook names its two ceilings after the panels rather than the sides, and
the stored-width test runs on a window wide enough for the map's share.
2026-11-15 12:22:12 +01:00
Maurice cb1b5dd88c fix(dashboard): upcoming bookings read cleanly, pending as a letter on the icon
The PENDING pill beside a title broke long names over several lines; a small
dot on the type icon's corner now carries the status's first letter (A for
Ausstehend, P for Pending), with the word as its tooltip and accessible name.
The time and the trip or place below the name are soft badges instead of a
line strung together with dots. Desktop and phone alike.
2026-11-15 12:22:05 +01:00
Maurice a1f063c703 fix(collections): the add-place search reads as one field and takes the focus
The search runs from a small button inside the field, dark once there is
something to look for, instead of a greyed-out button beside it, and the row
keeps its distance from the address box below. A dialog can now mark the field
it starts in, so this one opens in the search rather than in the name above it.
2026-11-15 12:11:43 +01:00
Maurice b65a1bb65c feat(collections): the map's padlock, and a picked place on the full map keeps the map
The collections map gets the trip map's padlock (#2010): locked, a click on a
place leaves the camera where it is, so places can be clicked through without
the map zooming in and out. One setting for both maps. On the full map a
picked place no longer brings the list back: its details dock on the map's
edge, or open as a sheet on a narrow screen.
2026-11-15 12:11:42 +01:00
Maurice d1cb0a418a feat(todo): the phone's task list takes the look of the packing list
The progress card says how many tasks are done with a slim bar, a round "+"
for a new task and a "..." for the order and the lists; the filters sit in
one tinted track, with "Mine" kept short there; and the tasks are rows of one
card, with priority and due date under the name and the assignee's face.
2026-11-15 12:11:40 +01:00
Maurice 5536d29cbf feat(packing): a calmer packing list, with every item's choices in one window
A row now shows its box, its name and only what is set: the amount from two
up, the pieces packed while packing, and who brings it. A click on the name
opens a small window at the row with the list, amount, pieces packed, weight,
bag, who brings it and who sees it, each as one pill, plus copy and delete,
instead of fields, a bin and menus in menus on every row. Above the lists the
Lists bar keeps Add list and gathers templates, import, export, the order,
hiding packed items, the bags on a narrow screen and the clean-up in one menu;
the progress moves next to the Shared/My list switch. The bag overview stays.

The phone follows the same shape: one "..." sheet for the list's actions, a
sheet per list for its own, a slim row and an item sheet that saves as you go.
Who may change what about an item lives in one module both views read.
2026-11-15 12:11:15 +01:00
Maurice 7bbb5a9f71 fix(packing): anyone on the trip can be put down as the bringer of a shared item, and taken off again (#3098)
A common item only let you pledge yourself. Nobody else could be named,
and a bringer could never be removed, so an item that went personal and back
kept its owner's avatar for good. The item menu now lists every member to
tick on or off, a click on the avatar opens it there, and the add route takes
an optional user_id limited to the trip's members. Taking the owner off
clears the owner. The remove route now checks visibility for the caller, not
for the user named in the path.
2026-11-15 11:00:21 +01:00
Maurice a1bf57b71a feat(planner): planner panels widen as far as the window allows and follow the drag without lag
The side panels stopped at a fixed 520 px, which left a wide screen with a
narrow day plan. Each panel may now take whatever the window leaves once the
map keeps at least 35% of it (never under 360 px), the day plan keeping its
width first when the window shrinks. While a handle is held the width
transition is off, so the panel no longer trails behind the map and its
buttons.
2026-11-15 11:00:11 +01:00
Maurice 87bcb5a519 fix(native): an entry field pushed under the open keyboard by a new row comes back above it
The packing list keeps its entry field open after Enter, and each added item
lands above it. With the keyboard already up no keyboard event fires, so the
field slid under the keyboard after the first entry. While the keyboard is up,
a change to the page now checks the focused field again, once a frame at most.
2026-11-14 23:29:33 +01:00
Maurice bac4599d64 fix(roadtrip): keep the stay on each visit, not on the place (#3092)
A nullable day_assignments.stay_minutes holds the stay of one visit; a visit without one keeps reading the place's duration, so existing trips drive as before. REST PUT /trips/:tripId/assignments/:id/stay and the MCP tool set_assignment_stay write it with day_edit.
2026-11-14 17:48:57 +01:00
Maurice 535761dbd5 fix(journey): draw lines across the antimeridian the short way on the Journey map (#3080) 2026-11-14 17:48:57 +01:00
Maurice 5be521199f fix(share): wrap a note's detail line and long words on a shared trip link (#3082) 2026-11-14 17:48:56 +01:00
Maurice d6905435ae refactor(mobile): move the trip shell's tab switch into a hook of its own, under the size limit 2026-11-14 17:48:56 +01:00
Luffy 6bcc49fc6f fix(notifications): link admin emails to admin notification settings 2026-11-14 16:49:32 +01:00
Maurice 64847e906e fix(vacay): keep the last weekend day selected and restore the weekend days label 2026-11-14 16:49:31 +01:00
Luffy 75d458b06b fix(vacay): correct weekend toggling and remove redundant labels 2026-11-14 16:49:31 +01:00
Maurice a76a96ccca fix(notifications): drop a tab the planner lacks from the URL, link booking mails to the reservations tab, open the chat on the phone 2026-11-14 16:49:20 +01:00
Maurice bfdbf4d811 fix(notifications): format the tests, move the open-planner tab test into its own file, lower the exhaustive-deps baseline 2026-11-14 16:49:20 +01:00
Luffy b068e593fc fix(notifications): update navigation targets for trip and vacay events 2026-11-14 16:49:19 +01:00
Maurice d3ec833ab7 refactor(client): keep the login page's language corner class in a module of its own 2026-11-14 16:45:02 +01:00
Maurice 2bcef51664 fix(native): the login page's language menu stands beside a Duo's status capsule 2026-11-14 16:33:05 +01:00
Maurice 0f42b8b8ae fix(mobile): put the top bar beside a Duo's status capsule and the page below it, full width
Keeping the whole right inset clear gave up a strip of the full height for a
capsule that only sits in the corner. The iOS app now measures an element in
a top corner (iOS 26 safe area with corner adaptation, vertical against
horizontal) and hands its reach and width to the page: the floating bars
stand beside it, the page keeps the full width and starts below it. Without
such an element, on every other device and before iOS 26, nothing changes.
2026-11-14 16:30:58 +01:00
Maurice e6f35158c5 fix(mobile): keep the page clear of a Duo's status capsule and leave a scrolled column's pull to it
TestFlight feedback from an iPhone Duo:

- Folded, the status capsule stands in the right inset and ran over the hero
  card's actions; the page now keeps clear of the side insets as iOS asks
  (.m-page), and a floating bar keeps a little air next to an inset.
- Unfolded, the top bar ignored the trailing inset and the capsule sat on the
  avatar; on a wide window the bars now end before it, by their box, so a
  bar that centres itself still does.
- Dragging the dashboard's second column back up refreshed the page: a pull
  that starts inside a box scrolled on its own now belongs to that box.
2026-11-14 16:19:44 +01:00
Maurice c23518dae0 fix(native): start without the server on Android and keep the offline start on iOS
A tester with a server on his home network could not open the Android app
away from it: after closing the app and turning Wi-Fi off it stayed on the
address screen ("No server answered at this address").

- Android keeps the server's UI itself (TrekOfflineShell): the start page
  and every file of the build, listed by native/offlineShell.ts from the
  server's manifest and downloaded natively. A web view runs no service
  worker on a plain-http server, the usual address of a server at home, so
  the old "Android has the service worker" assumption did not hold.
- Without a network, or once the server failed to load twice, the web view
  serves the copy under the server's origin with Capacitor's bridge; the UI
  runs on its own offline data and the API answers again once the server
  is back. The address screen opens the copy too (openOfflineCopy).
- The check an update asks for no longer locks the app out offline: on both
  platforms a server out of reach is put back on its copy and checked on
  the next launch that reaches it. iOS no longer throws its copy away when
  the update check runs.
2026-11-14 11:34:28 +01:00
Maurice 91f8deb3f3 refactor(mobile): keep the settings views under the size and complexity limits
The user sheet's actions on another account (passkeys, two-factor, SSO
link, delete) are MUserDangerActions with their own confirms, the place
names picker is MPlaceLanguage, and useApiKeys takes its copied flag from
a small useCopiedFlag.
2026-11-14 11:34:28 +01:00
Maurice a40ae60abb feat(mobile): API keys in the phone's settings
- MApiKeysSection: the keys with what each may read, creating one in a sheet
  (name, the areas as chips, the key shown once with a copy button), deleting
  behind a confirm sheet, and the endpoint to copy.
- The list and every action move from ApiKeysSection into useApiKeys, shared
  by both views; the calls go through a small online-only apiKeysRepo, so no
  view reaches the API (offline baseline loses ApiKeysSection and
  AdminSettingsTab).
- The phone's Integrations tab is always there now, as on the desktop: the
  keys in it need no addon.
- A test title no longer breaks on its apostrophe.
2026-11-14 11:19:06 +01:00
Maurice 5caa890523 feat(mobile): notification defaults, SSO unlink, wanderer and place names on the phone
- Admin notifications: the defaults every user's cells start as, one row per
  event with a pill per channel cycling On, Off and Blocked
  (MAdminNotificationDefaults); the grid's constants are shared with the
  desktop panel in notificationDefaultsModel.
- Editing a user offers "Remove SSO link" behind a confirm sheet, as on the
  desktop, once SSO is set up and never for yourself.
- Settings: the wanderer connection (MWandererConnectionSection, on
  useWandererConnection) and the language of place names under General.
- MSetCard takes a brand mark as its icon, not only a lucide icon.
2026-11-14 11:14:09 +01:00
Maurice a3620f9e05 feat(mobile): the admin services section gets what the desktop tab has
- Place search and routing as one card, as on the desktop: TREK's own
  services, today's allowance with a new identity behind a confirm sheet
  (MAdminServiceQuota), sharing place details (MAdminPlaceContrib), the transit
  backend and the place search provider as TREK selects, and the search log.
- The key card holds Google (with its options and the daily request cap,
  MAdminGoogleDailyLimit), Unsplash and Amap, in the desktop order.
- The logic both views need moves into one place: the transit switch into
  useAdminSettingsActions, the allowance figures into serviceIdentityModel,
  and the share-place-details panel into usePlaceContribPanel.
- MAdminSettingsSection renders each section in a function of its own.
- Tests follow the split admin sections (Save order, 2FA label, field marker).
2026-11-14 11:09:22 +01:00
Maurice dbda2d7d7c chore(client): lower the size, theme and knip baselines the mobile settings pass shrank 2026-11-14 10:59:10 +01:00
Maurice ae3dfa2eb7 feat(mobile): admin and settings sections ordered and trimmed like the desktop
- The phone's admin sections follow the desktop sidebar: the same groups
  (Users, Configuration, Maintenance) in its dropdown, Security and Services
  instead of one Settings section, and live flights and booking mails beside
  the addons they configure. An old ?tab=settings link still opens Security.
- Passkey login and the 2FA rule sit with the other ways in; the passkey card
  keeps the domain, and a managed install no longer shows the danger zone.
- MAdminSelect replaces every native select on the admin screens: TREK's own
  field or row pill that opens the picker sheet (permissions, backup schedule,
  invite trip, plugin settings).
- Explanations wait behind an info mark (MHintLabel), as on the desktop: admin
  rows and fields, the settings rows' new `hint`, addon and provider rows.
- Permissions are one line each with the level as a pill; addon rows lose the
  type badge their heading already names; settings buttons no longer wrap.
- "Require 2FA" in every language; admin.tabs.settings is unused and gone.
2026-11-14 10:49:09 +01:00
Maurice bab1ca9dca feat(settings): drop the experimental badge from Mapbox GL 2026-11-14 10:29:49 +01:00