Skip to content

Commit a1edaab

Browse files
committed
- Session History: The "Graph" tab is now "History." View past sessions on the map with ping markers and camera fit-to-bounds, or open the Noise Floor graph. Tapping history markers opens the same detail sheets as live sessions.
1 parent 90d74ea commit a1edaab

4 files changed

Lines changed: 525 additions & 151 deletions

File tree

lib/providers/app_state_provider.dart

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ class AppStateProvider extends ChangeNotifier with WidgetsBindingObserver {
379379
List<NoiseFloorSession> _storedNoiseFloorSessions = [];
380380
Box<NoiseFloorSession>? _noiseFloorSessionBox;
381381

382+
// History session map view
383+
List<PingEventMarker>? _historySessionMarkers;
384+
bool _viewingHistorySession = false;
385+
382386
// Flag to track if preferences have been loaded from storage
383387
bool _preferencesLoaded = false;
384388

@@ -630,6 +634,10 @@ class AppStateProvider extends ChangeNotifier with WidgetsBindingObserver {
630634
List<NoiseFloorSession> get storedNoiseFloorSessions =>
631635
List.unmodifiable(_storedNoiseFloorSessions);
632636

637+
// History session map view getters
638+
List<PingEventMarker>? get historySessionMarkers => _historySessionMarkers;
639+
bool get viewingHistorySession => _viewingHistorySession;
640+
633641
// Audio service getters
634642
bool get isSoundEnabled => _audioService.isEnabled;
635643
bool get isTxSoundEnabled => _audioService.isTxEnabled;
@@ -7013,6 +7021,29 @@ class AppStateProvider extends ChangeNotifier with WidgetsBindingObserver {
70137021
}
70147022
}
70157023

7024+
/// Show a historical session's ping markers on the map
7025+
void viewHistorySessionOnMap(NoiseFloorSession session) {
7026+
final markers = session.markers
7027+
.where((m) => m.latitude != null && m.longitude != null)
7028+
.toList();
7029+
if (markers.isEmpty) return;
7030+
7031+
_historySessionMarkers = markers;
7032+
_viewingHistorySession = true;
7033+
_requestMapTabSwitch = true;
7034+
debugLog('[GRAPH] Viewing session on map: ${markers.length} markers');
7035+
notifyListeners();
7036+
}
7037+
7038+
/// Dismiss the history session map view
7039+
void clearHistorySession() {
7040+
if (!_viewingHistorySession) return;
7041+
_historySessionMarkers = null;
7042+
_viewingHistorySession = false;
7043+
debugLog('[GRAPH] Cleared history session map view');
7044+
notifyListeners();
7045+
}
7046+
70167047
// ============================================
70177048
// Cleanup
70187049
// ============================================

0 commit comments

Comments
 (0)