@usecrow/ui 0.1.61 → 0.1.62

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/dist/index.cjs CHANGED
@@ -3912,7 +3912,22 @@ function CrowWidget({
3912
3912
  const messagesContainerRef = React3.useRef(null);
3913
3913
  const executeClientToolRef = React3.useRef(null);
3914
3914
  const submitToolResultRef = React3.useRef(null);
3915
- const [isCollapsed, setIsCollapsed] = React3.useState(variant === "floating");
3915
+ const [isCollapsed, setIsCollapsed] = React3.useState(() => {
3916
+ if (variant !== "floating") return false;
3917
+ try {
3918
+ const stored = sessionStorage.getItem("crow_widget_collapsed");
3919
+ if (stored !== null) return stored === "true";
3920
+ } catch {
3921
+ }
3922
+ return true;
3923
+ });
3924
+ React3.useEffect(() => {
3925
+ if (variant !== "floating") return;
3926
+ try {
3927
+ sessionStorage.setItem("crow_widget_collapsed", String(isCollapsed));
3928
+ } catch {
3929
+ }
3930
+ }, [isCollapsed, variant]);
3916
3931
  const [showConversationList, setShowConversationList] = React3.useState(false);
3917
3932
  const [isVerifiedUser, setIsVerifiedUser] = React3.useState(false);
3918
3933
  const [isBrowserUseActive, setIsBrowserUseActive] = React3.useState(false);