File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed
packages/react-devtools-shared/src/devtools/views/SuspenseTab Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change 77 * @flow
88 */
99
10+ import type { SuspenseTimelineStep } from 'react-devtools-shared/src/frontend/types' ;
11+
1012import typeof { SyntheticEvent } from 'react-dom-bindings/src/events/SyntheticEvent' ;
1113
1214import * as React from 'react' ;
@@ -19,6 +21,7 @@ import Tooltip from '../Components/reach-ui/tooltip';
1921export default function SuspenseScrubber ( {
2022 min,
2123 max,
24+ timeline,
2225 value,
2326 highlight,
2427 onBlur,
@@ -29,6 +32,7 @@ export default function SuspenseScrubber({
2932} : {
3033 min : number ,
3134 max : number ,
35+ timeline : $ReadOnlyArray < SuspenseTimelineStep > ,
3236 value : number ,
3337 highlight : number ,
3438 onBlur ?: ( ) => void ,
@@ -54,17 +58,18 @@ export default function SuspenseScrubber({
5458 }
5559 const steps = [ ] ;
5660 for ( let index = min ; index <= max ; index ++ ) {
61+ const environment = timeline [ index ] . environment ;
62+ const label =
63+ index === min
64+ ? // The first step in the timeline is always a Transition (Initial Paint).
65+ 'Initial Paint' +
66+ ( environment === null ? '' : ' (' + environment + ')' )
67+ : // TODO: Consider adding the name of this specific boundary if this step has only one.
68+ environment === null
69+ ? 'Suspense'
70+ : environment ;
5771 steps . push (
58- < Tooltip
59- key = { index }
60- label = {
61- index === min
62- ? // The first step in the timeline is always a Transition (Initial Paint).
63- // TODO: Support multiple environments.
64- 'Initial Paint'
65- : // TODO: Consider adding the name of this specific boundary if this step has only one.
66- 'Suspense'
67- } >
72+ < Tooltip key = { index } label = { label } >
6873 < div
6974 className = {
7075 styles . SuspenseScrubberStep +
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ function SuspenseTimelineInput() {
173173 < SuspenseScrubber
174174 min = { min }
175175 max = { max }
176+ timeline = { timeline }
176177 value = { timelineIndex }
177178 highlight = { hoveredTimelineIndex }
178179 onChange = { handleChange }
You can’t perform that action at this time.
0 commit comments