Skip to content

Commit 3e8c8fd

Browse files
committed
Give the root an outline with the same color as the timeline
Give it a background while selected.
1 parent 8e9ef0b commit 3e8c8fd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseRects.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
.SuspenseRectsContainer {
22
padding: .25rem;
33
cursor: pointer;
4+
outline: 1px solid var(--color-component-name);
5+
}
6+
7+
.SuspenseRectsContainer[data-highlighted='true'] {
8+
background: var(--color-dimmest);
49
}
510

611
.SuspenseRectsViewBox {

packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseRects.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ const ViewBox = createContext<Rect>((null: any));
295295

296296
function SuspenseRectsContainer(): React$Node {
297297
const store = useContext(StoreContext);
298+
const {inspectedElementID} = useContext(TreeStateContext);
298299
const treeDispatch = useContext(TreeDispatcherContext);
299300
const suspenseTreeDispatch = useContext(SuspenseTreeDispatcherContext);
300301
// TODO: This relies on a full re-render of all children when the Suspense tree changes.
@@ -329,8 +330,13 @@ function SuspenseRectsContainer(): React$Node {
329330
});
330331
}
331332

333+
const isRootSelected = roots.includes(inspectedElementID);
334+
332335
return (
333-
<div className={styles.SuspenseRectsContainer} onClick={handleClick}>
336+
<div
337+
className={styles.SuspenseRectsContainer}
338+
onClick={handleClick}
339+
data-highlighted={isRootSelected}>
334340
<ViewBox.Provider value={boundingBox}>
335341
<div
336342
className={styles.SuspenseRectsViewBox}

0 commit comments

Comments
 (0)