"Connect the days" is a whole-drive setting: with it on, the leg from one day's last stop to the next day's first is drawn in the colour of the day it leaves, so the desktop map reads as one continuous drive across every day. The phone has no such view by default. It shows ONE day, and the stage filter went by day number alone, so that connection came along: a line running off the day on screen to a place it never visits, and on this trip the longest thing on the map by far. The assembler now says which lines are connections (`lineJoins`, parallel to `lines` and `lineDays`) rather than leaving each surface to guess, because the day number cannot tell them apart: it reads the leaving day for both a day's own legs and for the drive out of it. A stage drops them; the all-days view keeps them, which is the view the setting is for and is one tap away on the same map, next to the day chips. Routes read back from an older cache carry no marks, so nothing is known to be a join and nothing is dropped: those days draw exactly as they did before.
@trek/shared
Single source of truth for TREK's API contracts, expressed as Zod schemas and consumed by both the server (request validation + inferred DTO types) and the client (typed requests/responses).
This package is part of the incremental NestJS + React 19 migration (see the "Brownfield Rewrite" board). It is intentionally dormant until modules start importing it — adding it changes nothing for users.
Rules
- One folder per domain:
src/<domain>/<domain>.schema.ts(+.spec.ts). - Domain-agnostic building blocks live in
src/common/. - A route is only considered migrated once its contract lives here.
- Schemas are the source of truth; server DTOs and client types are inferred from them
(
z.infer<typeof schema>), never hand-duplicated.
Consumption (dev)
Both apps resolve @trek/shared to this package's TypeScript source:
- Server (
tsx): viapathsinserver/tsconfig.json. - Client (
vite): viaresolve.aliasinclient/vite.config.ts(+pathsfor the type-checker).
Production packaging (Docker / workspace wiring) is introduced in card F2, when the server first depends on this package at runtime. Until then prod builds are untouched.
Not yet here
The canonical error envelope is finalised in card F5 (it must match TREK's current Express error responses byte-for-byte), so it is deliberately not invented in F1.