import { atomWithWebStorage } from "@/lib/jotai-helper.ts"; import { atom } from "jotai"; // Stable DOM id set on the app-shell navbar (). Declared here — // alongside the sidebar atoms — rather than in the chat window so the AI chat // window can reference the navbar by id without importing the app shell (which // would create a shell -> chat-window -> shell import cycle). export const APP_NAVBAR_ID = "app-shell-navbar"; export const mobileSidebarAtom = atom(false); export const desktopSidebarAtom = atomWithWebStorage( "showSidebar", true, ); export const desktopAsideAtom = atom(false); // Valid `tab` values: "" | "comments" | "toc" | "details" type AsideStateType = { tab: string; isAsideOpen: boolean; }; export const asideStateAtom = atom({ tab: "", isAsideOpen: false, }); export const sidebarWidthAtom = atomWithWebStorage('sidebarWidth', 300);