Commit Graph

75 Commits

Author SHA1 Message Date
Doug Borg
91e5177056 Detect config drift in cached tile providers and replace stale instances
When a user edits a tile type's URL template, max zoom, or API key
without changing IDs, the cached DeflockTileProvider would keep the old
frozen config. Now _getOrCreateProvider() computes a config fingerprint
and replaces the provider when drift is detected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:34:01 -07:00
Doug Borg
2d92214bed Add offline-first tile system with per-provider caching and error retry
- Add ServicePolicy framework with OSM-specific rate limiting and TTL
- Add per-provider disk tile cache (ProviderTileCacheStore) with O(1)
  lookup, oldest-modified eviction, and ETag/304 revalidation
- Rewrite DeflockTileProvider with two paths: common (NetworkTileProvider)
  and offline-first (disk cache -> local tiles -> network with caching)
- Add zoom-aware offline routing so tiles outside offline area zoom ranges
  use the efficient common path instead of the overhead-heavy offline path
- Fix HTTP client lifecycle: dispose() is now a no-op for flutter_map
  widget recycling; shutdown() handles permanent teardown
- Add TileLayerManager with exponential backoff retry (2s->60s cap),
  provider switch detection, and backoff reset
- Guard null provider/tileType in download dialog with localized error
- Fix Nominatim cache key to use normalized viewbox values
- Comprehensive test coverage (1800+ lines across 6 test files)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 12:34:01 -07:00
Doug Borg
8983939b05 Delegate network tile fetching to NetworkTileProvider
Replace our custom tile pipeline (fetchRemoteTile / _SimpleSemaphore /
exponential backoff) with flutter_map's built-in NetworkTileProvider,
gaining persistent disk cache, ETag revalidation, RetryClient, and
obsolete request aborting for free.

DeflockTileProvider now extends NetworkTileProvider and overrides
getTileUrl() to route through TileType.getTileUrl() (quadkey,
subdomains, API keys). getImageWithCancelLoadingSupport() routes
between two paths at runtime: the common network path (super) when
no offline areas exist, and a DeflockOfflineTileImageProvider for
offline-first when they do.

- Delete tiles_from_remote.dart (semaphore, retry loop, spatial helpers)
- Simplify MapDataProvider._fetchRemoteTileFromCurrentProvider to plain
  http.get (only used by offline area downloader now)
- Remove dead clearTileQueue/clearTileQueueSelective from MapDataProvider
- Remove 7 tile fetch constants from dev_config.dart
- TileLayerManager now disposes provider on cache clear and uses actual
  urlTemplate for cache key generation
- 9 new tests covering URL delegation, routing, and equality

