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: 70cbcfd

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 <[email protected]>
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
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Dec 30, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@mattcosta7 mattcosta7 marked this pull request as ready for review December 30, 2025 19:12
@mattcosta7 mattcosta7 requested a review from a team as a code owner December 30, 2025 19:12
@mattcosta7 mattcosta7 requested a review from jonrohan December 30, 2025 19:12
@mattcosta7 mattcosta7 merged commit 28e77e6 into make-primer-react-pagelayout-accept-persister Dec 30, 2025
44 of 46 checks passed
@mattcosta7 mattcosta7 deleted the copilot/sub-pr-7348 branch December 30, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants