mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #23759] fix(ui): prevent showControls cross-tab state leak via localStorage #66214
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/23759
Author: @AKIB473
Created: 4/15/2026
Status: 🔄 Open
Base:
dev← Head:fix/show-controls-cross-tab-leak-dev📝 Commits (1)
75e5c59fix(ui): prevent showControls cross-tab state leak via localStorage📊 Changes
2 files changed (+6 additions, -6 deletions)
View changed files
📝
src/lib/components/chat/Navbar.svelte(+3 -1)📝
src/routes/(app)/+layout.svelte(+3 -5)📄 Description
Pull Request Checklist
devbranch.dev.fixprefix applied.Description
Fixes #23232.
Opening an Artifacts preview in one tab silently set
localStorage.showControls = 'true'. Any new tab navigating to Home would then read that value on mount and auto-expand the Controls panel without any user interaction.Root cause
(app)/+layout.sveltesubscribed to theshowControlsSvelte store unconditionally:This persisted every mutation — including programmatic
showControls.set(false)calls fromArtifacts.svelteandshowControls.set(true)fromCitations.svelte/ContentRenderer.svelte. Those writes propagated to every other tab via shared localStorage.Fix
Remove the unconditional subscriber from the layout. The layout still reads
localStorage.showControlsonce on mount to restore the user's preference. Persistence is now written only inNavbar.svelte, inside the Controls button'son:clickhandler — so localStorage only reflects deliberate user toggles.Files changed
src/routes/(app)/+layout.svelte— removedshowControls.subscribe()that was writing to localStoragesrc/lib/components/chat/Navbar.svelte— added explicitlocalStorage.showControlswrite on user clickSteps to reproduce (before fix)
After fix
Tab B opens with Controls panel collapsed, regardless of what Tab A did programmatically.
Changelog Entry
Fixed
showControlsis now only persisted tolocalStorageon explicit user interaction, not on programmatic store mutations from Artifacts or Citations components.Additional Information
Screenshots or Videos
N/A — the fix is a state management correction with no visual change to the Controls panel itself.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.