From 9e7aa4647d5c4d869a1efdf07ef9ef1793902122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Sat, 11 Apr 2026 02:58:05 +0200 Subject: [PATCH] Fix: rename map cursor awareness field to avoid y-codemirror collision y-codemirror.next uses the awareness 'cursor' field for text editor cursor positions. Our map cursor tracker was using the same field name, causing Invalid LatLng errors when the receiving participant tried to render a CodeMirror cursor object as map coordinates. Renamed to 'mapCursor' to avoid the collision. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/planner/app/components/PlannerMap.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/planner/app/components/PlannerMap.tsx b/apps/planner/app/components/PlannerMap.tsx index c6ca334..2a9407d 100644 --- a/apps/planner/app/components/PlannerMap.tsx +++ b/apps/planner/app/components/PlannerMap.tsx @@ -152,14 +152,14 @@ function CursorTracker({ awareness }: { awareness: YjsState["awareness"] }) { const localId = awareness.clientID; const handleMouseMove = (e: L.LeafletMouseEvent) => { - awareness.setLocalStateField("cursor", { + awareness.setLocalStateField("mapCursor", { lat: e.latlng.lat, lng: e.latlng.lng, }); }; const handleMouseOut = () => { - awareness.setLocalStateField("cursor", null); + awareness.setLocalStateField("mapCursor", null); }; map.on("mousemove", handleMouseMove); @@ -169,10 +169,10 @@ function CursorTracker({ awareness }: { awareness: YjsState["awareness"] }) { const states = awareness.getStates(); const newCursors = new Map(); states.forEach((state, clientId) => { - if (clientId !== localId && state.cursor && state.user) { + if (clientId !== localId && state.mapCursor && state.user) { newCursors.set(clientId, { - lat: state.cursor.lat, - lng: state.cursor.lng, + lat: state.mapCursor.lat, + lng: state.mapCursor.lng, color: state.user.color, name: state.user.name, });