Skip to content

Commit 1c8b80e

Browse files
AlinaVarkkiDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Change shortcut for creating Time Range annotations and add a keyboard only panning
Change the shortcut for the time range annotion in order to free the 'Shift + left/right arrows' for panning, which likely is a more common action and will work well together with 'Shift + down/up arrows' for scrolling. Bug: 313757601 Change-Id: I1627061ce950ef272ac3d85e0839cc14882ba051 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6069935 Auto-Submit: Alina Varkki <[email protected]> Reviewed-by: Jack Franklin <[email protected]> Commit-Queue: Alina Varkki <[email protected]>
1 parent 0bf762d commit 1c8b80e

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

front_end/panels/timeline/TimelineFlameChartView.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class TimelineFlameChartView extends
125125
#overlaysContainer: HTMLElement = document.createElement('div');
126126
#overlays: Overlays.Overlays.Overlays;
127127

128-
// Tracks the in-progress time range annotation when the user shift clicks + drags, or when the user uses the keyboard
128+
// Tracks the in-progress time range annotation when the user alt/option clicks + drags, or when the user uses the keyboard
129129
#timeRangeSelectionAnnotation: Trace.Types.File.TimeRangeAnnotation|null = null;
130130

131131
// Keep track of the link annotation that hasn't been fully selected yet.
@@ -703,10 +703,10 @@ export class TimelineFlameChartView extends
703703

704704
switch (event.key) {
705705
// ArrowLeft + ArrowRight adjusts the right hand bound (the max) of the time range
706-
// Shift + ArrowRight also starts a range if there isn't one already
706+
// alt/option + ArrowRight also starts a range if there isn't one already
707707
case 'ArrowRight': {
708708
if (!this.#timeRangeSelectionAnnotation) {
709-
if (event.shiftKey) {
709+
if (event.altKey) {
710710
let startTime = visibleWindow.min;
711711
// Prefer the start time of the selected event, if there is one.
712712
if (this.#currentSelection) {

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,8 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
11411141
return [
11421142
{title: i18nString(UIStrings.timelineScrollUpDown), bindings: [['Shift', 'Scroll'], ['Shift', '↑/↓']]},
11431143
{title: i18nString(UIStrings.timelineZoomInOut), bindings: [['Scroll'], ['W/S'], ['+/-']]},
1144-
{title: i18nString(UIStrings.timelineFastZoomInOut), bindings: [['Shift', 'W/S']]},
1145-
{title: i18nString(UIStrings.timelinePanLeftRight), bindings: [['A/D']]},
1144+
{title: i18nString(UIStrings.timelineFastZoomInOut), bindings: [['Shift', 'W/S'], ['Shift', '+/-']]},
1145+
{title: i18nString(UIStrings.timelinePanLeftRight), bindings: [['Shift', '←/→'], ['A/D']]},
11461146
];
11471147
}
11481148

front_end/ui/legacy/components/perf_ui/ChartViewport.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export class ChartViewport extends UI.Widget.VBox {
379379
return;
380380
}
381381
const zoomFactor = keyboardEvent.shiftKey ? 0.8 : 0.3;
382-
const panOffset = keyboardEvent.shiftKey ? 320 : 160;
382+
const panOffset = 160;
383383
const scrollOffset = 50;
384384
switch (keyboardEvent.code) {
385385
case 'KeyA':
@@ -406,6 +406,16 @@ export class ChartViewport extends UI.Widget.VBox {
406406
this.vScrollElement.scrollTop += scrollOffset;
407407
}
408408
break;
409+
case 'ArrowLeft':
410+
if (keyboardEvent.shiftKey) {
411+
this.handlePanGesture(-panOffset, /* animate */ true);
412+
}
413+
break;
414+
case 'ArrowRight':
415+
if (keyboardEvent.shiftKey) {
416+
this.handlePanGesture(panOffset, /* animate */ true);
417+
}
418+
break;
409419
default:
410420
return;
411421
}

0 commit comments

Comments
 (0)