Skip to content

fix: preserve Settings Editor TOC section state across focus changes (fixes PlatformNetwork/bounty-challenge#21908)#17

Closed
echobt wants to merge 0 commit intomainfrom
fix/issue-21908
Closed

fix: preserve Settings Editor TOC section state across focus changes (fixes PlatformNetwork/bounty-challenge#21908)#17
echobt wants to merge 0 commit intomainfrom
fix/issue-21908

Conversation

@echobt
Copy link
Copy Markdown
Contributor

@echobt echobt commented Feb 27, 2026

Fix

Preserves the Settings Editor TOC (Table of Contents) section state across editor focus changes.

Changes

  • SettingsEditor.tsx: Module-level signal persistedActiveSection is now backed by sessionStorage via safeGetItem/safeSetItem
  • The active section is only updated when the user explicitly clicks a TOC section, not reactively overwritten on focus changes
  • SessionStorage key settings_active_toc_section ensures persistence across component unmount/remount cycles

Root Cause

When the editor gained/lost focus, the SettingsEditor component could re-mount (due to <Show>/<Switch> wrappers), and the module-level signal would be reset to 'editor' (default). The fix backs the signal with sessionStorage so it survives these cycles.

Fixes PlatformNetwork/bounty-challenge#21908

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.

[BUG] [alpha] Settings Editor (SettingsEditor) loses TOC section state on editor focus change.

1 participant