mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
fix(planner): make route tools reachable in mobile day plan sheet (#1142)
* wiki: update dev env * wiki: small precision in dev env * fix(planner): make route tools reachable in mobile day plan sheet On mobile, selecting a day closes the plan sheet immediately, so the route tools footer (Route toggle / Optimize / routing profile) - gated on the selected day - was never reachable. Desktop was unaffected. - Add showRouteToolsWhenExpanded prop to DayPlanSidebar: when set, route tools render on any expanded day with 2+ assigned places - Make handleOptimize accept an explicit dayId (defaulting to selectedDayId, preserving desktop behavior) - Keep the distance/duration pill gated on the selected day, since routeInfo belongs to the selected day's calculated route - Enable the prop on the mobile plan sheet in TripPlannerPage * fix(planner): correct route-tools prop doc and dev-environment wiki - Reword the showRouteToolsWhenExpanded JSDoc to list the controls the footer actually renders (Route toggle / Optimize / travel profile); there is no "Open in Google Maps" action in that block. - Wiki: drop the non-existent server test:parity script, document the real shared i18n:parity checks, and fix the i18n note (the translation layer already lives in @trek/shared, it is not "upcoming"). --------- Co-authored-by: jubnl <jgunther021@gmail.com> Co-authored-by: Maurice <mauriceboe@icloud.com>
This commit is contained in:
@@ -58,6 +58,7 @@ git rebase upstream/dev # or: git merge upstream/dev
|
||||
Working on a dedicated branch keeps your changes isolated and makes PRs easier to review:
|
||||
|
||||
```bash
|
||||
# Create a new branch off of dev
|
||||
git checkout -b fix/my-changes origin/dev
|
||||
```
|
||||
|
||||
@@ -70,16 +71,10 @@ Branch naming conventions:
|
||||
|
||||
## 5. Install Dependencies
|
||||
|
||||
Install dependencies for both the client and server:
|
||||
The repo is an npm workspace monorepo. One command at the root installs everything:
|
||||
|
||||
```bash
|
||||
# Client
|
||||
cd client
|
||||
npm i
|
||||
|
||||
# Server
|
||||
cd ../server
|
||||
npm i
|
||||
npm ci
|
||||
```
|
||||
|
||||
---
|
||||
@@ -127,31 +122,70 @@ You can override `KITINERARY_EXTRACTOR_PATH` if you installed the binary to a di
|
||||
|
||||
## 7. Available Scripts
|
||||
|
||||
### Root (`/`)
|
||||
|
||||
These commands run across all workspaces at once and are the recommended way to work:
|
||||
|
||||
| Command | Description |
|
||||
|----------------------|---------------------------------------------------------------------|
|
||||
| `npm run dev` | Build shared, then start shared (watch), server, and client together via `concurrently` |
|
||||
| `npm run build` | Build shared → server → client in order |
|
||||
| `npm test` | Run tests in shared, server, and client |
|
||||
| `npm run test:cov` | Run coverage for server and client |
|
||||
| `npm run test:e2e` | Run end-to-end tests (server) |
|
||||
| `npm run lint` | Lint shared, server, and client |
|
||||
| `npm run format` | Format shared, server, and client |
|
||||
| `npm run format:check` | Check formatting across all workspaces |
|
||||
|
||||
### Shared (`/shared`)
|
||||
|
||||
The `@trek/shared` package is the single source of truth for code shared between the client and server. It holds the **Zod schemas that define the API contracts** (request/response shapes, common primitives, pagination) and the **i18n translation layer** (per-language keys and types). Both workspaces import from it, so schema and translation changes propagate to both sides from one place.
|
||||
|
||||
> **Tip:** run `npm run i18n:parity` (or `i18n:parity:strict`) in this package to verify every locale exposes the same translation keys — the CI parity gate runs the strict variant.
|
||||
|
||||
| Command | Description |
|
||||
|-----------------------------|--------------------------------------|
|
||||
| `npm run build` | Compile shared package (tsup) |
|
||||
| `npm run build:watch` | Compile in watch mode |
|
||||
| `npm test` | Run tests |
|
||||
| `npm run typecheck` | Type-check without emitting |
|
||||
| `npm run i18n:parity` | Check locale key parity |
|
||||
| `npm run i18n:parity:strict`| Strict locale key parity (CI gate) |
|
||||
| `npm run lint` | Lint source |
|
||||
| `npm run format` | Format source |
|
||||
|
||||
### Server (`/server`)
|
||||
|
||||
| Command | Description |
|
||||
|----------------------------|------------------------------------------|
|
||||
| `npm start` | Start the server (production) |
|
||||
| `npm run dev` | Start the server in watch mode (tsx) |
|
||||
| `npm run dev` | Start the server in watch mode |
|
||||
| `npm run build` | Compile server |
|
||||
| `npm run typecheck` | Type-check without emitting |
|
||||
| `npm test` | Run all tests |
|
||||
| `npm run test:unit` | Run unit tests only |
|
||||
| `npm run test:integration` | Run integration tests |
|
||||
| `npm run test:ws` | Run WebSocket tests |
|
||||
| `npm run test:e2e` | Run end-to-end tests |
|
||||
| `npm run test:watch` | Run tests in watch mode |
|
||||
| `npm run test:coverage` | Run tests with coverage report |
|
||||
| `npm run lint` | Lint source |
|
||||
| `npm run format` | Format source |
|
||||
|
||||
### Client (`/client`)
|
||||
|
||||
| Command | Description |
|
||||
|--------------------------|------------------------------------------------------|
|
||||
| `npm run dev` | Start the Vite dev server |
|
||||
| `npm run build` | Build for production (runs icon generation first) |
|
||||
| `npm run preview` | Preview the production build locally |
|
||||
| `npm test` | Run all tests |
|
||||
| `npm run test:unit` | Run unit tests only |
|
||||
| `npm run test:integration` | Run integration tests |
|
||||
| `npm run test:watch` | Run tests in watch mode |
|
||||
| `npm run test:coverage` | Run tests with coverage report |
|
||||
| Command | Description |
|
||||
|----------------------------|------------------------------------------------------|
|
||||
| `npm run dev` | Start the Vite dev server |
|
||||
| `npm run build` | Build for production (runs icon generation first) |
|
||||
| `npm run preview` | Preview the production build locally |
|
||||
| `npm test` | Run all tests |
|
||||
| `npm run test:unit` | Run unit tests only |
|
||||
| `npm run test:integration` | Run integration tests |
|
||||
| `npm run test:watch` | Run tests in watch mode |
|
||||
| `npm run test:coverage` | Run tests with coverage report |
|
||||
| `npm run lint` | Lint source |
|
||||
| `npm run format` | Format source |
|
||||
|
||||
---
|
||||
|
||||
@@ -162,7 +196,7 @@ git add .
|
||||
git commit -m "fix: describe your change"
|
||||
|
||||
# Push to your fork's dev branch
|
||||
git push origin fix/my-changes:dev
|
||||
git push origin fix/my-changes
|
||||
|
||||
# Or if working directly on dev
|
||||
git push origin dev
|
||||
@@ -175,5 +209,5 @@ Then open a Pull Request from your fork to `mauriceboe/TREK` targeting the `dev`
|
||||
## Tips
|
||||
|
||||
- Always branch off from an up-to-date `dev` — run `git fetch upstream && git rebase upstream/dev` before starting new work.
|
||||
- Run tests before pushing: `npm run test` in both `client/` and `server/`.
|
||||
- Run tests before pushing: `npm test` at the repo root runs all workspaces.
|
||||
- Follow the commit message conventions described in the [[Contributing]] guidelines.
|
||||
Reference in New Issue
Block a user