From 12635a48c373daf37a896e055ca933fd6d8110b4 Mon Sep 17 00:00:00 2001 From: Roman Priesol Date: Mon, 7 Sep 2026 22:59:02 +0200 Subject: [PATCH] Badge the exception (not yet cached) instead of the near-universal case MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GpxStore#save converts eagerly, so "cached" is true for nearly every file in the tree already — badging that was just noise. Flipped to PENDING_ICON, shown only for the rare case: a .gpx/.fit dropped straight into data/gpx/ on the filesystem, bypassing the app, and not yet opened. Also add an explicit download button next to delete (DOWNLOAD_ICON) — the file name itself has been a download link since the last commit, but isn't obviously clickable at a glance. --- docs/architecture.adoc | 33 +++++++++++++++++++-------------- public/css/style.css | 16 ++++++++++++++++ public/js/gpx.js | 24 +++++++++++++++++++----- public/js/icons.js | 26 +++++++++++++++++++------- 4 files changed, 73 insertions(+), 26 deletions(-) diff --git a/docs/architecture.adoc b/docs/architecture.adoc index 6222a91..94b099a 100644 --- a/docs/architecture.adoc +++ b/docs/architecture.adoc @@ -282,26 +282,31 @@ multi-second hang on a checkbox click reads as broken in a way the same wait during an upload doesn't. A file that fails to parse still saves fine either way; the error just surfaces on first view instead. A `.geojson` upload skips this path entirely — `geojson` reads and -returns it directly, no cache file, no `Gpx`/`Fit` involved; the file -tree's cached-file icon (`GEOJSON_ICON`, `public/js/icons.js`) always -shows for one, since there's no conversion step it could ever be -waiting on. +returns it directly, no cache file, no `Gpx`/`Fit` involved. +`GpxStore#save` converting eagerly means `cached` is `true` for +almost everything in the tree — the one exception is a `.gpx`/`.fit` +dropped straight into `data/gpx/` on the filesystem, bypassing the +app, and not yet opened. Badging the common case would just be noise, +so the file tree's icon (`PENDING_ICON`, `public/js/icons.js`) marks +that exception instead of the (near-universal) ready state. + Once a `.gpx`/`.fit` is cached, the tree shows it under its converted name instead — `"ride.gpx"` reads as `"ride.gpx.geojson"`, matching the real cache file sitting next to it on disk — since the GeoJSON, not the original, is what's actually rendered on the map from that point on. The original is never deleted or re-parsed once cached, just -not re-shown as itself; the tree's file name is a real link -(`GET /api/gpx/file/?download=1`), the only way to get that -converted form out of the app as an actual file, since the cache is -otherwise an implementation detail with no name of its own to expose. -It's an ``, not a ``, specifically so clicking it downloads -instead of also toggling the row's checkbox — a native ``/`