kyd-shared-badge 0.3.27 → 0.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/chat/ChatWidget.tsx +7 -0
package/package.json
CHANGED
package/src/chat/ChatWidget.tsx
CHANGED
|
@@ -51,6 +51,13 @@ export default function ChatWidget({ api = '/api/chat', title = 'KYD Bot', hintT
|
|
|
51
51
|
} catch {}
|
|
52
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
53
53
|
}, [hasMounted, isMobile]);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
// when sidebar is closed, dismiss hint
|
|
57
|
+
if (open) return;
|
|
58
|
+
setShowHint(false);
|
|
59
|
+
}, [open]);
|
|
60
|
+
|
|
54
61
|
// Sidebar width with bounds and persistence
|
|
55
62
|
const [width, setWidth] = useState<number>(() => {
|
|
56
63
|
try { const w = Number(localStorage.getItem('kydChatSidebarWidth')); return Number.isFinite(w) && w >= 320 ? Math.min(w, Math.floor(window.innerWidth * 0.9)) : 420; } catch { return 420; }
|