* Tear down all workspace-scoped module singletons so the new * workspace starts with a clean slate. Hook-managed singletons * (e.g. ChannelMuteSyncManager, ChannelSectionSyncManager) are * destroyed via effect cleanup and do not need entries here. * See AGENTS.md "Workspace Switching" for the f
()
| 25 | * See AGENTS.md "Workspace Switching" for the full contract. |
| 26 | */ |
| 27 | function resetWorkspaceState(): void { |
| 28 | relayClient.disconnect(); |
| 29 | resetAgentObserverStore(); |
| 30 | resetSidebarRelayConnectionCardState(); |
| 31 | resetMediaCaches(); |
| 32 | resetVideoPlayerState(); |
| 33 | resetRenderScopedReactionHydration(); |
| 34 | clearSearchHitEventCache(); |
| 35 | clearAllDrafts(); |
| 36 | } |
| 37 | |
| 38 | type WorkspaceInitResult = |
| 39 | | { isReady: true; needsSetup: false; appliedKey: string } |
no test coverage detected