Fix waypoint loading in Edit in Planner flow
Three issues fixed: 1. GPX parser used browser DOMParser which doesn't exist in Node/Vite SSR. Added async parseGpxAsync() using linkedom for server-side parsing. 2. Server-side session initialization stored waypoints in a Yjs doc instance separate from the Vite WebSocket plugin's doc store. Moved waypoint initialization to client-side: API returns parsed waypoints, client adds them to Yjs after sync. 3. GPX was encoded in URL params causing HTTP 431. Now the Journal creates a Planner session via API (POST body), and only passes compact waypoint coordinates in URL params. Verified: Journal route → Edit in Planner → 4 waypoints loaded, route computed (79.3km), elevation profile, Save to Journal ready. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2e2dbe05c1
commit
14b179bb0c
9 changed files with 201 additions and 13 deletions
|
|
@ -21,10 +21,11 @@ interface SessionViewProps {
|
|||
callbackUrl?: string;
|
||||
callbackToken?: string;
|
||||
returnUrl?: string;
|
||||
initialWaypoints?: Array<{ lat: number; lon: number; name?: string }>;
|
||||
}
|
||||
|
||||
export function SessionView({ sessionId, callbackUrl, callbackToken, returnUrl }: SessionViewProps) {
|
||||
const yjs = useYjs(sessionId);
|
||||
export function SessionView({ sessionId, callbackUrl, callbackToken, returnUrl, initialWaypoints }: SessionViewProps) {
|
||||
const yjs = useYjs(sessionId, initialWaypoints);
|
||||
const { isHost, computing, routeStats, requestRoute } = useRouting(yjs);
|
||||
const [highlightPosition, setHighlightPosition] = useState<[number, number] | null>(null);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue