@@ -41,12 +41,10 @@ import { BackgroundThreadAnnouncer } from "./BackgroundThreadAnnouncer";
4141import LegacyThreadSidebar from "./LegacySidebar" ;
4242import { useThreadVisitedMigration } from "../hooks/useThreadVisitedMigration" ;
4343import ThreadSidebar from "./Sidebar" ;
44- import { SettingsSidebarNav } from "./settings/SettingsSidebarNav" ;
45- import { SidebarBrandWidthProbe , SidebarChromeHeader } from "./sidebar/SidebarChrome" ;
46- import { MainAppLocationTracker } from "./sidebar/mainAppLocation" ;
44+ import { SidebarBrandWidthProbe } from "./sidebar/SidebarChrome" ;
45+ import { isAppModalPage , MainAppLocationTracker } from "./sidebar/mainAppLocation" ;
4746import type { SidebarRouteReveal } from "./sidebar/routeReveal" ;
4847import { useSidebarStageBackdropVariant } from "./SidebarStageBackdrop" ;
49- import { useProjects } from "../state/entities" ;
5048import {
5149 clampThreadSidebarWidth ,
5250 resolveInitialThreadSidebarWidth ,
@@ -261,8 +259,8 @@ export function NavigationHistoryShortcuts() {
261259
262260const MODIFIER_KEYS = new Set ( [ "Alt" , "Control" , "Meta" , "Shift" ] ) ;
263261
264- // Undoes the thread actions in the sidebar's notice. Mounted wherever the
265- // thread sidebar can show; Settings replaces it . Listens in the capture phase
262+ // Undoes the thread actions in the sidebar's notice. Settings and Usage own
263+ // mod+z while open . Listens in the capture phase
266264// so mod+z reaches it before the composer's own undo handler consumes the key.
267265function ThreadUndoShortcut ( ) {
268266 const keybindings = useAtomValue ( primaryServerKeybindingsAtom ) ;
@@ -320,14 +318,6 @@ function ThreadUndoShortcut() {
320318 return null ;
321319}
322320
323- // Settings swaps the thread sidebar out of the tree. Keep the lightweight
324- // project projection subscribed so returning to a draft never renders the
325- // zero-project state while the environment snapshot reconnects.
326- function ProjectProjectionRetention ( ) {
327- useProjects ( ) ;
328- return null ;
329- }
330-
331321export function AppSidebarLayout ( { children } : { children : ReactNode } ) {
332322 const navigate = useNavigate ( ) ;
333323 const legacySidebarEnabled = useLegacySidebarEnabled ( ) ;
@@ -341,7 +331,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
341331 const pathname = useLocation ( { select : ( location ) => location . pathname } ) ;
342332 const panelAnimationsSuppressed = usePanelNavigationSuppression ( pathname ) ;
343333 const routePanelAnimationsActive = panelAnimationsActive && ! panelAnimationsSuppressed ;
344- const isOnSettings = pathname === "/settings" || pathname . startsWith ( "/settings/" ) ;
334+ const appModalOpen = isAppModalPage ( pathname ) ;
345335 const isMacosDesktop = isElectron && isMacPlatform ( navigator . platform ) ;
346336 const [ sidebarWidth , setSidebarWidth ] = useState ( readInitialThreadSidebarWidth ) ;
347337 // A clamped drag may not change width, so viewport changes need a separate subscription.
@@ -401,13 +391,12 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
401391 style = { sidebarProviderStyle }
402392 >
403393 < SidebarBrandWidthProbe onWidthChange = { setBrandWidth } />
404- < ProjectProjectionRetention />
405394 < Sidebar
406395 side = "left"
407396 collapsible = "offcanvas"
408397 data-app-sidebar = ""
409398 role = "navigation"
410- aria-label = { isOnSettings ? "Settings" : " Threads"}
399+ aria-label = " Threads"
411400 resizable = { {
412401 maxWidth : sidebarMaximumWidth ,
413402 minWidth : sidebarMinimumWidth ,
@@ -419,12 +408,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
419408 } }
420409 style = { windowControlsInsetStyle }
421410 >
422- { isOnSettings ? (
423- < >
424- < SidebarChromeHeader isElectron = { isElectron } />
425- < SettingsSidebarNav pathname = { pathname } />
426- </ >
427- ) : legacySidebarEnabled ? (
411+ { legacySidebarEnabled ? (
428412 < LegacyThreadSidebar routeReveal = { sidebarRouteReveal } />
429413 ) : (
430414 < ThreadSidebar routeReveal = { sidebarRouteReveal } />
@@ -435,7 +419,7 @@ export function AppSidebarLayout({ children }: { children: ReactNode }) {
435419 < BackgroundThreadAnnouncer />
436420 < SidebarControl />
437421 < NavigationHistoryShortcuts />
438- { isOnSettings ? null : < ThreadUndoShortcut /> }
422+ { appModalOpen ? null : < ThreadUndoShortcut /> }
439423 < MainAppLocationTracker />
440424 </ SidebarProvider >
441425 </ PanelAnimationSuppressionProvider >
0 commit comments