The first revision opened the planner session URL without waypoints,
so the in-browser Yjs doc was empty, no route was computed, and the
Save button shipped an empty GPX → journal callback returned 400 →
\"Saved!\" never appeared and the test timed out.
The real journal→planner handoff (in
\`apps/journal/app/routes/api.routes.\$id.edit-in-planner.ts\`) encodes
the planner's session-creation response (initialWaypoints / noGoAreas /
notes) as URL query params on the redirect. The test now mirrors that,
passing a 2-waypoint encoded blob via the \`?waypoints=\` param.
Also mocks BRouter via the existing \`mockBRouter(page)\` fixture so the
route compute is deterministic — \`planner-coloring.test.ts\` uses the
same pattern. Otherwise the test would race against a real BRouter
cold-start on CI.
Asserts canvas is visible before clicking Save (proxy for \"routeData
is populated\" — the same condition that gates a non-empty GPX in
\`SaveToJournalButton\`).
New \`e2e/journal-planner-save.test.ts\` exercises the full save flow:
1. Seed a routeId + JWT via \`/api/e2e/seed\` (journal).
2. POST to \`/api/sessions\` on the planner with \`callbackUrl\` +
\`callbackToken\` — mirrors what the journal's \`edit-in-planner\`
action does server-to-server.
3. Open the planner session in a real browser.
4. Click \"Save to Journal\". The button POSTs sessionId+GPX to the
planner's \`/api/save-to-journal\` action (Phase A); the action
forwards to the journal callback with the Bearer.
Test 1 asserts:
- The journal's route ends up with geometry (round-trip works).
- The exact JWT string is **never** present in any browser-issued
request body or \`Authorization\` header — i.e. Phase A correctly
keeps the token server-side.
Test 2 asserts:
- A second click on Save reuses the same stored JWT, the journal's
jti consumer rejects it, and the planner UI surfaces the error.
This is the Phase B replay guard exercised end-to-end through the
UI rather than just the API.
Added \`journal-planner-save\` Playwright project (no baseURL — the
test navigates both apps using absolute URLs).
Full repo: pnpm typecheck / lint / test all green (cached).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>