Repository navigation
Manager: Remove persisted tag-filter state migration [SB-2022] - #36678
Merged
Merged
Conversation
…L era boundary Tag-filter state has lived in the URL since v10.4.0; only v10.3.x persisted includedTagFilters/excludedTagFilters to local/session storage. Removes the one-time storage-rewrite migration in Store.getInitialState (TODO: Remove in SB 11) and replaces it with a passive read-time strip that never adopts those keys, so stale v10.3.x values cannot union-merge into URL-derived initial state via the array-union deep merge in root.tsx. The strip is permanent, not version-gated, and no storage write happens at init. Adds a test proving legacy keys are dropped at read time and storage is left untouched; the existing storage-combine test now mocks a single read per storage.
Documents under the 11.0.0 section that v10.3.x was the last release to store sidebar tag filters in browser storage, that v10.4.0 moved the state to the URL, that 11.0 never adopts the stored values (no action required), and how to clear browser storage if old filters reappear after a direct 10.3.x → 11.0 upgrade.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
A direct 10.3 to 11 upgrade stays seamless if those keys never enter the initial-state merge. Drop the session strip, the helper, and the migration note, and leave a TODO to remove the omit in SB 12.
ndelangen
approved these changes
Oct 9, 2026
valentinpalkovic
approved these changes
Oct 9, 2026
2 tasks
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.
Fixes SB-2022
What I did
Replaces the one-time storage rewrite in
Store.getInitialState(TODO: Remove in SB 11) with a read-time omit ofincludedTagFiltersandexcludedTagFiltersfrom local storage only. v10.3 wrote those keys withpersistence: 'permanent'. If they are spread into initial state, the array-union merge revives them on every load. Dropping them before the spread keeps a direct 10.3 → 11 upgrade seamless, and nothing is written back to storage.A
TODO: Remove in SB 12marks the omit. Session storage is unchanged. No migration note, because there is nothing for the user to clear.code/core/src/manager-api/store.ts— local storage is destructured so those two keys never enter the merge.code/core/src/manager-api/tests/store.test.js— seeds local storage with the two keys plus an unrelated key, and asserts the unrelated key and session state are kept. The existing storage-combine test reads each storage once.Note for reviewers on local typecheck:
tscon an untouchedorigin/nextcheckout in our sandbox reports ~53 pre-existingreact-ariamodule-resolution errors in files this PR does not touch; a stash-diff confirms the error set is identical with and without this change, and the manager-api sources are absent from it. CI's typecheck is the authoritative word.Visual evidence: not applicable — state plumbing with no rendered output change
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
yarn task --task sandbox --start-from auto --template react-vite/default-ts, and open Storybook in the browser.tags/statusesparams, and survive a reload.localStorage.setItem('@storybook/manager/store', JSON.stringify({ includedTagFilters: ['custom'], excludedTagFilters: [], foo: 'bar' })), then reload. Expected: the leftover tag filters do not adopt into the URL or the filter menu, thefoocontrol key survives untouched (storage is never rewritten at load), and Storybook behaves normally.getStore().getInitialState(); every addon store initializes through this path, so compare behavior of core panels againstnextif anything looks off.Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary Release - 🚫 Not run
This PR does not have a canary release associated.
In-repo PRs: add the
ci:canarylabel. Later pushes republish while the label remains.Fork PRs: the label does nothing (a later push must not auto-publish). A maintainer publishes from this repository with Run workflow and the
prinput.branchandshaare optional; if more than one is set, they must be the same commit. The fork author does not need to do anything.🔗 Obvious Project · 🧵 Obvious Thread · 🔀 Obvious PR Artifact