Providers and Runtime Context
Providers and Runtime Context
Section titled “Providers and Runtime Context”Global providers are composed in src/app/providers.tsx.
Current Provider Order
Section titled “Current Provider Order”TenantProviderQueryClientProviderSessionProviderLockProviderNotifProviderModuleAccessProviderBarLoaderProviderTabProviderSoundContext.ProviderChatSocketProviderSignOutOverlayProviderProfileImageProviderChatProvider
Why Order Matters
Section titled “Why Order Matters”ModuleAccessProviderand module consumers rely on session-backed data.TabProviderconsumers (navigation, handlers) must render below it.- Chat runtime (
ChatSocketProvider,ChatProvider) depends on session context. LockProvideroverlays the application and should wrap downstream UI.
ClientShell Bootstrap
Section titled “ClientShell Bootstrap”ClientShell initializes runtime module context:
- Sets
setModulesInfo(initialModules)from server-fetched modules. - Loads and applies sidebar sort order config.
- Persists module cache in local storage.
High-Risk Changes
Section titled “High-Risk Changes”Treat provider order changes as architecture changes.
When changing order:
- Confirm all consuming hooks still mount beneath their providers.
- Test auth flows (
/,/app,/logout). - Test sidebar/module visibility and chat startup.
- Test lock screen behavior and cross-tab sync.