Skip to content

docs(splitter): Persist pane size in the persisted layout story - #2301

Merged
rkaraivanov merged 2 commits into
rkaraivanov/splitter-collapsed-panes-statefrom
jsakamotoIGJP/splitter-persisted-layout-story
Jul 28, 2026
Merged

docs(splitter): Persist pane size in the persisted layout story#2301
rkaraivanov merged 2 commits into
rkaraivanov/splitter-collapsed-panes-statefrom
jsakamotoIGJP/splitter-persisted-layout-story

Conversation

@jsakamotoIGJP

Copy link
Copy Markdown
Contributor

Description

First of all, thank you for working on this feature. I tried the new PersistedLayout story, 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 startSize by listening for the igcResizeEnd event. The story description in the docs is updated accordingly. There is no change to the component itself, only to the story.

Type of Change

  • Documentation update

Related Issues

Related to #2297 and #2299 (this PR targets the rkaraivanov/splitter-collapsed-panes-state branch)

Testing

I ran Storybook locally and checked the PersistedLayout story in Chrome:

  1. Drag the splitter bar, then reload the page. The pane size is restored.
  2. Collapse a pane, then reload the page. The collapsed state is restored, as before.
  3. Clear localStorage and reload. The story starts from the default 50% layout.

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally
  • I have updated documentation if needed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 startSize and listening for igcResizeEnd.
  • Read persisted startSize from localStorage and bind it to .startSize.
  • Persist startSize alongside startCollapsed/endCollapsed on resize/expansion events.

Comment thread stories/splitter.stories.ts
Comment thread stories/splitter.stories.ts
Comment thread stories/splitter.stories.ts
@rkaraivanov
rkaraivanov merged commit 87bb63b into rkaraivanov/splitter-collapsed-panes-state Jul 28, 2026
1 check passed
@rkaraivanov
rkaraivanov deleted the jsakamotoIGJP/splitter-persisted-layout-story branch July 28, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants