Skip to content

Commit a450a23

Browse files
author
Brian Vaughn
committed
Improved Profiler suspense boundary UI
1 parent 61a251f commit a450a23

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

src/devtools/views/Profiler/Profiler.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
padding: 0.5rem;
8080
}
8181

82-
.Fallback {
82+
.ContentFallback {
8383
width: 100%;
8484
height: 100%;
8585
display: flex;
@@ -89,6 +89,16 @@
8989
color: var(--color-dim);
9090
}
9191

92+
.SnapshotSelectorFallback {
93+
height: 100%;
94+
padding-left: 0.5rem;
95+
display: flex;
96+
align-items: center;
97+
justify-content: center;
98+
font-size: var(--font-size-sans-large);
99+
color: var(--color-dim);
100+
}
101+
92102
.Link {
93103
color: var(--color-button);
94104
}

src/devtools/views/Profiler/Profiler.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ function NonSuspendingProfiler({
102102
);
103103
}
104104

105-
// TODO (profiling) Real fallback UI
106-
function ProfilerFallback() {
107-
return <div className={styles.Fallback}>Loading...</div>;
105+
function ContentFallback() {
106+
return <div className={styles.ContentFallback}>Loading...</div>;
107+
}
108+
109+
function SnapshotSelectorFallback() {
110+
return <div className={styles.SnapshotSelectorFallback}>Loading...</div>;
108111
}
109112

110113
// This view is rendered when there is profiler data (even though there may not be any for the currently selected root).
@@ -162,19 +165,20 @@ function SuspendingProfiler() {
162165
/>
163166
<div className={styles.Spacer} />
164167
<ToggleCommitFilterModalButton />
165-
<Suspense fallback={<ProfilerFallback />}>
168+
<div className={styles.VRule} />
169+
<Suspense fallback={<SnapshotSelectorFallback />}>
166170
<SnapshotSelector />
167171
</Suspense>
168172
</div>
169173
<div className={styles.Content}>
170-
<Suspense fallback={<ProfilerFallback />}>{view}</Suspense>
174+
<Suspense fallback={<ContentFallback />}>{view}</Suspense>
171175
{isFilterModalShowing && (
172176
<FilterModal dismissModal={dismissFilterModal} />
173177
)}
174178
</div>
175179
</div>
176180
<div className={styles.RightColumn}>
177-
<Suspense fallback={<ProfilerFallback />}>{sidebar}</Suspense>
181+
<Suspense fallback={<ContentFallback />}>{sidebar}</Suspense>
178182
</div>
179183
</div>
180184
);

src/devtools/views/Profiler/SnapshotSelector.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
outline: none;
1414
}
1515

16-
.VRule {
17-
height: 20px;
18-
width: 1px;
19-
background-color: var(--color-border);
20-
margin: 0 0.25rem;
21-
}
22-
2316
.IndexLabel {
2417
flex: 0 0 auto;
2518
white-space: nowrap;

src/devtools/views/Profiler/SnapshotSelector.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ export default function SnapshotSelector(_: Props) {
118118

119119
return (
120120
<Fragment>
121-
<div className={styles.VRule} />
122121
<span className={styles.IndexLabel}>{label}</span>
123122
<Button
124123
className={styles.Button}

0 commit comments

Comments
 (0)