Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion front_end/panels/timeline/TimelinePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();

Expand Down
18 changes: 12 additions & 6 deletions front_end/panels/timeline/components/Sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 {
Expand Down
Loading