3.3 KiB
V1.8.3 Node Limit Indicator Fix
Problem
The node limit indicator would disappear when the navigation sheet opened during search/routing, particularly noticeable on Android. The indicator would appear correctly when just the search bar showed, but disappear when the navigation sheet auto-opened.
Root Cause
The issue was in the map positioning architecture, specifically with SheetAwareMap. Here's what happens:
- Search activated: Search bar appears → node limit indicator shifts down 60px (works correctly)
- Navigation sheet opens: Navigation sheet auto-opens →
sheetHeightchanges from 0 to ~300px - Map repositioning:
SheetAwareMapusesAnimatedPositionedwithtop: -sheetHeightto move the entire map up - Indicator disappears: The node limit indicator, positioned at
top: 8.0 + searchBarOffset, gets moved up by 300px along with the map, placing it off-screen
The indicators were positioned relative to the map's coordinate system, but when the sheet opened, the entire map (including indicators) was moved up by the sheet height to keep the center visible above the sheet.
Solution
Brutalist fix: Move the node limit indicator out of the map coordinate system and into screen coordinates alongside other UI overlays.
Files Changed
- map_view.dart: Moved node limit indicator from inside SheetAwareMap to main Stack
- pubspec.yaml: Version bump to 1.8.3+33
- changelog.json: Added release notes
Architecture Changes
// BEFORE - mixed coordinate systems (confusing!)
return Stack([
SheetAwareMap( // Map coordinates
child: FlutterMap([
cameraLayers: Stack([
NodeLimitIndicator(...) // ❌ Map coordinates (moves with map)
])
])
),
NetworkStatusIndicator(...), // ✅ Screen coordinates (fixed to screen)
]);
// AFTER - consistent coordinate system (clean!)
return Stack([
SheetAwareMap( // Map coordinates
child: FlutterMap([
cameraLayers: Stack([
// Only map data (nodes, overlays) - no UI indicators
])
])
),
NodeLimitIndicator(...), // ✅ Screen coordinates (fixed to screen)
NetworkStatusIndicator(...), // ✅ Screen coordinates (fixed to screen)
]);
Architecture Insight
The fix revealed a mixed coordinate system anti-pattern. All UI overlays (compass, search box, zoom buttons, indicators) should use screen coordinates for consistency. Only map data (nodes, overlays, FOV cones) should be in map coordinates.
Result
- Node limit indicator stays visible when navigation sheets open
- Network status indicator also fixed for consistency
- Indicators maintain correct screen position during all sheet transitions
- Consistent behavior across iOS and Android
Testing Notes
To test this fix:
- Start app and wait for nodes to load (node limit indicator should appear if >max nodes)
- Tap search button → search bar appears, indicator shifts down 60px
- Navigation sheet auto-opens → indicator stays visible in screen position (no longer affected by map movement)
- Cancel search → indicator returns to original position
- Repeat workflow → should work reliably every time
The fix ensures indicators stay in their intended screen positions using consistent coordinate system architecture.