diff --git a/packages/react-devtools-shared/src/devtools/constants.js b/packages/react-devtools-shared/src/devtools/constants.js index 5c90501d70f5c..d093a798bcd30 100644 --- a/packages/react-devtools-shared/src/devtools/constants.js +++ b/packages/react-devtools-shared/src/devtools/constants.js @@ -154,8 +154,8 @@ export const THEME_STYLES: {[style: Theme | DisplayDensity]: any, ...} = { '--color-warning-text-color': '#ffffff', '--color-warning-text-color-inverted': '#fd4d69', - '--color-suspense': '#0088fa', - '--color-transition': '#6a51b2', + '--color-suspense-default': '#0088fa', + '--color-transition-default': '#6a51b2', '--color-suspense-server': '#62bc6a', '--color-transition-server': '#3f7844', '--color-suspense-other': '#f3ce49', @@ -315,8 +315,8 @@ export const THEME_STYLES: {[style: Theme | DisplayDensity]: any, ...} = { '--color-warning-text-color': '#ffffff', '--color-warning-text-color-inverted': '#ee1638', - '--color-suspense': '#61dafb', - '--color-transition': '#6a51b2', + '--color-suspense-default': '#61dafb', + '--color-transition-default': '#6a51b2', '--color-suspense-server': '#62bc6a', '--color-transition-server': '#3f7844', '--color-suspense-other': '#f3ce49', diff --git a/packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js b/packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js index 9078d3c3beabc..78c137deaf37c 100644 --- a/packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js +++ b/packages/react-devtools-shared/src/devtools/views/Components/InspectedElementSuspendedBy.js @@ -22,6 +22,8 @@ import OwnerView from './OwnerView'; import {meta} from '../../../hydration'; import useInferredName from '../useInferredName'; +import {getClassNameForEnvironment} from '../SuspenseTab/SuspenseEnvironmentColors.js'; + import type { InspectedElement, SerializedAsyncInfo, @@ -181,7 +183,12 @@ function SuspendedByRow({ )}
-
+
{pluralizedName}
{isOpen ? null : ( -
+
-1 && timeline[hoveredTimelineIndex].id === suspenseID; + let environment: null | string = null; + for (let i = 0; i < timeline.length; i++) { + const timelineStep = timeline[i]; + if (timelineStep.id === suspenseID) { + environment = timelineStep.environment; + break; + } + } + const boundingBox = getBoundingBox(suspense.rects); return ( , value: number, highlight: number, onBlur?: () => void, @@ -54,17 +60,18 @@ export default function SuspenseScrubber({ } const steps = []; for (let index = min; index <= max; index++) { + const environment = timeline[index].environment; + const label = + index === min + ? // The first step in the timeline is always a Transition (Initial Paint). + 'Initial Paint' + + (environment === null ? '' : ' (' + environment + ')') + : // TODO: Consider adding the name of this specific boundary if this step has only one. + environment === null + ? 'Suspense' + : environment; steps.push( - +
diff --git a/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTimeline.js b/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTimeline.js index f230cfb549a3f..89f349ae6ea7d 100644 --- a/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTimeline.js +++ b/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTimeline.js @@ -173,6 +173,7 @@ function SuspenseTimelineInput() {