"use client"; import { type ReactNode, Suspense } from "react"; import { JiraDispatchModalHost } from "@/components/findings/jira-dispatch-modal-host"; import { RecheckResourceModalHost } from "@/components/findings/recheck-resource-modal-host"; import { AppSidebar } from "@/components/layout/app-sidebar"; import { CloudUpgradeModal } from "@/components/shared/cloud-upgrade-modal"; import { useSidePanelPushWidth } from "@/hooks/use-side-panel-push-width"; import { useStore } from "@/hooks/use-store"; import { cn } from "@/lib/utils"; import { selectHasModalHost, useSidePanelStore } from "@/store/side-panel"; export default function MainLayout({ children }: { children: ReactNode }) { // Push (not overlay): the open side panel shrinks the page by exactly its // (user-resizable) width so everything stays reachable. Below `sm` the // panel overlays full-width instead, where pushing would leave no page. The // full-page chat route has no panel at all. const pushWidth = useSidePanelPushWidth(); const sidePanelResizing = useStore(useSidePanelStore, (x) => x.isResizing); // A non-modal dialog sharing the screen with the panel covers the shell, so // the shell leaves the tab order and the accessibility tree meanwhile. const isShellInert = useSidePanelStore(selectHasModalHost); return (