@usecrow/ui 0.1.60 → 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.js CHANGED
@@ -3886,7 +3886,22 @@ function CrowWidget({
3886
3886
  const messagesContainerRef = useRef(null);
3887
3887
  const executeClientToolRef = useRef(null);
3888
3888
  const submitToolResultRef = useRef(null);
3889
- const [isCollapsed, setIsCollapsed] = useState(variant === "floating");
3889
+ const [isCollapsed, setIsCollapsed] = useState(() => {
3890
+ if (variant !== "floating") return false;
3891
+ try {
3892
+ const stored = sessionStorage.getItem("crow_widget_collapsed");
3893
+ if (stored !== null) return stored === "true";
3894
+ } catch {
3895
+ }
3896
+ return true;
3897
+ });
3898
+ useEffect(() => {
3899
+ if (variant !== "floating") return;
3900
+ try {
3901
+ sessionStorage.setItem("crow_widget_collapsed", String(isCollapsed));
3902
+ } catch {
3903
+ }
3904
+ }, [isCollapsed, variant]);
3890
3905
  const [showConversationList, setShowConversationList] = useState(false);
3891
3906
  const [isVerifiedUser, setIsVerifiedUser] = useState(false);
3892
3907
  const [isBrowserUseActive, setIsBrowserUseActive] = useState(false);