Show a GeoJSON icon next to files with a ready cache

GpxStore#tree now reports a "cached" flag per file (reusing the same
mtime freshness check geojson() already does); the file tree shows a
small curly-braces icon next to any file whose conversion is already
on disk, so it's visible which files will toggle on instantly versus
which still need to parse.
This commit is contained in:
randy committed 2026-09-07 22:44:04 +02:00
1 parent dd0ad6d845
commit 44d235bbcf
4 files changed
+56 -4

No files matched your search

+10
View File
@@ -6,6 +6,7 @@ import {
WAYPOINT_ICON,
TRACK_ICON,
ROUTE_ICON,
GEOJSON_ICON,
MAP_MARKER_ICON,
POI_ICONS,
PARK4NIGHT_TAGS,
@@ -276,6 +277,7 @@ export class GpxPanelControl {
name.title = file.name;
label.appendChild(checkbox);
(file.kinds || []).forEach((kind) => label.appendChild(this._kindIcon(kind)));
if (file.cached) label.appendChild(this._cachedIcon());
label.appendChild(name);
row.appendChild(label);
row.appendChild(this._deleteButton(() => this._deleteFile(file.path)));
@@ -299,6 +301,14 @@ export class GpxPanelControl {
return icon;
}
_cachedIcon() {
const icon = document.createElement("span");
icon.className = "gpx-tree__kind-icon";
icon.innerHTML = GEOJSON_ICON;
icon.title = "Ready to view instantly (GeoJSON cached)";
return icon;
}
_deleteButton(onClick) {
const button = document.createElement("button");
button.type = "button";