fix(layout): prevent result pane from appearing at top of page#1182
Merged
wcchang1115 merged 5 commits intomainfrom Mar 6, 2026
Conversation
…788) The react-split library has two code paths for prop changes: a simple setSizes() path when only sizes change, and a destructive destroy/recreate path when gutterSize or minSize change. The old code changed all three props simultaneously when toggling panels, triggering the destructive path which has a DOM measurement race condition — sometimes causing the result pane to render at the top instead of the bottom. Fix: keep gutterSize and minSize constant across all split panes so only sizes changes, using the safe setSizes() path. Hide gutters via CSS class when panels are collapsed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jared Scott <jared.scott@datarecce.io>
…sometimes-decide-to-be-at-the-top
iamcxa
reviewed
Mar 6, 2026
Contributor
iamcxa
left a comment
There was a problem hiding this comment.
Code review by AI agents (code-reviewer + comment-analyzer + silent-failure-hunter).
Overall: The fix is sound and well-executed. Keeping gutterSize and minSize constant forces react-split to use the safe setSizes() path, avoiding the destroy/recreate race condition. The test coverage (20 tests for prop stability) is thorough, the PR description is excellent, and the code comment in MainLayout.tsx was verified against the library source.
3 minor observations below.
…sometimes-decide-to-be-at-the-top
…-2788) - Change `.split-gutter-hidden .gutter` to `.split-gutter-hidden > div > .gutter` to avoid hiding gutters in nested split panes (e.g. CheckDetailOss inside MainLayout) - Add cross-reference comments in LineageViewOss and SandboxView explaining why split props must stay constant - Add note about the ~2.5px calc shortfall trade-off in splitStyles.css Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Jared Scott <jared.scott@datarecce.io>
Signed-off-by: Jared Scott <jared.scott@datarecce.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
What type of PR is this?
Bug fix
What this PR does / why we need it:
Fixes an intermittent bug where query result windows (profile, row count diff, etc.) sometimes render at the top of the page instead of the bottom half of the split pane.
Root cause: The
react-splitlibrary has two code paths for handling prop changes:setSizes): triggered when onlysizeschanges — just updates element dimensionsgutterSize,minSize, or other props change — destroys the split instance, re-measures DOM, and rebuilds from scratchThe old code changed
gutterSize(0→5),minSize(0→100), andsizessimultaneously when toggling panels. This triggered the destructive path, which has a race condition: it measures DOM dimensions during React'scomponentDidUpdate, but with CSScontain: sizeon the container, measurements can be unreliable — sometimes causing split.js to miscalculate positions.Fix: Keep
gutterSizeandminSizeconstant across all split panes so onlysizeschanges, using the safesetSizes()path. Gutters are hidden via a CSS class when panels are collapsed.Files changed:
MainLayout.tsx— HSplit (history panel) and VSplit (result pane)LineageViewOss.tsx— HSplit (node detail panel)SandboxView.tsx— VSplit (sandbox result pane)splitStyles.css—.split-gutter-hiddenCSS ruleMainLayout.test.tsx— 20 new tests verifying prop stabilityWhich issue(s) this PR fixes:
Fixes DRC-2788
Special notes for your reviewer:
This bug was intermittent because it depended on browser layout timing — sometimes the DOM measurements happened after layout completed (working correctly), sometimes before (broken). The fix eliminates the measurement entirely by avoiding react-split's destroy/recreate code path.
Does this PR introduce a user-facing change?:
Fix: Query result panels (profile, row count diff, etc.) no longer intermittently appear at the top of the page instead of the bottom split pane.
Test plan
Test 1: Profile from Lineage (primary repro from ticket)
Test 2: Row Count Diff from Lineage
Test 3: Node Detail Panel (right sidebar)
Test 4: History Panel Toggle
Test 5: Sandbox/Query View
Test 6: Rapid toggling stress test
Tips for testing
🤖 Generated with Claude Code