@@ -317,21 +317,13 @@ const UIStrings = {
317
317
*/
318
318
backToLiveMetrics : 'Go back to the live metrics page' ,
319
319
/**
320
- * @description Description of the Timeline up/down scroll action that appears in the Performance panel shortcuts dialog.
320
+ * @description Description of the Timeline zoom keyboard instructions that appear in the shortcuts dialog
321
321
*/
322
- timelineScrollUpDown : 'Move up/down ' ,
322
+ timelineZoom : 'Zoom ' ,
323
323
/**
324
- * @description Description of the Timeline left/right panning action that appears in the Performance panel shortcuts dialog.
324
+ * @description Description of the Timeline scrolling & panning instructions that appear in the shortcuts dialog.
325
325
*/
326
- timelinePanLeftRight : 'Move left/right' ,
327
- /**
328
- * @description Description of the Timeline in/out zoom action that appears in the Performance panel shortcuts dialog.
329
- */
330
- timelineZoomInOut : 'Zoom in/out' ,
331
- /**
332
- * @description Description of the Timeline fast in/out zoom action that appears in the Performance panel shortcuts dialog.
333
- */
334
- timelineFastZoomInOut : 'Fast zoom in/out' ,
326
+ timelineScrollPan : 'Scroll & Pan' ,
335
327
/**
336
328
* @description Title for the Dim 3rd Parties checkbox.
337
329
*/
@@ -340,6 +332,10 @@ const UIStrings = {
340
332
* @description Description for the Dim 3rd Parties checkbox tooltip describing how 3rd parties are classified.
341
333
*/
342
334
thirdPartiesByThirdPartyWeb : '3rd parties classified by third-party-web' ,
335
+ /**
336
+ * @description Title of the shortcuts dialog shown to the user that lists keyboard shortcuts.
337
+ */
338
+ shortcutsDialogTitle : 'Keyboard shortcuts for flamechart'
343
339
} as const ;
344
340
const str_ = i18n . i18n . registerUIStrings ( 'panels/timeline/TimelinePanel.ts' , UIStrings ) ;
345
341
const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
@@ -481,10 +477,10 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
481
477
* Navigation radio buttons located in the shortcuts dialog.
482
478
*/
483
479
#navigationRadioButtons = document . createElement ( 'form' ) ;
484
- #modernNavRadioButton =
485
- UI . UIUtils . createRadioButton ( 'flamechart-selected-navigation' , 'Modern' , 'timeline.select-modern-navigation' ) ;
486
- #classicNavRadioButton =
487
- UI . UIUtils . createRadioButton ( 'flamechart-selected-navigation' , 'Classic' , 'timeline.select-classic-navigation' ) ;
480
+ #modernNavRadioButton = UI . UIUtils . createRadioButton (
481
+ 'flamechart-selected-navigation' , 'Modern - normal scrolling ' , 'timeline.select-modern-navigation' ) ;
482
+ #classicNavRadioButton = UI . UIUtils . createRadioButton (
483
+ 'flamechart-selected-navigation' , 'Classic - scroll to zoom ' , 'timeline.select-classic-navigation' ) ;
488
484
489
485
#onMainEntryHovered: ( event : Common . EventTarget . EventTargetEvent < number > ) => void ;
490
486
@@ -1180,6 +1176,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
1180
1176
// need to update the radio buttons selection when the dialog is open.
1181
1177
this . #shortcutsDialog. addEventListener ( 'click' , this . #updateNavigationSettingSelection. bind ( this ) ) ;
1182
1178
this . #shortcutsDialog. data = {
1179
+ customTitle : i18nString ( UIStrings . shortcutsDialogTitle ) ,
1183
1180
shortcuts : this . #getShortcutsInfo( currentNavSetting === 'classic' ) ,
1184
1181
open : ! userHadShortcutsDialogOpenedOnce && hideTheDialogForTests !== 'true' &&
1185
1182
! Host . InspectorFrontendHost . isUnderTest ( ) ,
@@ -1218,29 +1215,54 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
1218
1215
}
1219
1216
1220
1217
#getShortcutsInfo( isNavClassic : boolean ) : Dialogs . ShortcutDialog . Shortcut [ ] {
1218
+ const metaKey = Host . Platform . isMac ( ) ? '⌘' : 'Ctrl' ;
1221
1219
if ( isNavClassic ) {
1220
+ // Classic navigation = scroll to zoom.
1222
1221
return [
1223
- { title : i18nString ( UIStrings . timelineScrollUpDown ) , bindings : [ [ 'Shift' , 'Scroll up/down' ] , [ 'Shift' , '↑/↓' ] ] } ,
1224
1222
{
1225
- title : i18nString ( UIStrings . timelinePanLeftRight ) ,
1226
- bindings : [ [ 'Shift' , '←/→' ] , [ 'Scroll left/right' ] , [ 'A/D' ] ]
1223
+ title : i18nString ( UIStrings . timelineZoom ) ,
1224
+ rows : [
1225
+ [ { key : 'Scroll ↕' } ] , [ { key : 'W' } , { key : 'S' } , { joinText : 'or' } , { key : '+' } , { key : '-' } ] ,
1226
+ { footnote : 'hold shift for fast zoom' }
1227
+ ]
1227
1228
} ,
1228
- { title : i18nString ( UIStrings . timelineZoomInOut ) , bindings : [ [ 'Scroll up/down' ] , [ 'W/S' ] , [ '+/-' ] ] } ,
1229
- { title : i18nString ( UIStrings . timelineFastZoomInOut ) , bindings : [ [ 'Shift' , 'W/S' ] , [ 'Shift' , '+/-' ] ] } ,
1229
+ {
1230
+ title : i18nString ( UIStrings . timelineScrollPan ) ,
1231
+ rows : [
1232
+ [ { key : 'Shift' } , { joinText : '+' } , { key : 'Scroll ↕' } ] ,
1233
+ [ { key : 'Scroll ↔' } , { joinText : 'or' } , { key : 'A' } , { key : 'D' } ] ,
1234
+ [
1235
+ { key : 'Drag' } , { joinText : 'or' } , { key : 'Shift' } , { joinText : '+' } , { key : '↑' } , { key : '↓' } , { key : '←' } ,
1236
+ { key : '→' }
1237
+ ] ,
1238
+ ]
1239
+ }
1230
1240
] ;
1231
1241
}
1232
1242
1243
+ // New navigation where scroll = scroll.
1233
1244
return [
1234
- { title : i18nString ( UIStrings . timelineScrollUpDown ) , bindings : [ [ 'Scroll up/down' ] , [ 'Shift' , '↑/↓' ] ] } ,
1235
1245
{
1236
- title : i18nString ( UIStrings . timelinePanLeftRight ) ,
1237
- bindings : [ [ 'Shift' , 'Scroll up/down' ] , [ 'Scroll left/right' ] , [ 'Shift' , '←/→' ] , [ 'A/D' ] ] ,
1246
+ title : i18nString ( UIStrings . timelineZoom ) ,
1247
+ rows : [
1248
+ [ { key : metaKey } , { joinText : '+' } , { key : 'Scroll ↕' } ] ,
1249
+ [ { key : 'W' } , { key : 'S' } , { joinText : 'or' } , { key : '+' } , { key : '-' } ] , { footnote : '' }
1250
+ ]
1238
1251
} ,
1239
1252
{
1240
- title : i18nString ( UIStrings . timelineZoomInOut ) ,
1241
- bindings : [ [ Host . Platform . isMac ( ) ? '⌘' : 'Ctrl' , 'Scroll up/down' ] , [ 'W/S' ] , [ '+/-' ] ] ,
1242
- } ,
1243
- { title : i18nString ( UIStrings . timelineFastZoomInOut ) , bindings : [ [ 'Shift' , 'W/S' ] , [ 'Shift' , '+/-' ] ] } ,
1253
+ title : i18nString ( UIStrings . timelineScrollPan ) ,
1254
+ rows : [
1255
+ [ { key : 'Scroll ↕' } ] ,
1256
+ [
1257
+ { key : 'Shift' } , { joinText : '+' } , { key : 'Scroll ↕' } , { joinText : 'or' } , { key : 'Scroll ↔' } , { joinText : 'or' } ,
1258
+ { key : 'A' } , { key : 'D' }
1259
+ ] ,
1260
+ [
1261
+ { key : 'Drag' } , { joinText : 'or' } , { key : 'Shift' } , { joinText : '+' } , { key : '↑' } , { key : '↓' } , { key : '←' } ,
1262
+ { key : '→' }
1263
+ ] ,
1264
+ ]
1265
+ }
1244
1266
] ;
1245
1267
}
1246
1268
0 commit comments