mirror of
https://github.com/pe1hvh/meshcore-gui.git
synced 2026-03-28 17:42:38 +01:00
fix: route back-button and map popup flicker (#1.13.5)
- Replace two fixed-destination back-buttons on the route page with a single arrow_back button using window.history.back(), so navigation always returns to the calling screen (Messages or Archive). - Guard setIcon() and setPopupContent() in applyDevice/applyContacts behind isPopupOpen() to prevent popup flickering on the 500 ms update tick. - Set fadeAnimation: false and markerZoomAnimation: false on both Leaflet map instances (main map and route map) to eliminate popup flash on first click, particularly noticeable on Raspberry Pi.
This commit is contained in:
18
CHANGELOG.md
18
CHANGELOG.md
@@ -29,6 +29,24 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and [Semantic Ver
|
||||
> Users upgrading from v1.12.x or earlier will notice noticeably faster panel switching,
|
||||
> lower CPU usage during idle operation, and more stable map rendering.
|
||||
|
||||
---
|
||||
## [1.13.5] - 2026-03-14 — Route back-button and map popup flicker fixes
|
||||
|
||||
### Fixed
|
||||
- 🛠 **Route page back-button navigated to main menu regardless of origin** — the two fixed navigation buttons (`/` and `/archive`) are replaced by a single `arrow_back` button that calls `window.history.back()`, so the user is always returned to the screen that opened the route page.
|
||||
- 🛠 **Map marker popup flickered on every 500 ms update tick** — the periodic `applyContacts` / `applyDevice` calls in `leaflet_map_panel.js` invoked `setIcon()` and `setPopupContent()` on all existing markers unconditionally. `setIcon()` rebuilds the marker DOM element; when a popup was open this caused the popup anchor to detach and reattach, producing visible flickering. Both functions now check `marker.isPopupOpen()` and skip icon/content updates while the popup is visible.
|
||||
- 🛠 **Map marker popup appeared with a flicker/flash on first click (main map and route map)** — Leaflet's default `fadeAnimation: true` caused popups to fade in from opacity 0, which on the Raspberry Pi rendered as a visible flicker. Both `L.map()` initialisations (`ensureMap` and `MeshCoreRouteMapBoot`) now set `fadeAnimation: false` and `markerZoomAnimation: false` so popups appear immediately without animation artefacts.
|
||||
|
||||
### Changed
|
||||
- 🔄 `meshcore_gui/gui/route_page.py` — Replaced two fixed-destination header buttons with a single `arrow_back` button using `window.history.back()`.
|
||||
- 🔄 `meshcore_gui/static/leaflet_map_panel.js` — `applyDevice` and `applyContacts` guard `setIcon` / `setPopupContent` behind `isPopupOpen()`. Both `L.map()` calls add `fadeAnimation: false, markerZoomAnimation: false`.
|
||||
- 🔄 `meshcore_gui/config.py` — Version bumped to `1.13.5`.
|
||||
|
||||
### Impact
|
||||
- Back navigation from the route page now always returns to the correct origin screen.
|
||||
- Open marker popups are stable during map update ticks; content refreshes on next tick after the popup is closed.
|
||||
- Popup opening is instant on both maps; no animation artefacts on low-power hardware.
|
||||
|
||||
---
|
||||
## [1.13.4] - 2026-03-12 — Room Server message classification fix
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ from typing import Any, Dict, List
|
||||
# ==============================================================================
|
||||
|
||||
|
||||
VERSION: str = "1.13.4"
|
||||
VERSION: str = "1.13.5"
|
||||
|
||||
|
||||
# ==============================================================================
|
||||
|
||||
@@ -143,12 +143,8 @@ class RoutePage:
|
||||
with ui.header().classes('items-center px-4 py-2 shadow-md'):
|
||||
ui.button(
|
||||
icon='arrow_back',
|
||||
on_click=lambda: ui.navigate.to('/'),
|
||||
).props('flat round dense color=white').tooltip('Back to Dashboard')
|
||||
ui.button(
|
||||
icon='history',
|
||||
on_click=lambda: ui.navigate.to('/archive'),
|
||||
).props('flat round dense color=white').tooltip('Back to Archive')
|
||||
on_click=lambda: ui.run_javascript('window.history.back()'),
|
||||
).props('flat round dense color=white').tooltip('Back')
|
||||
ui.label('🗺️ MeshCore Route').classes(
|
||||
'text-lg font-bold domca-header-text'
|
||||
).style("font-family: 'JetBrains Mono', monospace")
|
||||
|
||||
@@ -81,6 +81,8 @@
|
||||
maxZoom: 19,
|
||||
zoomControl: true,
|
||||
preferCanvas: true,
|
||||
fadeAnimation: false,
|
||||
markerZoomAnimation: false,
|
||||
});
|
||||
|
||||
const state = {
|
||||
@@ -289,8 +291,11 @@
|
||||
}
|
||||
|
||||
state.deviceMarker.setLatLng(latLng);
|
||||
state.deviceMarker.setIcon(icon);
|
||||
state.deviceMarker.setPopupContent(popupHtml);
|
||||
const devicePopupOpen = state.deviceMarker.isPopupOpen();
|
||||
if (!devicePopupOpen) {
|
||||
state.deviceMarker.setIcon(icon);
|
||||
state.deviceMarker.setPopupContent(popupHtml);
|
||||
}
|
||||
state.deviceMarker.options.title = '📡 ' + device.name;
|
||||
}
|
||||
|
||||
@@ -318,8 +323,11 @@
|
||||
}
|
||||
|
||||
existing.setLatLng(latLng);
|
||||
existing.setIcon(markerIcon);
|
||||
existing.setPopupContent(popupHtml);
|
||||
const contactPopupOpen = existing.isPopupOpen();
|
||||
if (!contactPopupOpen) {
|
||||
existing.setIcon(markerIcon);
|
||||
existing.setPopupContent(popupHtml);
|
||||
}
|
||||
existing.options.title = markerTitle;
|
||||
if (!state.layers.contacts.hasLayer(existing)) {
|
||||
state.layers.contacts.addLayer(existing);
|
||||
@@ -577,6 +585,8 @@
|
||||
maxZoom: 19,
|
||||
zoomControl: true,
|
||||
preferCanvas: true,
|
||||
fadeAnimation: false,
|
||||
markerZoomAnimation: false,
|
||||
});
|
||||
host.__meshcoreRouteMap = map;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user