Phase 6: glance widget with cached address

App type changed to widget for glance support. GlanceView shows
event type, date/time, and street+housenumber (or coordinates as
fallback). Addresses are cached in Event storage on first view in
history. Glance-required modules annotated with (:glance). Address
distance threshold raised to 70m.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
EiSiMo 2026-04-13 15:31:46 +02:00
parent eea1a835cd
commit 79cdb9f210
9 changed files with 134 additions and 12 deletions

View file

@ -5,6 +5,7 @@ import Toybox.Time;
// Persists events in Application.Storage as an array of dictionaries,
// ordered oldest newest. Prunes entries older than Config.RETENTION_SEC
// whenever loaded.
(:glance)
module EventStore {
const KEY = "events";
@ -51,6 +52,15 @@ module EventStore {
return Event.fromDict(raw[raw.size() - 1] as Dictionary);
}
function updateAt(index as Number, event as Event) as Void {
var raw = Application.Storage.getValue(KEY);
if (!(raw instanceof Array) || index < 0 || index >= raw.size()) {
return;
}
raw[index] = event.toDict();
Application.Storage.setValue(KEY, raw);
}
// Drops events with timestamp < (now - retention).
function pruneOld() as Void {
var raw = Application.Storage.getValue(KEY);