Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Consolidates resizable prop configuration from separate {persist: false} and {save: fn} patterns into unified {persist: false | 'localStorage' | fn} API.

Changelog

Changed

  • resizable prop now accepts {persist: false | 'localStorage' | fn} instead of separate {persist: false} and {save: fn} configs
  • Renamed CustomPersistConfigPersistConfig
  • Renamed NoPersistConfig → removed (merged into PersistConfig)
  • Custom persistence functions now passed via persist property instead of save

Before:

<PageLayout.Pane resizable={{save: (w) => store(w)}} />

After:

<PageLayout.Pane resizable={{persist: (w) => store(w)}} />
// Explicit localStorage now possible:
<PageLayout.Pane resizable={{persist: 'localStorage'}} />

New

  • PersistFunction type for custom persistence
  • isCustomPersistFunction type guard
  • isPersistConfig type guard

Removed

  • NoPersistConfig type (merged into PersistConfig)
  • CustomPersistConfig type (replaced by PersistConfig)
  • isNoPersistConfig type guard
  • isCustomPersistConfig type guard

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Note: While this changes the API surface, the original PR hasn't been released yet, so this is effectively a pre-release refinement.

Testing & Reviewing

  • Updated 66 unit tests to use new API
  • Updated Storybook examples demonstrating all three persist modes
  • Type checking passes with new signatures

Merge checklist


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@changeset-bot
Copy link

changeset-bot bot commented Dec 30, 2025

⚠️ No Changeset found

Latest commit: 679e98e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

- Replace `NoPersistConfig` and `CustomPersistConfig` with single `PersistConfig` type
- Change `persist` to accept `false | 'localStorage' | function`
- Update `saveWidth` function to handle new API
- Update type guards and exports
- Update all tests to use new API
- Update stories to use `persist:` instead of `save:`

Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
Copilot AI changed the title [WIP] Add custom persistence options to PageLayout.Pane Simplify resizable API: use persist: false | 'localStorage' | fn Dec 30, 2025
Copilot AI requested a review from mattcosta7 December 30, 2025 04:24
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.

2 participants