authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-08-10 03:55:32+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-10 01:55:32+00:00
log5da45337f7178db711624c3e7c4d69059b2b286a
tree4b8442aa75b772e933b72e2b3b3a0ca892bcb665
parentf21d5e444e9a6b5876253ca8618a4dc8d4f2146c
signature Signed by PGP key B5690EEEBB952194

Preserve back navigation when opening settings (#5930)

Co-authored-by: codex <codex@users.noreply.github.com>

1 files changed, 10 insertions(+), 0 deletions(-)

apps/web/src/components/AppSidebarLayout.tsx+10
...@@ -20,6 +20,7 @@ import ThreadSidebar from "./Sidebar";...@@ -20,6 +20,7 @@ import ThreadSidebar from "./Sidebar";
20import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";20import { SettingsSidebarNav } from "./settings/SettingsSidebarNav";
21import { SidebarChromeHeader } from "./sidebar/SidebarChrome";21import { SidebarChromeHeader } from "./sidebar/SidebarChrome";
22import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop";22import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop";
23import { useProjects } from "../state/entities";
23import {24import {
24 resolveInitialThreadSidebarWidth,25 resolveInitialThreadSidebarWidth,
25 resolveThreadSidebarMaximumWidth,26 resolveThreadSidebarMaximumWidth,
...@@ -118,6 +119,14 @@ function SidebarControl() {...@@ -118,6 +119,14 @@ function SidebarControl() {
118 );119 );
119}120}
120121
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.
125function ProjectProjectionRetention() {
126 useProjects();
127 return null;
128}
129
121export function AppSidebarLayout({ children }: { children: ReactNode }) {130export function AppSidebarLayout({ children }: { children: ReactNode }) {
122 const navigate = useNavigate();131 const navigate = useNavigate();
123 const legacySidebarEnabled = useLegacySidebarEnabled();132 const legacySidebarEnabled = useLegacySidebarEnabled();
...@@ -184,6 +193,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {...@@ -184,6 +193,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
184193
185 return (194 return (
186 <SidebarProvider className="h-dvh! min-h-0!" defaultOpen style={sidebarProviderStyle}>195 <SidebarProvider className="h-dvh! min-h-0!" defaultOpen style={sidebarProviderStyle}>
196 <ProjectProjectionRetention />
187 <Sidebar197 <Sidebar
188 side="left"198 side="left"
189 collapsible="offcanvas"199 collapsible="offcanvas"