@@ -13,7 +13,6 @@ public sealed partial class AgentEventsPage : Page
1313{
1414 private const int MaxEvents = 400 ;
1515 private readonly List < AgentEventInfo > _allEvents = new ( ) ;
16- private string _activeFilter = "all" ;
1716 private string ? _agentIdFilter ;
1817 private bool _filterDirty ;
1918 private AppState ? _appState ;
@@ -84,6 +83,35 @@ public void Initialize(HubWindow hub)
8483 _appState . AgentEventAdded += OnAgentEventAdded ;
8584 _appState . PropertyChanged += OnAppStateChanged ;
8685 PopulateAgentFilter ( hub ) ;
86+ UpdateLiveBadge ( ) ;
87+ }
88+
89+ private void UpdateLiveBadge ( )
90+ {
91+ var connected = _appState ? . Status == ConnectionStatus . Connected ;
92+ DispatcherQueue ? . TryEnqueue ( ( ) =>
93+ {
94+ if ( connected )
95+ {
96+ LiveDot . Fill = new Microsoft . UI . Xaml . Media . SolidColorBrush (
97+ Microsoft . UI . ColorHelper . FromArgb ( 255 , 255 , 68 , 68 ) ) ;
98+ LiveText . Text = "Live" ;
99+ LiveText . Foreground = new Microsoft . UI . Xaml . Media . SolidColorBrush (
100+ Microsoft . UI . ColorHelper . FromArgb ( 255 , 255 , 68 , 68 ) ) ;
101+ LiveBadge . Background = new Microsoft . UI . Xaml . Media . SolidColorBrush (
102+ Microsoft . UI . ColorHelper . FromArgb ( 32 , 255 , 68 , 68 ) ) ;
103+ }
104+ else
105+ {
106+ LiveDot . Fill = new Microsoft . UI . Xaml . Media . SolidColorBrush (
107+ Microsoft . UI . ColorHelper . FromArgb ( 255 , 128 , 128 , 128 ) ) ;
108+ LiveText . Text = "Offline" ;
109+ LiveText . Foreground = new Microsoft . UI . Xaml . Media . SolidColorBrush (
110+ Microsoft . UI . ColorHelper . FromArgb ( 255 , 128 , 128 , 128 ) ) ;
111+ LiveBadge . Background = new Microsoft . UI . Xaml . Media . SolidColorBrush (
112+ Microsoft . UI . ColorHelper . FromArgb ( 32 , 128 , 128 , 128 ) ) ;
113+ }
114+ } ) ;
87115 }
88116
89117 private void OnAppStateChanged ( object ? sender , System . ComponentModel . PropertyChangedEventArgs e )
@@ -93,6 +121,10 @@ private void OnAppStateChanged(object? sender, System.ComponentModel.PropertyCha
93121 _allEvents . Clear ( ) ;
94122 ApplyFilter ( ) ;
95123 }
124+ else if ( e . PropertyName == nameof ( AppState . Status ) )
125+ {
126+ UpdateLiveBadge ( ) ;
127+ }
96128 }
97129
98130 private void OnAgentEventAdded ( AgentEventInfo evt )
@@ -131,12 +163,6 @@ public void AddEvent(AgentEventInfo evt)
131163 }
132164 }
133165
134- private void OnFilterSelectionChanged ( SelectorBar sender , SelectorBarSelectionChangedEventArgs args )
135- {
136- var tag = sender . SelectedItem ? . Tag as string ;
137- _activeFilter = string . IsNullOrEmpty ( tag ) ? "all" : tag ;
138- ApplyFilter ( ) ;
139- }
140166
141167 private void ApplyFilter ( )
142168 {
@@ -147,10 +173,6 @@ private void ApplyFilter()
147173 filtered = filtered . Where ( e => e . SessionKey != null &&
148174 e . SessionKey . StartsWith ( $ "agent:{ _agentIdFilter } :", StringComparison . OrdinalIgnoreCase ) ) ;
149175
150- // Filter by stream type (use ResolvedStream so "item" events with kind:"tool" match the Tool filter)
151- if ( _activeFilter != "all" )
152- filtered = filtered . Where ( e => e . ResolvedStream . Equals ( _activeFilter , StringComparison . OrdinalIgnoreCase ) ) ;
153-
154176 var list = filtered . ToList ( ) ;
155177 EventsList . ItemsSource = list ;
156178 EventsList . Visibility = list . Count > 0 ? Visibility . Visible : Visibility . Collapsed ;
0 commit comments