From 31bc4039c1f830ae2fd427744ceb13906c9ea508 Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin <28902667+hoxyq@users.noreply.github.com> Date: Sun, 5 Oct 2025 13:13:36 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"[DevTools]=20Always=20include=20the?= =?UTF-8?q?=20root=20in=20the=20timeline=20and=20select=20it=20by=20d?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ced705d7566a2f7f2a2f0e904d91fe1d1d97f808. --- .../devtools/views/SuspenseTab/SuspenseTab.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js b/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js index f698f0ae165..f7b63fa2c62 100644 --- a/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js +++ b/packages/react-devtools-shared/src/devtools/views/SuspenseTab/SuspenseTab.js @@ -34,10 +34,6 @@ import { SuspenseTreeStateContext, } from './SuspenseTreeContext'; import {StoreContext, OptionsContext} from '../context'; -import { - TreeDispatcherContext, - TreeStateContext, -} from '../Components/TreeContext'; import Button from '../Button'; import Toggle from '../Toggle'; import typeof {SyntheticPointerEvent} from 'react-dom-bindings/src/events/SyntheticEvent'; @@ -185,18 +181,6 @@ function SuspenseTab(_: {}) { treeListHorizontalFraction, } = state; - const {inspectedElementID} = useContext(TreeStateContext); - const {timeline} = useContext(SuspenseTreeStateContext); - const treeDispatch = useContext(TreeDispatcherContext); - useLayoutEffect(() => { - // If the inspected element is still null and we've loaded a timeline, we can set the initial selection. - // TODO: This tab should use its own source of truth instead so we only show suspense boundaries. - if (inspectedElementID === null && timeline.length > 0) { - const milestone = timeline[timeline.length - 1]; - treeDispatch({type: 'SELECT_ELEMENT_BY_ID', payload: milestone}); - } - }, [timeline, inspectedElementID]); - useLayoutEffect(() => { const wrapperElement = wrapperTreeRef.current;