diff --git a/apps/planner/app/components/PlannerMap.tsx b/apps/planner/app/components/PlannerMap.tsx
index 73a5c27..5ee0ded 100644
--- a/apps/planner/app/components/PlannerMap.tsx
+++ b/apps/planner/app/components/PlannerMap.tsx
@@ -14,17 +14,21 @@ import { ColoredRoute, findSegmentForPoint, type ColorMode } from "./ColoredRout
import { RouteInteraction } from "./RouteInteraction";
import "leaflet/dist/leaflet.css";
-function waypointIcon(index: number, overnight?: boolean): L.DivIcon {
+function waypointIcon(index: number, overnight?: boolean, highlighted?: boolean): L.DivIcon {
const bg = overnight ? "#8B6D3A" : "#2563eb";
+ const size = highlighted ? 30 : 24;
+ const offset = size / 2;
+ const ring = highlighted ? `outline:3px solid ${bg};outline-offset:2px;` : "";
return L.divIcon({
className: "",
html: `
${overnight ? "☾" : index + 1}
`,
iconSize: [0, 0],
});
@@ -66,6 +70,7 @@ interface PlannerMapProps {
onRouteRequest?: (waypoints: WaypointData[]) => void;
onImportError?: (message: string) => void;
highlightPosition?: [number, number] | null;
+ highlightedWaypoint?: number | null;
days?: DayStage[];
}
@@ -228,7 +233,7 @@ function NoGoAreaButton({ active, onClick }: { active: boolean; onClick: () => v
);
}
-export function PlannerMap({ yjs, onRouteRequest, highlightPosition, onImportError, days }: PlannerMapProps) {
+export function PlannerMap({ yjs, onRouteRequest, highlightPosition, highlightedWaypoint, onImportError, days }: PlannerMapProps) {
const { t } = useTranslation("planner");
const [waypoints, setWaypoints] = useState([]);
const [draggingOver, setDraggingOver] = useState(false);
@@ -466,7 +471,7 @@ export function PlannerMap({ yjs, onRouteRequest, highlightPosition, onImportErr
key={i}
position={[wp.lat, wp.lon]}
draggable
- icon={waypointIcon(i, wp.overnight)}
+ icon={waypointIcon(i, wp.overnight, highlightedWaypoint === i)}
eventHandlers={{
mouseover: () => {
routeInteractionSuspendedRef.current = true;
diff --git a/apps/planner/app/components/SessionView.tsx b/apps/planner/app/components/SessionView.tsx
index cadb4ef..c6c8f17 100644
--- a/apps/planner/app/components/SessionView.tsx
+++ b/apps/planner/app/components/SessionView.tsx
@@ -142,7 +142,7 @@ function ColorModeToggle({ yjs }: { yjs: YjsState }) {
);
}
-function SidebarTabs({ yjs, routeStats, days, onWaypointHover }: { yjs: YjsState; routeStats: ReturnType["routeStats"]; days: ReturnType; onWaypointHover: (position: [number, number] | null) => void }) {
+function SidebarTabs({ yjs, routeStats, days, onWaypointHover }: { yjs: YjsState; routeStats: ReturnType["routeStats"]; days: ReturnType; onWaypointHover: (index: number | null) => void }) {
const { t } = useTranslation("planner");
const [tab, setTab] = useState<"waypoints" | "notes">("waypoints");
@@ -193,6 +193,7 @@ export function SessionView({ sessionId, callbackUrl, callbackToken, returnUrl,
useUndoShortcuts(yjs?.undoManager ?? null);
const days = useDays(yjs);
const [highlightPosition, setHighlightPosition] = useState<[number, number] | null>(null);
+ const [highlightedWaypoint, setHighlightedWaypoint] = useState(null);
const { toasts, addToast } = useToasts();
useAwarenessToasts(yjs, t, addToast);
@@ -285,14 +286,14 @@ export function SessionView({ sessionId, callbackUrl, callbackToken, returnUrl,
}
>
- addToast(msg, "error")} days={days} />
+ addToast(msg, "error")} days={days} />
-
+
{toasts.length > 0 && (
diff --git a/apps/planner/app/components/WaypointSidebar.tsx b/apps/planner/app/components/WaypointSidebar.tsx
index 5d53651..3c2d645 100644
--- a/apps/planner/app/components/WaypointSidebar.tsx
+++ b/apps/planner/app/components/WaypointSidebar.tsx
@@ -30,7 +30,7 @@ interface WaypointSidebarProps {
elevationLoss?: number;
};
days: DayStage[];
- onWaypointHover?: (position: [number, number] | null) => void;
+ onWaypointHover?: (index: number | null) => void;
}
export function WaypointSidebar({ yjs, routeStats, days, onWaypointHover }: WaypointSidebarProps) {
@@ -90,7 +90,7 @@ export function WaypointSidebar({ yjs, routeStats, days, onWaypointHover }: Wayp
onWaypointHover?.([wp.lat, wp.lon])}
+ onMouseEnter={() => onWaypointHover?.(i)}
onMouseLeave={() => onWaypointHover?.(null)}
>