Closes #87 Phase 2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 20:07:56 -07:00
Doug Borg
f0f23489b5 Fix map jitter when touching map during follow-me animations
Cancel in-progress follow-me animations on pointer-down and suppress
new ones while any pointer is on the map. Without this, GPS position
updates trigger 600ms animateTo() calls that fight with the user's
stationary finger, causing visible wiggle — especially at low zoom
where small geographic shifts cover more pixels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 02:02:51 -07:00
Doug Borg
3dada20ec2 Replace deprecated withOpacity and surfaceVariant APIs
Migrate all withOpacity() calls to withValues(alpha:) and
surfaceVariant to surfaceContainerHighest across the codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-08 14:23:07 -07:00
Doug Borg
c712aba724 Add flutter_lints and fix analyzer errors, dead code, and unused imports 2026-02-08 14:23:06 -07:00
stopflock
659cf5c0f0 Fix fetching and loading indicator in sandbox 2026-02-01 18:38:31 -06:00
stopflock
ba3b844c1e "existing tags" temp profile when editing, "existing operator" profile when such tags exist, full editing of existing nodes via refine tags 2026-02-01 14:50:47 -06:00
stopflock
4a36c52982 Node fetch rework 2026-01-30 19:11:00 -06:00
stopflock
f478a3eb2d Clean up FOV cone debug logging 2026-01-30 18:55:29 -06:00
stopflock
3fc3a72cde Fixes for 360-deg FOVs 2026-01-28 20:21:25 -06:00
stopflock
ae354c43a4 drop approx location support, restore follow me mode on sheet close 2025-12-24 15:29:32 -06:00
stopflock
89fb0d9bbd Trying again to fix GPS. 2025-12-22 16:35:02 -06:00
stopflock
9db7c11a49 Fix approximate location after second GPS refactor 2025-12-17 18:13:39 -06:00
stopflock
f8643da8e2 Refactor GPS again, fix losing GPS lock 2025-12-17 14:49:13 -06:00
stopflock
5312456a15 Better location / gps maybe 2025-12-12 16:26:50 -06:00
stopflock
405ec220d0 Fix map centering when looking at tag sheets, transition to edit sheet 2025-12-07 14:48:45 -06:00
stopflock
16b8acad3a Suspected locations database 2025-12-07 10:23:36 -06:00
stopflock
24214e94f9 Fix node edge blinking, prevent nav+edit conflicts, smarter follow-me w/rt nav 2025-12-05 15:27:01 -06:00
stopflock
cc1a335a49 Fix search/nav button offline behavior 2025-12-04 19:08:18 -06:00
stopflock
bb3d398c9c More camera -> node 2025-12-02 21:17:07 -06:00
stopflock
3d5edf320e Break up map_view monopoly 2025-12-02 20:26:43 -06:00
stopflock
45f1635e10 Get rid of double cache layer, remove tiles from network status indicator, fix status callbacks from split fetches, use tileprovider instead of http catching. 2025-11-24 18:28:36 -06:00
stopflock
9319bbda48 Support FOV range notation: 0-360, 90-270, 10-45;90-125 2025-11-21 19:25:34 -06:00
stopflock
8ed92dcd7e Home screen respect safe areas in all orientations 2025-11-19 13:32:40 -06:00
stopflock
b0a4128bb7 Configurable zoom behaviors, desensitize double tap + drag 2025-11-07 14:29:08 -06:00
stopflock
d9f415c527 Multiple cameras on one pole 2025-10-29 12:17:16 -05:00
stopflock
2a7004e5a2 require profile selection 2025-10-24 13:49:48 -05:00
stopflock
27c404687a Fix north-up UX 2025-10-22 18:46:48 -05:00
stopflock
c8e2727f69 bump ver, get rid of buggy north-lock 2025-10-22 17:36:34 -05:00
stopflock
cd2ab00042 North-up compass and rotation lock 2025-10-22 15:27:28 -05:00
stopflock
de0bd7f275 too much, sorry 2025-10-21 15:11:50 -05:00
stopflock
2ccd01c691 Pre-fetch larger areas to reduce calls to overpass; split large requests up 2025-10-21 10:22:04 -05:00
stopflock
793e735452 Bump version, actually account for HiDiPi displays. Previous commit does not build. 2025-10-09 12:58:19 -05:00
stopflock
b8b9d4b797 deflock-imize node icons fully 2025-10-09 00:02:21 -05:00
stopflock
cc0386ee97 UX and bones of suspected locations 2025-10-06 19:36:54 -05:00
stopflock
f5aeba473b UX tweaks to attribution, download button, allow search in release builds 2025-10-06 10:07:54 -05:00
stopflock
f285a18563 Clean up dev_config, rename more camera -> node 2025-10-05 22:27:18 -05:00
stopflock
111bdc4254 Fix opentopomap x/y, allow searching in release when not offline 2025-10-05 16:48:25 -05:00
stopflock
a08d61fb98 Add other providers, max zoom per tile type 2025-10-05 15:08:27 -05:00
stopflock
5976ab4bab max zoom per tile type 2025-10-05 13:04:48 -05:00
stopflock
fd47813bdf Optional navigation features 2025-10-03 00:09:25 -05:00
stopflock
8b4b9722c4 Navigation settings 2025-10-02 22:47:15 -05:00
stopflock
19de232484 Better pins, bugfixes 2025-10-02 18:29:17 -05:00
stopflock
bac033528c UX actually close 2025-10-02 17:39:29 -05:00
stopflock
763fa31266 Moving the right direction I think 2025-10-02 17:23:17 -05:00
stopflock
b440629ad6 Simultaneous animations for smoothness 2025-10-01 13:45:23 -05:00
stopflock
792f94065d highlight selected node 2025-10-01 13:36:51 -05:00
stopflock
1aeae18ebc Better handoff from tags to edit sheet 2025-10-01 13:27:17 -05:00
stopflock
96b82ef416 Proper centering for all node sheets. still jumps between tags and edit. 2025-10-01 12:34:02 -05:00