Badge the exception (not yet cached) instead of the near-universal case
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.
This commit is contained in:
1 parent
cd92dadf6a
commit
12635a48c3
4 files changed
+73
-26
No files matched your search
+19
-7
@@ -54,14 +54,26 @@ 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 = `
|
||||
// Shown next to a file whose GeoJSON conversion is NOT yet cached on disk
|
||||
// (GpxStore#geojson) — the uncommon case, since GpxStore#save converts
|
||||
// eagerly at upload time; this only happens for a .gpx/.fit dropped
|
||||
// straight into data/gpx/ on the filesystem, bypassing the app, and not
|
||||
// yet opened. Everything uploaded normally is cached almost immediately,
|
||||
// so badging the common case would just be noise — this badges the
|
||||
// exception instead.
|
||||
export const PENDING_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"/>
|
||||
<circle cx="12" cy="12" r="8"/>
|
||||
<path d="M12 8v4l3 2"/>
|
||||
</svg>`;
|
||||
|
||||
// A small download button next to each tree file's delete button — the
|
||||
// name link (see gpx.js's _renderFile) does the same thing, but isn't
|
||||
// obviously clickable at a glance, so this is the discoverable version.
|
||||
export const DOWNLOAD_ICON = `
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M12 4v11M8 11l4 4 4-4"/>
|
||||
<path d="M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3"/>
|
||||
</svg>`;
|
||||
|
||||
// Same shape as TRACK_ICON, dashed — a route is planned rather than
|
||||
|
||||
Reference in new issue
Block a user