You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix split panels rendering in wrong order on browser back navigation
When two splits are open (e.g. /component/channels + /channel/), closing the left split and then using browser back navigation restores the correct URL but renders the panels on the wrong sides.
Root cause: Resize.Panel passes its index prop to solver.addPanel(panel, index), which uses a falsy guard to check the index:
A new test file was introduced for the createResizeSolver function with comprehensive test coverage for the addPanel method. Concurrently, a bug fix was applied to the solver logic that corrects the insertion index validation. The previous condition treated 0 as falsy and skipped it, causing panels to be appended instead of inserted at index zero. The updated condition explicitly checks for null or undefined values, allowing zero to be recognized as a valid insertion position. Tests verify insertion at different indices, appending behavior, and duplicate prevention.
Poem
🐰 A panel at zero—once lost to the void,
Now finds its true place, bugs well destroyed!
Tests dance and verify, index by index,
Insertion flows smoothly—no more need to fix!
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name
Status
Explanation
Title check
✅ Passed
The title directly addresses the main bug fix: resizer breaking split ordering on history navigation, matching the core change in solver.ts.
Description check
✅ Passed
The pull request description clearly explains the bug (panels rendering in wrong order on browser back navigation), identifies the root cause (falsy check treating 0 as invalid), and describes the fix (null check instead).
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches📝 Generate docstrings
Create stacked PR
Commit on current branch
🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch synoet/fix-resizer-breaking-split-order
Comment @coderabbitai help to get the list of available commands and usage tips.
The reason will be displayed to describe this comment to others. Learn more.
nice
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
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.
Fix split panels rendering in wrong order on browser back navigation
When two splits are open (e.g. /component/channels + /channel/), closing the left split and then using browser back navigation restores the correct URL but renders the panels on the wrong sides.
Root cause: Resize.Panel passes its index prop to solver.addPanel(panel, index), which uses a falsy guard to check the index:
When index === 0, 0 is falsy in JS, so the panel is appended at the end instead of inserted at position 0.
Fix: Replace the truthiness check with a null check: ndx != null && ndx < order().length.