Skip to content

Commit

Permalink
Improved Profiler suspense boundary UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Mar 29, 2019
1 parent 61a251f commit a450a23
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
12 changes: 11 additions & 1 deletion src/devtools/views/Profiler/Profiler.css
Expand Up @@ -79,7 +79,7 @@
padding: 0.5rem;
}

.Fallback {
.ContentFallback {
width: 100%;
height: 100%;
display: flex;
Expand All @@ -89,6 +89,16 @@
color: var(--color-dim);
}

.SnapshotSelectorFallback {
height: 100%;
padding-left: 0.5rem;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--font-size-sans-large);
color: var(--color-dim);
}

.Link {
color: var(--color-button);
}
16 changes: 10 additions & 6 deletions src/devtools/views/Profiler/Profiler.js
Expand Up @@ -102,9 +102,12 @@ function NonSuspendingProfiler({
);
}

// TODO (profiling) Real fallback UI
function ProfilerFallback() {
return <div className={styles.Fallback}>Loading...</div>;
function ContentFallback() {
return <div className={styles.ContentFallback}>Loading...</div>;
}

function SnapshotSelectorFallback() {
return <div className={styles.SnapshotSelectorFallback}>Loading...</div>;
}

// This view is rendered when there is profiler data (even though there may not be any for the currently selected root).
Expand Down Expand Up @@ -162,19 +165,20 @@ function SuspendingProfiler() {
/>
<div className={styles.Spacer} />
<ToggleCommitFilterModalButton />
<Suspense fallback={<ProfilerFallback />}>
<div className={styles.VRule} />
<Suspense fallback={<SnapshotSelectorFallback />}>
<SnapshotSelector />
</Suspense>
</div>
<div className={styles.Content}>
<Suspense fallback={<ProfilerFallback />}>{view}</Suspense>
<Suspense fallback={<ContentFallback />}>{view}</Suspense>
{isFilterModalShowing && (
<FilterModal dismissModal={dismissFilterModal} />
)}
</div>
</div>
<div className={styles.RightColumn}>
<Suspense fallback={<ProfilerFallback />}>{sidebar}</Suspense>
<Suspense fallback={<ContentFallback />}>{sidebar}</Suspense>
</div>
</div>
);
Expand Down
7 changes: 0 additions & 7 deletions src/devtools/views/Profiler/SnapshotSelector.css
Expand Up @@ -13,13 +13,6 @@
outline: none;
}

.VRule {
height: 20px;
width: 1px;
background-color: var(--color-border);
margin: 0 0.25rem;
}

.IndexLabel {
flex: 0 0 auto;
white-space: nowrap;
Expand Down
1 change: 0 additions & 1 deletion src/devtools/views/Profiler/SnapshotSelector.js
Expand Up @@ -118,7 +118,6 @@ export default function SnapshotSelector(_: Props) {

return (
<Fragment>
<div className={styles.VRule} />
<span className={styles.IndexLabel}>{label}</span>
<Button
className={styles.Button}
Expand Down

0 comments on commit a450a23

Please sign in to comment.