7
7
using CommunityToolkit . WinUI ;
8
8
using ManagedCommon ;
9
9
using Microsoft . CmdPal . Common . Services ;
10
+ using Microsoft . CmdPal . UI . Events ;
10
11
using Microsoft . CmdPal . UI . Settings ;
11
12
using Microsoft . CmdPal . UI . ViewModels ;
12
13
using Microsoft . CmdPal . UI . ViewModels . MainPage ;
13
14
using Microsoft . CmdPal . UI . ViewModels . Messages ;
14
15
using Microsoft . CommandPalette . Extensions ;
15
16
using Microsoft . Extensions . DependencyInjection ;
17
+ using Microsoft . PowerToys . Telemetry ;
16
18
using Microsoft . UI . Dispatching ;
17
19
using Microsoft . UI . Xaml . Controls ;
18
20
using Microsoft . UI . Xaml . Media . Animation ;
@@ -91,6 +93,8 @@ public void Receive(NavigateBackMessage message)
91
93
{
92
94
// If we can't go back then we must be at the top and thus escape again should quit.
93
95
WeakReferenceMessenger . Default . Send < DismissMessage > ( ) ;
96
+
97
+ PowerToysTelemetry . Log . WriteEvent ( new CmdPalDismissedOnEsc ( ) ) ;
94
98
}
95
99
}
96
100
}
@@ -185,6 +189,8 @@ private void PerformCommand(PerformCommandMessage message)
185
189
pageViewModel ,
186
190
message . WithAnimation ? _slideRightTransition : _noAnimation ) ;
187
191
192
+ PowerToysTelemetry . Log . WriteEvent ( new OpenPage ( RootFrame . BackStackDepth ) ) ;
193
+
188
194
// Refocus on the Search for continual typing on the next search request
189
195
SearchBox . Focus ( Microsoft . UI . Xaml . FocusState . Programmatic ) ;
190
196
@@ -201,6 +207,7 @@ private void PerformCommand(PerformCommandMessage message)
201
207
else if ( command is IInvokableCommand invokable )
202
208
{
203
209
Logger . LogDebug ( $ "Invoking command") ;
210
+ PowerToysTelemetry . Log . WriteEvent ( new BeginInvoke ( ) ) ;
204
211
HandleInvokeCommand ( message , invokable ) ;
205
212
}
206
213
}
@@ -317,6 +324,7 @@ private void HandleCommandResultOnUiThread(ICommandResult? result)
317
324
{
318
325
var kind = result . Kind ;
319
326
Logger . LogDebug ( $ "handling { kind . ToString ( ) } ") ;
327
+ PowerToysTelemetry . Log . WriteEvent ( new CmdPalInvokeResult ( kind ) ) ;
320
328
switch ( kind )
321
329
{
322
330
case CommandResultKind . Dismiss :
@@ -344,7 +352,6 @@ private void HandleCommandResultOnUiThread(ICommandResult? result)
344
352
{
345
353
// Keep this page open, but hide the palette.
346
354
WeakReferenceMessenger . Default . Send < DismissMessage > ( ) ;
347
-
348
355
break ;
349
356
}
350
357
0 commit comments