Fix DevTools shell pane resizing by binding grid tracks to split variables#36437
Fix DevTools shell pane resizing by binding grid tracks to split variables#36437ypingmoe wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Hi @ypingmoe! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
This PR fixes a layout synchronization bug in the DevTools shell (
packages/react-devtools-shell/index.html) where dragging the split divider updated the divider position visually, but did not reliably resize the iframe and DevTools panes.The root cause was split state being updated in one place while grid track sizing could diverge. The fix makes grid sizing consistently variable-driven and toggles layout mode via container classes, so both divider behavior and pane dimensions are derived from the same source of truth.
Changes
--left-column-width,--top-row-height) and divider thickness.#panes.leftrightand#panes.topbottom.setLayout()to:#panes--divider-sizefor consistency across orientations.Why this approach
Using CSS variables as the single source of truth for grid tracks ensures drag interactions and rendered pane sizes remain in sync. Class-based layout switching also reduces imperative style mutations and makes orientation behavior easier to reason about and maintain.
Testing
Fixes #36434