mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #23261] [CLOSED] fix: use sessionStorage for showControls to prevent cross-tab state leakage #42739
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23261
Author: @karthik-idikuda
Created: 3/31/2026
Status: ❌ Closed
Base:
dev← Head:fix/cross-tab-showcontrols-state-leak📝 Commits (1)
fd182c9fix: use sessionStorage for showControls to prevent cross-tab state leakage📊 Changes
1 file changed (+5 additions, -2 deletions)
View changed files
📝
src/routes/(app)/+layout.svelte(+5 -2)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Opening an Artifacts preview in one browser tab automatically expands the Advanced Settings/Controls panel on the Home page in another tab, without user action. This is caused by
showControlsbeing persisted vialocalStoragewhich is shared across all tabs of the same origin.Root Cause:
In
src/routes/(app)/+layout.svelte, theshowControlsstore state is persisted vialocalStorage:Since
localStorageis shared across all tabs:showControls.set(true)-> writeslocalStorage.showControls = 'true'onMountreadslocalStorage.showControls === 'true'-> controls panel auto-expandsFix: Switch from
localStoragetosessionStoragefor persistingshowControls.sessionStorageis isolated per browser tab/session, so each tab maintains its own independent controls panel state. This preserves within-tab persistence (controls stay open across SPA navigation within the same tab) while eliminating cross-tab leakage.Note:
chatControlsSize(the panel width) intentionally remains inlocalStorageso the user's preferred panel width is preserved globally.Fixed
Additional Information
showControlsis affected. OtherlocalStorageitems likechatControlsSizeandselectedTerminalIdcorrectly uselocalStoragesince they represent user preferences that should persist globally.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.