fix: persist Building Blocks sidebar filter toggles#4448
Open
coffeenjoyer17 wants to merge 1 commit intosuperplanehq:mainfrom
Open
fix: persist Building Blocks sidebar filter toggles#4448coffeenjoyer17 wants to merge 1 commit intosuperplanehq:mainfrom
coffeenjoyer17 wants to merge 1 commit intosuperplanehq:mainfrom
Conversation
The 'Connected Integrations on Top' and 'Show integration setup status' toggles in the Building Blocks sidebar previously reset every time the sidebar remounted (selecting a component, navigating, etc.) because the state was held only in component state. Both toggles are now backed by localStorage, mirroring the pattern already used for the sidebar width. Defaults are preserved (setup status on, connected-on-top off) when no value has been written yet. Closes superplanehq#4370 Signed-off-by: coffeenjoyer17 <pufleacristian56@gmail.com>
|
👋 Commands for maintainers:
|
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.
Closes #4370
Summary
The
Connected Integrations on TopandShow integration setup statustoggles in the Building Blocks sidebar reset whenever the sidebar remounts — selecting a component, opening the sidebar again, or navigating away and back. The issue references the connected-on-top filter; the setup-status toggle sits in the same dropdown and exhibits the same problem, so this PR persists both for consistency.Implementation
Both toggles are now hydrated from
localStorageon mount and written back on every change, matching the pattern already used forsidebarWidthin the same component:componentSidebarShowSetupStatus— defaulttruecomponentSidebarConnectedOnTop— defaultfalseKey constants are exported from
ui/CanvasPage/index.tsxnext to the existingCOMPONENT_SIDEBAR_WIDTH_STORAGE_KEY. SSR-safe (typeof window === "undefined"guard) like the existing width init.Verification
tsc --noEmit -p .clean.filter.spec.tsandCategorySection.spec.tsxstill pass (15 tests).npm run lint:budgettotals are unchanged frommain.