The best way to control Claude Code, Codex and more from any computer or phone
refactor(web): install draft model reconciliation at app start (#26046)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 27, 2026 at 11:19 UTC
6369e284d746a9a966d91b0ceae447fb989ac04f
2 files changed
+13
-17
apps/web/src/AppRoot.tsx
+1
-16
@@ -1,27 +1,12 @@
1
import { RouterProvider } from "@tanstack/react-router";
2
-import { useEffect } from "react";
3
-
4
-import { subscribeComposerDraftModelReconciliation } from "./composerDraftStore";
5
-import { environmentThreadShells } from "./state/threads";
6
-import { environmentShell } from "./state/shell";
2
3
import { ElectronBrowserHost } from "./browser/ElectronBrowserHost";
4
import { QuitHoldOverlay } from "./components/QuitHoldOverlay";
10
-import { appAtomRegistry, AppAtomRegistryProvider } from "./rpc/atomRegistry";
5
+import { AppAtomRegistryProvider } from "./rpc/atomRegistry";
6
import type { AppRouter } from "./router";
7
8
// Keep webviews outside the router but inside its atom registry so route changes preserve them.
9
export function AppRoot({ router }: { readonly router: AppRouter }) {
15
- useEffect(
16
- () =>
17
- subscribeComposerDraftModelReconciliation({
18
- registry: appAtomRegistry,
19
- threadShellAtom: environmentThreadShells.threadShellAtom,
20
- threadRefsAtom: environmentThreadShells.threadRefsAtom,
21
- shellStateAtom: environmentShell.stateAtom,
22
- }),
23
- [],
24
- );
10
return (
11
<AppAtomRegistryProvider>
12
<RouterProvider router={router} />
apps/web/src/appInit.tsx
+12
-1
@@ -23,7 +23,11 @@ import { startGuideRunNotifications } from "./components/pullRequest/guide/PullR
23
import { APP_BASE_NAME, APP_DISPLAY_NAME, APP_STAGE_LABEL } from "./branding";
24
import { resolveServerBackedAppDisplayName } from "./branding.logic";
25
import { isElectron } from "./env";
26
-import { subscribeDraftThreadPromotion, useComposerDraftStore } from "./composerDraftStore";
26
+import {
27
+ subscribeComposerDraftModelReconciliation,
28
+ subscribeDraftThreadPromotion,
29
+ useComposerDraftStore,
30
+} from "./composerDraftStore";
31
import { startDefaultThemeAdoption } from "./hooks/useDefaultTheme";
32
import { startEnvironmentThemeRepaint } from "./hooks/useEnvironmentTheme";
33
import {
@@ -42,6 +46,7 @@ import { startProviderAuthDelivery } from "./providerAuthDelivery";
46
import { getRouter, type AppRouter } from "./router";
47
import { appAtomRegistry } from "./rpc/atomRegistry";
48
import { primaryServerConfigAtom } from "./state/server";
49
+import { environmentShell } from "./state/shell";
50
import { installChatRouteCommands } from "./shortcuts/chatRouteCommands";
51
import { installCommandPaletteCommands } from "./shortcuts/commandPaletteCommands";
52
import { registerOpenFavoriteEditorCommand } from "./components/chat/OpenInPickerShortcut";
@@ -179,6 +184,12 @@ export function startAppServices(): AppRouter {
184
threadShellAtom: environmentThreadShells.quietThreadShellAtom,
185
threadRefsAtom: environmentThreadShells.threadRefsAtom,
186
});
187
+ subscribeComposerDraftModelReconciliation({
188
+ registry: appAtomRegistry,
189
+ threadShellAtom: environmentThreadShells.threadShellAtom,
190
+ threadRefsAtom: environmentThreadShells.threadRefsAtom,
191
+ shellStateAtom: environmentShell.stateAtom,
192
+ });
193
startMainAppLocationTracking(router);
194
startBackgroundThreadAnnouncements(appAtomRegistry, router);
195
startThreadVisitedMigration(appAtomRegistry);