From c590956c9cdace147ce1871142ecc6e43a282ae0 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Wed, 22 Jul 2026 13:21:53 -0500 Subject: [PATCH] fix desktop windows title bar status --- src/app/components/app-shell/AppShell.tsx | 6 +++-- src/app/pages/App.tsx | 27 +++++++++++++++-------- src/app/styles/edgeToEdgeInsets.test.ts | 4 +++- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/src/app/components/app-shell/AppShell.tsx b/src/app/components/app-shell/AppShell.tsx index 82fdf1521..416dadfb1 100644 --- a/src/app/components/app-shell/AppShell.tsx +++ b/src/app/components/app-shell/AppShell.tsx @@ -1,5 +1,6 @@ import { type ReactNode, Suspense, lazy, useState } from 'react'; import { Provider as JotaiProvider } from 'jotai'; +import type { createStore } from 'jotai/vanilla'; import { OverlayContainerProvider, PopOutContainerProvider, TooltipContainerProvider } from 'folds'; import { QueryClientProvider } from '@tanstack/react-query'; import { isTauri } from '@tauri-apps/api/core'; @@ -24,9 +25,10 @@ type AppShellProps = { children: ReactNode; queryClient: Parameters[0]['client']; screenSize: ScreenSize; + jotaiStore?: ReturnType; }; -export function AppShell({ children, queryClient, screenSize }: AppShellProps) { +export function AppShell({ children, queryClient, screenSize, jotaiStore }: AppShellProps) { const tauriOs = isTauri() ? osType() : undefined; const useDesktopTitleBar = tauriOs === 'windows' || tauriOs === 'linux'; const useMacTitleBar = tauriOs === 'macos'; @@ -41,7 +43,7 @@ export function AppShell({ children, queryClient, screenSize }: AppShellProps) { - +
{ type BootstrappedAppShellProps = { clientConfig: ClientConfig; screenSize: ScreenSize; + jotaiStore: ReturnType; }; -function BootstrappedAppShell({ clientConfig, screenSize }: BootstrappedAppShellProps) { +function BootstrappedAppShell({ clientConfig, screenSize, jotaiStore }: BootstrappedAppShellProps) { normalizeOAuthCallbackUrl(clientConfig.hashRouter); - const jotaiStoreRef = useRef>(); - if (!jotaiStoreRef.current) { - jotaiStoreRef.current = createStore(); - bootstrapSettingsStore(jotaiStoreRef.current, clientConfig.settingsDefaults); - } + bootstrapSettingsStore(jotaiStore, clientConfig.settingsDefaults); const router = useMemo(() => createRouter(clientConfig, screenSize), [clientConfig, screenSize]); const reactQueryDevtoolsEnabled = isReactQueryDevtoolsEnabled(); return ( - + {reactQueryDevtoolsEnabled && ( @@ -68,13 +65,21 @@ function renderSentryErrorFallback({ error, eventId }: { error: unknown; eventId function App() { const screenSize = useScreenSize(); useCompositionEndTracking(); + const jotaiStoreRef = useRef>(); + if (!jotaiStoreRef.current) { + jotaiStoreRef.current = createStore(); + } const renderConfiguredApp = useCallback( (clientConfig: ClientConfig) => { setMatrixToBase(clientConfig.matrixToBaseUrl); return ( - + ); }, @@ -83,7 +88,11 @@ function App() { return ( - + {renderConfiguredApp} diff --git a/src/app/styles/edgeToEdgeInsets.test.ts b/src/app/styles/edgeToEdgeInsets.test.ts index c6e0a5fd5..43103ccff 100644 --- a/src/app/styles/edgeToEdgeInsets.test.ts +++ b/src/app/styles/edgeToEdgeInsets.test.ts @@ -36,7 +36,9 @@ describe('android edge-to-edge inset contract', () => { const systemBarShell = readWorkspaceFile('src/app/components/app-shell/SystemBarShell.tsx'); expect(indexHtml).not.toContain('id="portalContainer"'); - expect(appTsx).toContain(''); + expect(appTsx).toContain(''); expect(systemBarShell).toContain('ref={onPortalContainerChange}');