Skip to content

Commit 631e5a6

Browse files
AlinaVarkkiDevtools-frontend LUCI CQ
authored andcommitted
[RPP] Open the shortcuts dialog once after it ships
Bug: 313757601 Change-Id: I8fb12f7c5071629b0761df4e6e9dca0ace049b64 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6088883 Reviewed-by: Jack Franklin <[email protected]> Commit-Queue: Alina Varkki <[email protected]> Auto-Submit: Alina Varkki <[email protected]>
1 parent 71aa387 commit 631e5a6

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,13 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
459459

460460
#eventToRelatedInsights: TimelineComponents.RelatedInsightChips.EventToRelatedInsightsMap = new Map();
461461
#shortcutsDialog: Dialogs.ShortcutDialog.ShortcutDialog = new Dialogs.ShortcutDialog.ShortcutDialog();
462+
/**
463+
* Track if the user has opened the shortcuts dialog before. We do this so that the
464+
* very first time the performance panel is open after the shortcuts dialog ships, we can
465+
* automatically pop it open to aid discovery.
466+
*/
467+
#userHadShortcutsDialogOpenedOnce = Common.Settings.Settings.instance().createSetting<boolean>(
468+
'timeline.user-had-shortcuts-dialog-opened-once', false);
462469
/**
463470
* Navigation radio buttons located in the shortcuts dialog.
464471
*/
@@ -1127,7 +1134,11 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
11271134

11281135
#setupNavigationSetting(): HTMLElement {
11291136
const currentNavSetting = Common.Settings.moduleSetting('flamechart-selected-navigation').get();
1130-
this.#shortcutsDialog.data = {shortcuts: this.#getShortcutsInfo(currentNavSetting === 'classic')};
1137+
const userHadShortcutsDialogOpenedOnce = this.#userHadShortcutsDialogOpenedOnce.get();
1138+
this.#shortcutsDialog.data = {
1139+
shortcuts: this.#getShortcutsInfo(currentNavSetting === 'classic'),
1140+
open: !userHadShortcutsDialogOpenedOnce,
1141+
};
11311142

11321143
this.#navigationRadioButtons.classList.add('nav-radio-buttons');
11331144
UI.ARIAUtils.markAsRadioGroup(this.#navigationRadioButtons);
@@ -1148,6 +1159,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
11481159
this.#classicNavRadioButton.setAttribute(
11491160
'jslog', `${VisualLogging.action().track({click: true}).context('flamechart-select-classic-navigation')}`);
11501161

1162+
this.#userHadShortcutsDialogOpenedOnce.set(true);
11511163
return this.#navigationRadioButtons;
11521164
}
11531165

front_end/ui/visual_logging/KnownContextValues.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3409,7 +3409,6 @@ export const knownContextValues = new Set([
34093409
'timeline-tree-current-thread',
34103410
'timeline-tree-group-by',
34113411
'timeline-user-has-opened-sidebar-once',
3412-
'timeline-user-has-opened-siderbar-once',
34133412
'timeline-v8-runtime-call-stats',
34143413
'timeline.animations',
34153414
'timeline.annotation-sidebar.annotation-entries-link',
@@ -3524,6 +3523,7 @@ export const knownContextValues = new Set([
35243523
'timeline.toggle-insight.third-parties',
35253524
'timeline.toggle-insight.viewport',
35263525
'timeline.toggle-recording',
3526+
'timeline.user-had-shortcuts-dialog-opened-once',
35273527
'timelineOverviewMode',
35283528
'timeout',
35293529
'timer',

0 commit comments

Comments
 (0)