@@ -317,21 +317,13 @@ const UIStrings = {
317317 */
318318 backToLiveMetrics : 'Go back to the live metrics page' ,
319319 /**
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
321321 */
322- timelineScrollUpDown : 'Move up/down ' ,
322+ timelineZoom : 'Zoom ' ,
323323 /**
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.
325325 */
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' ,
335327 /**
336328 * @description Title for the Dim 3rd Parties checkbox.
337329 */
@@ -340,6 +332,10 @@ const UIStrings = {
340332 * @description Description for the Dim 3rd Parties checkbox tooltip describing how 3rd parties are classified.
341333 */
342334 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'
343339} as const ;
344340const str_ = i18n . i18n . registerUIStrings ( 'panels/timeline/TimelinePanel.ts' , UIStrings ) ;
345341const i18nString = i18n . i18n . getLocalizedString . bind ( undefined , str_ ) ;
@@ -481,10 +477,10 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
481477 * Navigation radio buttons located in the shortcuts dialog.
482478 */
483479 #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' ) ;
488484
489485 #onMainEntryHovered: ( event : Common . EventTarget . EventTargetEvent < number > ) => void ;
490486
@@ -1180,6 +1176,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
11801176 // need to update the radio buttons selection when the dialog is open.
11811177 this . #shortcutsDialog. addEventListener ( 'click' , this . #updateNavigationSettingSelection. bind ( this ) ) ;
11821178 this . #shortcutsDialog. data = {
1179+ customTitle : i18nString ( UIStrings . shortcutsDialogTitle ) ,
11831180 shortcuts : this . #getShortcutsInfo( currentNavSetting === 'classic' ) ,
11841181 open : ! userHadShortcutsDialogOpenedOnce && hideTheDialogForTests !== 'true' &&
11851182 ! Host . InspectorFrontendHost . isUnderTest ( ) ,
@@ -1218,29 +1215,54 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
12181215 }
12191216
12201217 #getShortcutsInfo( isNavClassic : boolean ) : Dialogs . ShortcutDialog . Shortcut [ ] {
1218+ const metaKey = Host . Platform . isMac ( ) ? '⌘' : 'Ctrl' ;
12211219 if ( isNavClassic ) {
1220+ // Classic navigation = scroll to zoom.
12221221 return [
1223- { title : i18nString ( UIStrings . timelineScrollUpDown ) , bindings : [ [ 'Shift' , 'Scroll up/down' ] , [ 'Shift' , '↑/↓' ] ] } ,
12241222 {
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+ ]
12271228 } ,
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+ }
12301240 ] ;
12311241 }
12321242
1243+ // New navigation where scroll = scroll.
12331244 return [
1234- { title : i18nString ( UIStrings . timelineScrollUpDown ) , bindings : [ [ 'Scroll up/down' ] , [ 'Shift' , '↑/↓' ] ] } ,
12351245 {
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+ ]
12381251 } ,
12391252 {
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+ }
12441266 ] ;
12451267 }
12461268
0 commit comments