From 23b7bd453970192592e203d6b1de2783c89b84ee Mon Sep 17 00:00:00 2001 From: Hanzo_dev <2002samudiojohan@gmail.com> Date: Sat, 28 Feb 2026 22:08:34 -0500 Subject: [PATCH] fix: fully decouple schedules from map search UI and center offers --- frontend/src/views/MapView.vue | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/MapView.vue b/frontend/src/views/MapView.vue index b9718cc..403b4c6 100644 --- a/frontend/src/views/MapView.vue +++ b/frontend/src/views/MapView.vue @@ -51,6 +51,7 @@ const showRouteDropdown = ref(false); const routeCardRef = ref(null); const mappingSequenceId = ref(0); const wasSelectedFromMap = ref(false); +const isInternalSelection = ref(false); const alturaNavbar = ref(64); // Search state @@ -259,6 +260,12 @@ async function initializeMap() { watch( () => routeStore.selectedRouteId, async (routeId, oldRouteId) => { + // Si la selecciΓ³n no viene de dentro de MapView (selectRouteAndClose), + // reseteamos el flag de origen Mapa para que el buscador no se "fije" + if (!isInternalSelection.value) { + wasSelectedFromMap.value = false; + } + // ALWAYS clear markers first when route changes - do this immediately if (oldRouteId !== routeId) { console.log(`Route changing from ${oldRouteId} to ${routeId} - clearing markers`) @@ -395,6 +402,7 @@ async function updatePromoMarkers() { async function selectRouteAndClose(routeId: string, routeName: string) { console.log(`πŸ€– JARVIS: Iniciando viaje hacia ${routeName}`); + isInternalSelection.value = true; wasSelectedFromMap.value = true; await routeStore.selectRoute(routeId, routeName); showRouteDropdown.value = false; @@ -404,6 +412,7 @@ async function selectRouteAndClose(routeId: string, routeName: string) { if (routeStore.selectedRouteStops.length > 0) { await highlightOptimalStopForRoute(); } + isInternalSelection.value = false; } async function updateActiveUnits() { if (!isLoaded.value) return; @@ -607,7 +616,7 @@ async function highlightOptimalStopForRoute() { -
+
@@ -633,7 +642,7 @@ async function highlightOptimalStopForRoute() {