| ... | ... | @@ -20,6 +20,7 @@ import ThreadSidebar from "./Sidebar"; |
| 20 | 20 | import { SettingsSidebarNav } from "./settings/SettingsSidebarNav"; |
| 21 | 21 | import { SidebarChromeHeader } from "./sidebar/SidebarChrome"; |
| 22 | 22 | import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop"; |
| 23 | import { useProjects } from "../state/entities"; |
| 23 | 24 | import { |
| 24 | 25 | resolveInitialThreadSidebarWidth, |
| 25 | 26 | resolveThreadSidebarMaximumWidth, |
| ... | ... | @@ -118,6 +119,14 @@ function SidebarControl() { |
| 118 | 119 | ); |
| 119 | 120 | } |
| 120 | 121 | |
| 122 | // Settings swaps the thread sidebar out of the tree. Keep the lightweight |
| 123 | // project projection subscribed so returning to a draft never renders the |
| 124 | // zero-project state while the environment snapshot reconnects. |
| 125 | function ProjectProjectionRetention() { |
| 126 | useProjects(); |
| 127 | return null; |
| 128 | } |
| 129 | |
| 121 | 130 | export function AppSidebarLayout({ children }: { children: ReactNode }) { |
| 122 | 131 | const navigate = useNavigate(); |
| 123 | 132 | const legacySidebarEnabled = useLegacySidebarEnabled(); |
| ... | ... | @@ -184,6 +193,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) { |
| 184 | 193 | |
| 185 | 194 | return ( |
| 186 | 195 | <SidebarProvider className="h-dvh! min-h-0!" defaultOpen style={sidebarProviderStyle}> |
| 196 | <ProjectProjectionRetention /> |
| 187 | 197 | <Sidebar |
| 188 | 198 | side="left" |
| 189 | 199 | collapsible="offcanvas" |