@@ -173,10 +173,31 @@ export class PowerPagesNavigationProvider implements vscode.TreeDataProvider<Pow
173
173
}
174
174
175
175
openInDesktop ( ) : void {
176
+ WebExtensionContext . telemetry . sendInfoTelemetry (
177
+ webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_CLICKED ,
178
+ {
179
+ hasECSFeatureGate : 'true'
180
+ }
181
+ ) ;
182
+
176
183
try {
177
184
const websiteId = WebExtensionContext . urlParametersMap ?. get ( PowerPagesNavigationConstants . urlParams . WEBSITE_ID ) ;
178
185
const envId = WebExtensionContext . urlParametersMap ?. get ( PowerPagesNavigationConstants . urlParams . ENV_ID ) ;
179
186
187
+ // Check if open in desktop is enabled via ECS flag
188
+ const isOpenInDesktopEnabled = ECSFeaturesClient . getConfig ( EnableOpenInDesktop ) . enableOpenInDesktop ;
189
+
190
+ // Track ECS feature flag status
191
+ if ( ! isOpenInDesktopEnabled ) {
192
+ WebExtensionContext . telemetry . sendInfoTelemetry (
193
+ webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_FEATURE_DISABLED ,
194
+ {
195
+ reason : 'ecs_feature_flag_disabled'
196
+ }
197
+ ) ;
198
+ return ;
199
+ }
200
+
180
201
// Validate required parameters
181
202
if ( ! websiteId ) {
182
203
vscode . window . showErrorMessage ( vscode . l10n . t ( PowerPagesNavigationConstants . messages . WEBSITE_ID_NOT_AVAILABLE ) ) ;
@@ -213,18 +234,54 @@ export class PowerPagesNavigationProvider implements vscode.TreeDataProvider<Pow
213
234
return ;
214
235
}
215
236
237
+ // Track desktop flow trigger (before attempting to open)
238
+ WebExtensionContext . telemetry . sendInfoTelemetry (
239
+ webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_TRIGGERED ,
240
+ {
241
+ websiteId : websiteId ,
242
+ environmentId : environmentId ,
243
+ desktopUri : desktopUri
244
+ }
245
+ ) ;
246
+
216
247
// Open in VS Code Desktop
217
248
vscode . env . openExternal ( vscode . Uri . parse ( desktopUri ) ) ;
218
249
250
+ // Track successful URI opening
251
+ WebExtensionContext . telemetry . sendInfoTelemetry (
252
+ webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_URI_OPENED ,
253
+ {
254
+ websiteId : websiteId ,
255
+ environmentId : environmentId ,
256
+ uriGenerated : PowerPagesNavigationConstants . values . TRUE ,
257
+ }
258
+ ) ;
259
+
219
260
// Show informational message with fallback options (don't await to avoid blocking)
220
261
vscode . window . showInformationMessage (
221
262
vscode . l10n . t ( PowerPagesNavigationConstants . messages . OPENING_IN_VS_CODE_DESKTOP ) ,
222
263
vscode . l10n . t ( PowerPagesNavigationConstants . messages . DOWNLOAD_VS_CODE ) ,
223
264
vscode . l10n . t ( PowerPagesNavigationConstants . messages . UPDATE_EXTENSION ) ,
224
- ) . then ( ( showInstructions ) => {
225
- if ( showInstructions === vscode . l10n . t ( PowerPagesNavigationConstants . messages . DOWNLOAD_VS_CODE ) ) {
265
+ ) . then ( ( selectedOption ) => {
266
+ if ( selectedOption === vscode . l10n . t ( PowerPagesNavigationConstants . messages . DOWNLOAD_VS_CODE ) ) {
267
+ WebExtensionContext . telemetry . sendInfoTelemetry (
268
+ webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_DIALOG_DOWNLOAD_CLICKED ,
269
+ {
270
+ websiteId : websiteId ,
271
+ environmentId : environmentId ,
272
+ action : 'download_vscode_clicked'
273
+ }
274
+ ) ;
226
275
vscode . env . openExternal ( vscode . Uri . parse ( PowerPagesNavigationConstants . urls . VS_CODE_DOWNLOAD ) ) ;
227
- } else if ( showInstructions === vscode . l10n . t ( PowerPagesNavigationConstants . messages . UPDATE_EXTENSION ) ) {
276
+ } else if ( selectedOption === vscode . l10n . t ( PowerPagesNavigationConstants . messages . UPDATE_EXTENSION ) ) {
277
+ WebExtensionContext . telemetry . sendInfoTelemetry (
278
+ webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_DIALOG_UPDATE_CLICKED ,
279
+ {
280
+ websiteId : websiteId ,
281
+ environmentId : environmentId ,
282
+ action : 'update_extension_clicked'
283
+ }
284
+ ) ;
228
285
vscode . env . openExternal ( vscode . Uri . parse ( PowerPagesNavigationConstants . urls . VS_CODE_MARKETPLACE ) ) ;
229
286
}
230
287
} ) ;
@@ -290,19 +347,6 @@ export class PowerPagesNavigationProvider implements vscode.TreeDataProvider<Pow
290
347
291
348
const finalUri = `${ baseUri } ?${ params . toString ( ) } ` ;
292
349
293
- // Log telemetry for successful URI generation
294
- WebExtensionContext . telemetry . sendInfoTelemetry (
295
- webExtensionTelemetryEventNames . WEB_EXTENSION_OPEN_DESKTOP_TRIGGERED ,
296
- {
297
- websiteId : websiteId ,
298
- environmentId : environmentId ,
299
- desktopUri : finalUri ,
300
- hasSiteName : siteName ? PowerPagesNavigationConstants . values . TRUE : PowerPagesNavigationConstants . values . FALSE ,
301
- hasSiteUrl : params . has ( PowerPagesNavigationConstants . urlParams . SITE_URL ) ? PowerPagesNavigationConstants . values . TRUE : PowerPagesNavigationConstants . values . FALSE ,
302
- schema : schema
303
- }
304
- ) ;
305
-
306
350
return finalUri ;
307
351
308
352
} catch ( error ) {
0 commit comments