diff --git a/src/devtools/views/Profiler/CommitFilterModal.js b/src/devtools/views/Profiler/CommitFilterModal.js
index c47c254e0a..8b359479af 100644
--- a/src/devtools/views/Profiler/CommitFilterModal.js
+++ b/src/devtools/views/Profiler/CommitFilterModal.js
@@ -8,6 +8,16 @@ import { useModalDismissSignal } from '../hooks';
import styles from './CommitFilterModal.css';
export default function FilterModal(_: {||}) {
+ const { isModalShowing } = useContext(CommitFilterModalContext);
+
+ if (!isModalShowing) {
+ return null;
+ }
+
+ return ;
+}
+
+function FilterModalImpl(_: {||}) {
const {
isCommitFilterEnabled,
minCommitDuration,
diff --git a/src/devtools/views/Profiler/NoCommitData.js b/src/devtools/views/Profiler/NoCommitData.js
index 3e0dab4a2d..f16cd9aa96 100644
--- a/src/devtools/views/Profiler/NoCommitData.js
+++ b/src/devtools/views/Profiler/NoCommitData.js
@@ -1,37 +1,19 @@
// @flow
-import React, { useContext } from 'react';
-import { ProfilerContext } from './ProfilerContext';
+import React from 'react';
import ToggleCommitFilterModalButton from './ToggleCommitFilterModalButton';
import styles from './NoCommitData.css';
export default function NoCommitData(_: {||}) {
- const { rootHasProfilingData } = useContext(ProfilerContext);
-
- if (rootHasProfilingData) {
- return (
-
-
- There is no data matching the current filter criteria.
-
-
- Try adjusting the commit filter
-
+ return (
+
+
+ There is no data matching the current filter criteria.
- );
- } else {
- return (
-
-
- There is no timing data to display for the currently selected commit.
-
-
- This can indicate that a render occurred too quickly for the timing
- API to measure. Try selecting another commit in the upper, right-hand
- corner.
-
+
+ Try adjusting the commit filter
- );
- }
+
+ );
}
diff --git a/src/devtools/views/Profiler/Profiler.js b/src/devtools/views/Profiler/Profiler.js
index 656076c6e6..cd39b39f2f 100644
--- a/src/devtools/views/Profiler/Profiler.js
+++ b/src/devtools/views/Profiler/Profiler.js
@@ -1,10 +1,7 @@
// @flow
-import React, { Suspense, useContext } from 'react';
-import {
- CommitFilterModalContext,
- CommitFilterModalContextController,
-} from './CommitFilterModalContext';
+import React, { useContext } from 'react';
+import { CommitFilterModalContextController } from './CommitFilterModalContext';
import { ModalDialog } from '../ModalDialog';
import { ProfilerContext } from './ProfilerContext';
import TabBar from '../TabBar';
@@ -13,6 +10,7 @@ import CommitFlamegraph from './CommitFlamegraph';
import CommitRanked from './CommitRanked';
import CommitFilterModal from './CommitFilterModal';
import Interactions from './Interactions';
+import RootSelector from './RootSelector';
import RecordToggle from './RecordToggle';
import ReloadAndProfileButton from './ReloadAndProfileButton';
import ProfilingImportExportButtons from './ProfilingImportExportButtons';
@@ -30,111 +28,38 @@ export type Props = {|
|};
function Profiler({ supportsProfiling }: Props) {
- const { hasProfilingData, isProfiling, rootHasProfilingData } = useContext(
- ProfilerContext
- );
+ const {
+ hasProfilingData,
+ isProcessingData,
+ isProfiling,
+ selectedFiberID,
+ selectedTabID,
+ selectTab,
+ } = useContext(ProfilerContext);
- if (isProfiling || !rootHasProfilingData) {
- return (
-
- );
- } else {
- return (
-
-
-
- );
- }
-}
-
-// This view is rendered when there is no profiler data (either we haven't profiled yet or we're currently profiling).
-// Nothing in this view's subtree suspends.
-// By not suspending while profiling is in progress, we avoid potential cache invalidation trickiness.
-// NOTE that the structure of this UI should mirror SuspendingProfiler.
-function NonSuspendingProfiler({
- hasProfilingData,
- isProfiling,
- supportsProfiling,
-}: {|
- hasProfilingData: boolean,
- isProfiling: boolean,
- supportsProfiling: boolean,
-|}) {
let view = null;
if (!supportsProfiling) {
view = ;
} else if (isProfiling) {
- view = ;
+ view = ;
+ } else if (isProcessingData) {
+ view = ;
} else if (!hasProfilingData) {
view = ;
} else {
- view = ;
- }
-
- return (
-