docs(splitter): Persist pane size in the persisted layout story - #2301
Merged
rkaraivanov merged 2 commits intoJul 28, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Splitter Storybook documentation story PersistedLayout to persist and restore the pane size in addition to the collapsed state, making the example closer to real-world persisted layout usage.
Changes:
- Update the story docs description to mention persisting
startSizeand listening forigcResizeEnd. - Read persisted
startSizefromlocalStorageand bind it to.startSize. - Persist
startSizealongsidestartCollapsed/endCollapsedon resize/expansion events.
rkaraivanov
approved these changes
Jul 28, 2026
rkaraivanov
merged commit Jul 28, 2026
87bb63b
into
rkaraivanov/splitter-collapsed-panes-state
1 check passed
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.
Description
First of all, thank you for working on this feature. I tried the new
PersistedLayoutstory, and the collapse/expand events worked very nicely.However, I noticed that the story only saves and restores the collapsed state. The pane size is not restored after a reload. Since the story is named "Persisted Layout", I think saving the pane size too would make it a better example of real world usage.
So this PR extends the story to also save and restore
startSizeby listening for theigcResizeEndevent. The story description in the docs is updated accordingly. There is no change to the component itself, only to the story.Type of Change
Related Issues
Related to #2297 and #2299 (this PR targets the
rkaraivanov/splitter-collapsed-panes-statebranch)Testing
I ran Storybook locally and checked the
PersistedLayoutstory in Chrome:localStorageand reload. The story starts from the default 50% layout.Checklist