Skip to content

fix: default open overrides storage#87

Open
stevekaplan123 wants to merge 1 commit intomainfrom
bug/sc-42589/-chatbot-mode-closed-mode-does-not-persist
Open

fix: default open overrides storage#87
stevekaplan123 wants to merge 1 commit intomainfrom
bug/sc-42589/-chatbot-mode-closed-mode-does-not-persist

Conversation

@stevekaplan123
Copy link
Contributor

@stevekaplan123 stevekaplan123 commented Mar 17, 2026

Description

Previously, the chatbot's default state would be closed (which is wrong) and once the user opened, our logic is wrong so that even after the user closes it, refreshing the page opens up the chatbot.

Code Changes

Updates the <lc-chatbot> widget’s initial open/closed state logic so that persisted UI state from localStorage is respected over the default-open attribute, addressing incorrect “default open” behavior across reloads. Moreover, the default value for default-open is now true.

@coolify-sefaria-github
Copy link

coolify-sefaria-github bot commented Mar 17, 2026

The preview deployment for sefaria/ai-chatbot:server is ready. 🟢

Open app | Open Build Logs | Open Application Logs

Last updated at: 2026-03-19 08:20:02 CET

@stevekaplan123 stevekaplan123 requested a review from Copilot March 19, 2026 08:29

This comment was marked as resolved.

@stevekaplan123 stevekaplan123 marked this pull request as ready for review March 19, 2026 11:12
Comment on lines +147 to 151
if (savedUI?.isOpen !== undefined) {
isOpen = savedUI.isOpen;
} else if (defaultOpen) {
isOpen = true;
}
Copy link
Contributor

@YishaiGlasner YishaiGlasner Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
isOpen = savedUI?.isOpen ?? defaultOpen;

edit - it shows only l147, but the idea is to replace l147-151

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.

3 participants