diff --git a/installer/registry.jsonl b/installer/registry.jsonl index dff2dce..583316f 100644 --- a/installer/registry.jsonl +++ b/installer/registry.jsonl @@ -21,3 +21,5 @@ {"ts":"2026-05-04T08:32:10Z","action":"cleanup","deleted_orphaned_sessions":0,"deleted_logs":0,"retention_days":30} {"ts":"2026-05-04T08:37:04Z","session":"20260504-083250_mva154_enduro-phase3-bugfix_d0a2","host":"mva154","status":"success","agent":"dev","files":["/home/slin/enduro-trails/prototype/app.py","/home/slin/enduro-trails/prototype/static/app.js"]} {"ts":"2026-05-04T09:24:59Z","action":"cleanup","deleted_orphaned_sessions":0,"deleted_logs":0,"retention_days":30} +{"ts":"2026-05-06T08:05:10Z","action":"cleanup","deleted_orphaned_sessions":0,"deleted_logs":0,"retention_days":30} +{"ts":"2026-05-06T08:09:32Z","session":"20260506-080710_mva154_enduro-route-mini-onboarding_5c7e","host":"mva154","status":"success","agent":"dev","files":["/home/slin/enduro-trails/prototype/static/app.js","/home/slin/enduro-trails/prototype/static/app.css","/home/slin/enduro-trails/prototype/static/index.html"]} diff --git a/tasks/enduro-trails/prototype/static/app.css b/tasks/enduro-trails/prototype/static/app.css index 87017cf..369e327 100644 --- a/tasks/enduro-trails/prototype/static/app.css +++ b/tasks/enduro-trails/prototype/static/app.css @@ -725,6 +725,12 @@ body.has-map-mode #sheet-backdrop.visible { pointer-events: none; } } .mini-add-btn:active { opacity: 0.8; transform: scale(0.94); } +/* ── Route onboarding mini-bar ───────────────── */ +#mini-onboard-pin svg { + width: 22px; + height: 28px; +} + @media (min-width: 768px) { #sheet-route-mini { left: 72px; width: 380px; right: auto; border-radius: 0 14px 0 0; } } diff --git a/tasks/enduro-trails/prototype/static/app.js b/tasks/enduro-trails/prototype/static/app.js index bda7eb2..ddafdb3 100644 --- a/tasks/enduro-trails/prototype/static/app.js +++ b/tasks/enduro-trails/prototype/static/app.js @@ -411,13 +411,13 @@ function toggleRouteMode() { clearRoute(); window._map.getCanvas().style.cursor = ''; } else { - // Enter route mode - do NOT open sheet + // Enter route mode - show onboarding mini-bar instead of full sheet deactivateAllModes(); routeMode = true; btn.classList.add('active'); clearRoute(); window._map.getCanvas().style.cursor = 'crosshair'; - openSheet('sheet-route'); + showRouteOnboardingMini(); } updateMapModeClass(); } @@ -442,6 +442,7 @@ function clearRoute() { document.getElementById('route-cards').innerHTML = ''; document.getElementById('waypoints-list').innerHTML = ''; if (routeMode && map) map.getCanvas().style.cursor = 'crosshair'; + hideMiniOnboard(); } function addWaypointMode() { @@ -1487,9 +1488,11 @@ function initRouteClicks(map) { routeWaypoints.push({ lon: lng, lat: lat }); rebuildWaypointMarkers(); renderWaypointsList(); document.getElementById('route-status').textContent = 'Тапни точку финиша'; + showRouteOnboardingMini(); // switch to finish prompt } else if (routeWaypoints.length === 1) { routeWaypoints.push({ lon: lng, lat: lat }); rebuildWaypointMarkers(); renderWaypointsList(); + hideMiniOnboard(); buildRoute(); } }); @@ -2321,6 +2324,123 @@ function miniAddWaypoint() { if (statsEl) statsEl.textContent = 'Тапни на карте для добавления точки'; } +function showRouteOnboardingMini() { + if (routeWaypoints.length >= 2) { + hideMiniOnboard(); + showMiniRouteSheet(); + return; + } + const isStart = routeWaypoints.length === 0; + const label = isStart ? 'S' : 'F'; + const color = isStart ? '#2EA043' : '#FF3B1F'; + const hint = isStart ? 'Тапни на карте — старт' : 'Тапни на карте — финиш'; + + // Show onboarding div, hide normal mini-bar content + document.getElementById('mini-onboard').style.display = 'flex'; + document.getElementById('mini-dot').style.display = 'none'; + document.getElementById('mini-label').style.display = 'none'; + document.getElementById('mini-stats').style.display = 'none'; + document.getElementById('mini-wheel').style.display = 'none'; + const arrows = document.querySelector('.mini-route-arrows'); + if (arrows) arrows.style.display = 'none'; + const addBtn = document.getElementById('mini-add-btn'); + if (addBtn) addBtn.style.display = 'none'; + + // Set pin and hint + document.getElementById('mini-onboard-pin').innerHTML = waypointPinSvg(label, color); + document.getElementById('mini-onboard-hint').textContent = hint; + + // Show mini-bar and raise map controls + document.getElementById('sheet-route-mini').classList.add('visible'); + const ctrl = document.getElementById('map-controls-r'); + if (ctrl) ctrl.style.bottom = '148px'; + + // Search button handler + const searchBtn = document.getElementById('mini-onboard-search-btn'); + searchBtn.onclick = () => toggleMiniOnboardSearch(isStart ? 'start' : 'finish'); +} + +function hideMiniOnboard() { + document.getElementById('mini-onboard').style.display = 'none'; + document.getElementById('mini-onboard-search-panel').style.display = 'none'; + // Restore normal mini-bar elements + document.getElementById('mini-dot').style.display = ''; + document.getElementById('mini-label').style.display = ''; + document.getElementById('mini-stats').style.display = ''; + document.getElementById('mini-wheel').style.display = ''; + const arrows = document.querySelector('.mini-route-arrows'); + if (arrows) arrows.style.display = ''; + const addBtn = document.getElementById('mini-add-btn'); + if (addBtn) addBtn.style.display = ''; +} + +function toggleMiniOnboardSearch(type) { + const panel = document.getElementById('mini-onboard-search-panel'); + const isVisible = panel.style.display !== 'none'; + if (isVisible) { + panel.style.display = 'none'; + return; + } + panel.style.display = 'block'; + const input = document.getElementById('mini-onboard-search-input'); + input.value = ''; + document.getElementById('mini-onboard-search-results').innerHTML = ''; + setTimeout(() => input.focus(), 50); + + let timeout = null; + input.oninput = () => { + clearTimeout(timeout); + const q = input.value.trim(); + const resultsEl = document.getElementById('mini-onboard-search-results'); + if (q.length < 2) { resultsEl.innerHTML = ''; return; } + timeout = setTimeout(() => _doMiniOnboardSearch(type, q, resultsEl), 400); + }; +} + +async function _doMiniOnboardSearch(type, query, resultsEl) { + resultsEl.innerHTML = '