Skip to content

Commit 7724ccb

Browse files
authored
Disable Perf Insights subpanel, collapse sidebar by default (#209)
1 parent 538c309 commit 7724ccb

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

front_end/panels/timeline/TimelinePanel.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
772772
#setActiveInsight(insight: TimelineComponents.Sidebar.ActiveInsight|null): void {
773773
// When an insight is selected, ensure that the 3P checkbox is disabled
774774
// to avoid dimming interference.
775-
if (insight) {
775+
if (insight && !Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)) {
776776
this.#splitWidget.showBoth();
777777
}
778778
this.#sideBar.setActiveInsight(insight);
@@ -2185,6 +2185,10 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod
21852185
// Used in interaction tests & screenshot tests.
21862186
return;
21872187
}
2188+
// [RN] Keep sidebar collapsed by default
2189+
if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)) {
2190+
return;
2191+
}
21882192
const needToRestore = this.#restoreSidebarVisibilityOnTraceLoad;
21892193
const userHasSeenSidebar = this.#sideBar.userHasOpenedSidebarOnce();
21902194

front_end/panels/timeline/components/Sidebar.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
import * as Common from '../../../core/common/common.js';
6+
import * as Root from '../../../core/root/root.js';
67
import type * as Trace from '../../../models/trace/trace.js';
78
import * as UI from '../../../ui/legacy/legacy.js';
89

@@ -68,16 +69,21 @@ export class SidebarWidget extends UI.Widget.VBox {
6869
constructor() {
6970
super();
7071
this.setMinimumSize(MIN_SIDEBAR_WIDTH_PX, 0);
71-
this.#tabbedPane.appendTab(
72-
SidebarTabs.INSIGHTS, 'Insights', this.#insightsView, undefined, undefined, false, false, 0,
73-
'timeline.insights-tab');
72+
73+
// [RN] Disable Insights tab
74+
const showInsightsTab = !Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI);
75+
76+
if (showInsightsTab) {
77+
this.#tabbedPane.appendTab(
78+
SidebarTabs.INSIGHTS, 'Insights', this.#insightsView, undefined, undefined, false, false, 0,
79+
'timeline.insights-tab');
80+
}
81+
7482
this.#tabbedPane.appendTab(
7583
SidebarTabs.ANNOTATIONS, 'Annotations', this.#annotationsView, undefined, undefined, false, false, 1,
7684
'timeline.annotations-tab');
7785

78-
// Default the selected tab to Insights. In wasShown() we will change this
79-
// if this is a trace that has no insights.
80-
this.#tabbedPane.selectTab(SidebarTabs.INSIGHTS);
86+
this.#tabbedPane.selectTab(showInsightsTab ? SidebarTabs.INSIGHTS : SidebarTabs.ANNOTATIONS);
8187
}
8288

8389
override wasShown(): void {

0 commit comments

Comments
 (0)