Skip to content

Reduce map rebuild work during live tracking#12

Draft
robekl wants to merge 9 commits intoMeshMapper:devfrom
robekl:fix/reduce-live-rebuilds
Draft

Reduce map rebuild work during live tracking#12
robekl wants to merge 9 commits intoMeshMapper:devfrom
robekl:fix/reduce-live-rebuilds

Conversation

@robekl
Copy link
Copy Markdown
Contributor

@robekl robekl commented Mar 11, 2026

Problem

The live map path rebuilt from broad app-state notifications, including frequent timer-driven updates unrelated to map data. It also recreated network tile providers during rebuilds, causing avoidable work during active tracking.

Change

Narrowed the map's subscriptions to map-relevant state only, introduced a dedicated revision signal for map data mutations, and reused tile providers instead of recreating them on each rebuild.

Why This Fixes It

The map now rebuilds when map inputs actually change rather than on every unrelated provider notification. Reusing tile providers also avoids repeated client allocation. Together, those changes reduce runtime churn on the hottest UI path during wardriving.

@MrAlders0n
Copy link
Copy Markdown
Contributor

Hey! Great optimization, context.select() is the right call here. A few things worth looking at if you have time:

  1. The 17-field anonymous record type is copy-pasted in three places, so if one changes they all need to change. Mind pulling it into a typedef MapState = (...) at the top of the file?
  2. _baseTileProvider and _overlayTileProvider get created in initState() but never disposed. Pretty sure CancellableNetworkTileProvider holds HTTP clients so those should probably get .dispose() calls in dispose().
  3. The repeater MarkerLayer block looks like it picked up a couple extra spaces of indentation compared to the ones above it.
  4. A doc comment on _markMapDataChanged() would be nice, just so future contributors know that forgetting to call it means the map silently shows stale data.

Also, are you on our Discord?

MrAlders0n and others added 8 commits March 22, 2026 14:14
…markers changed from purple to cyan, RX markers changed from blue to purple. TX (green) and Trace (cyan) were already aligned. Applies to map markers, noise floor chart, status bar chips, log screen filters, and home screen stats.
…markers changed from purple to cyan, RX markers changed from blue to purple. TX (green) and Trace (cyan) were already aligned. Applies to map markers, noise floor chart, status bar chips, log screen filters, and home screen stats.

- Map coverage dots now draw in chronological order instead of by category. When your path crosses over itself, the most recent ping always renders on top regardless of type.
- Reduced the thick white outline on map coverage dots to a subtle semi-transparent border, improving readability when markers cluster together. Repeater ID markers retain their original styling.
…nds (TX/RX pings) would work reliably in some sessions but not at all in others.
…nd Active/Hybrid mode buttons are now hidden instead of showing disabled "Zone Full" states. The Passive mode button expands to fill the full control panel width. Applies to portrait, compact, and landscape layouts.
@robekl
Copy link
Copy Markdown
Contributor Author

robekl commented Mar 23, 2026

That all makes sense. PR updated.

@446564 446564 marked this pull request as draft April 15, 2026 21:31
@446564
Copy link
Copy Markdown
Collaborator

446564 commented Apr 15, 2026

please resolve conflicts, likely of note is that dev is now formatted with dart format ., so ensure your changes are formatted correctly to pass CI.

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.

3 participants