From c04e7a1f81063d8f49602a5e1f3d492bf042f512 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Wed, 24 Sep 2025 17:33:24 +0100 Subject: [PATCH] Disable Perf Insights subpanel, collapse sidebar by default --- front_end/panels/timeline/TimelinePanel.ts | 6 +++++- .../panels/timeline/components/Sidebar.ts | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/front_end/panels/timeline/TimelinePanel.ts b/front_end/panels/timeline/TimelinePanel.ts index 2ee9053cda2..07e01215639 100644 --- a/front_end/panels/timeline/TimelinePanel.ts +++ b/front_end/panels/timeline/TimelinePanel.ts @@ -772,7 +772,7 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod #setActiveInsight(insight: TimelineComponents.Sidebar.ActiveInsight|null): void { // When an insight is selected, ensure that the 3P checkbox is disabled // to avoid dimming interference. - if (insight) { + if (insight && !Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)) { this.#splitWidget.showBoth(); } this.#sideBar.setActiveInsight(insight); @@ -2185,6 +2185,10 @@ export class TimelinePanel extends UI.Panel.Panel implements Client, TimelineMod // Used in interaction tests & screenshot tests. return; } + // [RN] Keep sidebar collapsed by default + if (Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI)) { + return; + } const needToRestore = this.#restoreSidebarVisibilityOnTraceLoad; const userHasSeenSidebar = this.#sideBar.userHasOpenedSidebarOnce(); diff --git a/front_end/panels/timeline/components/Sidebar.ts b/front_end/panels/timeline/components/Sidebar.ts index 4f2212aaa0e..c6b776c5dfa 100644 --- a/front_end/panels/timeline/components/Sidebar.ts +++ b/front_end/panels/timeline/components/Sidebar.ts @@ -3,6 +3,7 @@ // found in the LICENSE file. import * as Common from '../../../core/common/common.js'; +import * as Root from '../../../core/root/root.js'; import type * as Trace from '../../../models/trace/trace.js'; import * as UI from '../../../ui/legacy/legacy.js'; @@ -68,16 +69,21 @@ export class SidebarWidget extends UI.Widget.VBox { constructor() { super(); this.setMinimumSize(MIN_SIDEBAR_WIDTH_PX, 0); - this.#tabbedPane.appendTab( - SidebarTabs.INSIGHTS, 'Insights', this.#insightsView, undefined, undefined, false, false, 0, - 'timeline.insights-tab'); + + // [RN] Disable Insights tab + const showInsightsTab = !Root.Runtime.experiments.isEnabled(Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI); + + if (showInsightsTab) { + this.#tabbedPane.appendTab( + SidebarTabs.INSIGHTS, 'Insights', this.#insightsView, undefined, undefined, false, false, 0, + 'timeline.insights-tab'); + } + this.#tabbedPane.appendTab( SidebarTabs.ANNOTATIONS, 'Annotations', this.#annotationsView, undefined, undefined, false, false, 1, 'timeline.annotations-tab'); - // Default the selected tab to Insights. In wasShown() we will change this - // if this is a trace that has no insights. - this.#tabbedPane.selectTab(SidebarTabs.INSIGHTS); + this.#tabbedPane.selectTab(showInsightsTab ? SidebarTabs.INSIGHTS : SidebarTabs.ANNOTATIONS); } override wasShown(): void {