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
@@ -54,6 +54,16 @@ export const WAYPOINT_ICON = `
export const TRACK_ICON = GPX_ICON;
// Shown next to a file whose GeoJSON conversion is already cached on disk
// (GpxStore#geojson) — ready to view instantly instead of paying REXML's
// parse cost on click. Curly braces read as "structured data ready", the
// same shorthand most editors/tools use for JSON.
export const GEOJSON_ICON = `
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 4c-1.5 0-2 .8-2 2v3c0 1-.5 1.5-1.5 1.5 1 0 1.5.5 1.5 1.5v3c0 1.2.5 2 2 2"/>
<path d="M15 4c1.5 0 2 .8 2 2v3c0 1 .5 1.5 1.5 1.5-1 0-1.5.5-1.5 1.5v3c0 1.2-.5 2-2 2"/>
</svg>`;
// Same shape as TRACK_ICON, dashed — a route is planned rather than
// recorded, the same visual convention most map apps use for the
// distinction.