Skip to content

feat: add offline map style switcher - #68

Open
torlando-tech wants to merge 4 commits into
mainfrom
feat/map-style-picker
Open

feat: add offline map style switcher#68
torlando-tech wants to merge 4 commits into
mainfrom
feat/map-style-picker

Conversation

@torlando-tech

Copy link
Copy Markdown
Owner

Summary

  • add a bounded four-style offline map catalog for OSM Bright, Dark Matter, Positron, and Toner
  • activate style-specific PMAS snapshots transactionally with semantic PMP validation, redundant active-slot publication, exact readback, and fail-closed storage handling
  • add the Maps toolbar style-cycle control with worker-owned SD I/O, stale-completion rejection, pack reload, decoded-cache clearing, and visible-tile invalidation
  • update the browser SD importer to publish persistent per-style snapshots, require explicit style selection for rootless ZIPs, and refresh map name/pack ID for each selected archive
  • correct dark-theme styling and cache versioning for the browser style selector/module

Safety properties

  • production firmware probes only four exact allowlisted PMAS paths and never scans SD directories
  • malformed, mismatched, missing, or indeterminate PMAS/PMP data fails closed
  • immutable active packs never fall through to untyped legacy tile content
  • active selection retains redundant generations and exact-byte conflict detection
  • NVS, LittleFS, identities, settings, conversations, and unrelated SD contents are not erased or migrated

Verification

  • 17 focused native/contract tests passed on the final head
  • 18 browser installer tests passed on the final head
  • JavaScript syntax check passed
  • complete host suite passed before the two browser-only follow-up commits
  • pio run -e tdeck passed for the firmware commit
  • pio run -e tdeck-release and release audit passed for the firmware commit
  • physical application flash/readback and two-boot persistence verification completed
  • physical SD inspection confirmed valid PMAS/PMP records and tile payloads for all four styles

Physical validation status

The exact firmware application was flashed and read back successfully, with OTA selection stable across two boots and no panic/watchdog signatures. The SD card now contains valid snapshots for all four styles. Final on-device cycling through all four styles remains a manual acceptance check after reinserting the safely unmounted SD card.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds a four-style offline-map catalog and transactional style activation across the firmware and browser installer.

  • Adds validated, redundant PMAS selection storage and style-specific map-pack loading.
  • Adds an asynchronous Maps toolbar control with lifecycle-scoped request cancellation and cache invalidation.
  • Extends the browser installer to detect or explicitly select styles and publish per-style snapshots.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
lib/tdeck_ui/UI/LXMF/MapScreen.cpp Adds worker-owned style switching and correctly scopes queued requests and completion errors to the current screen lifecycle.
lib/tdeck_ui/Hardware/TDeck/MapStyleCatalog.cpp Implements bounded discovery and transactional activation of allowlisted offline-map styles.
lib/tdeck_ui/Hardware/TDeck/ActiveMapSetCodec.cpp Adds strict encoding, decoding, and resequencing for redundant active-map-set records.
lib/tdeck_ui/Hardware/TDeck/MapTilePack.cpp Extends pack initialization and selection handling for style-specific active map sets.
lib/tdeck_ui/UI/LXMF/MapStyleSelector.cpp Implements bounded style cycling, token ownership, cancellation, and completion reconciliation.
docs/flasher/js/map-installer.js Adds allowlisted style profiles, style-aware ZIP inspection, and persistent per-style snapshot publication.
docs/flasher/index.html Adds the style selector UI and safely renders archive-derived status through text-only DOM updates.

Sequence Diagram

sequenceDiagram
    participant User
    participant MapScreen
    participant Worker
    participant Catalog as MapStyleCatalog
    participant Pack as MapTilePack

    User->>MapScreen: Cycle style
    MapScreen->>MapScreen: Queue request with lifecycle epoch
    MapScreen->>Worker: Notify
    Worker->>Worker: Validate visibility and epoch
    Worker->>Catalog: Activate selected snapshot
    Catalog-->>Worker: Durable catalog result
    Worker->>Pack: Reload active pack
    Worker->>MapScreen: Reconcile selector and invalidate tiles
    alt Screen hidden before request is claimed
        MapScreen->>MapScreen: Advance epoch and cancel request
    else Screen hidden after request is claimed
        Worker->>MapScreen: Reconcile without retaining stale errors
    end
Loading

Reviews (2): Last reviewed commit: "fix: serialize map style activation life..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant