Preserve back navigation when opening settings (#5930)
Co-authored-by: codex <[email protected]>
This commit is contained in:
1 parent
f21d5e444e
commit
5da45337f7
1 file changed
+10
@@ -20,6 +20,7 @@ import ThreadSidebar from "./Sidebar";
|
||||
import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";
|
||||
import { SidebarChromeHeader } from "./sidebar/SidebarChrome";
|
||||
import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop";
|
||||
import { useProjects } from "../state/entities";
|
||||
import {
|
||||
resolveInitialThreadSidebarWidth,
|
||||
resolveThreadSidebarMaximumWidth,
|
||||
@@ -118,6 +119,14 @@ function SidebarControl() {
|
||||
);
|
||||
}
|
||||
|
||||
// Settings swaps the thread sidebar out of the tree. Keep the lightweight
|
||||
// project projection subscribed so returning to a draft never renders the
|
||||
// zero-project state while the environment snapshot reconnects.
|
||||
function ProjectProjectionRetention() {
|
||||
useProjects();
|
||||
return null;
|
||||
}
|
||||
|
||||
export function AppSidebarLayout({ children }: { children: ReactNode }) {
|
||||
const navigate = useNavigate();
|
||||
const legacySidebarEnabled = useLegacySidebarEnabled();
|
||||
@@ -184,6 +193,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
|
||||
|
||||
return (
|
||||
<SidebarProvider className="h-dvh! min-h-0!" defaultOpen style={sidebarProviderStyle}>
|
||||
<ProjectProjectionRetention />
|
||||
<Sidebar
|
||||
side="left"
|
||||
collapsible="offcanvas"
|
||||
|
||||
Reference in new issue
Block a user