@devries-cameron20 / t3code Mirror · read-only / commits / 581aa7279f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 25, 16:00 UTC

Require bootstrap IDs for root thread auto-navigation

- Remove snapshot fallback lookup for missing bootstrap project/thread IDs - Only expand project and navigate when server payload includes both IDs

Julius Marminge committed Feb 26, 2026 at 20:48 UTC 581aa7279f41c02b38f28a4cb05b184f0637e592
1 file changed +5 -30
apps/web/src/routes/__root.tsx
+5 -30
@@ -198,52 +198,27 @@ function EventRouter() {
198 return;
199 }
200
201 - const fallbackSnapshot =
202 - payload.bootstrapProjectId && payload.bootstrapThreadId
203 - ? null
204 - : await api.orchestration.getSnapshot().catch(() => null);
205 - if (disposed) {
206 - return;
207 - }
208 -
209 - const bootstrapProjectId =
210 - payload.bootstrapProjectId ??
211 - fallbackSnapshot?.projects.find(
212 - (project) => project.workspaceRoot === payload.cwd && project.deletedAt === null,
213 - )?.id;
214 - if (!bootstrapProjectId) {
201 + if (!payload.bootstrapProjectId || !payload.bootstrapThreadId) {
202 return;
203 }
204 dispatch({
205 type: "SET_PROJECT_EXPANDED",
219 - projectId: bootstrapProjectId,
206 + projectId: payload.bootstrapProjectId,
207 expanded: true,
208 });
209
223 - const bootstrapThreadId =
224 - payload.bootstrapThreadId ??
225 - fallbackSnapshot?.threads
226 - .filter((thread) => thread.projectId === bootstrapProjectId && thread.deletedAt === null)
227 - .toSorted((a, b) => {
228 - const byDate = new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
229 - if (byDate !== 0) return byDate;
230 - return b.id.localeCompare(a.id);
231 - })[0]?.id;
232 - if (!bootstrapThreadId) {
233 - return;
234 - }
210 if (pathnameRef.current !== "/") {
211 return;
212 }
238 - if (handledBootstrapThreadIdRef.current === bootstrapThreadId) {
213 + if (handledBootstrapThreadIdRef.current === payload.bootstrapThreadId) {
214 return;
215 }
216 await navigate({
217 to: "/$threadId",
243 - params: { threadId: bootstrapThreadId },
218 + params: { threadId: payload.bootstrapThreadId },
219 replace: true,
220 });
246 - handledBootstrapThreadIdRef.current = bootstrapThreadId;
221 + handledBootstrapThreadIdRef.current = payload.bootstrapThreadId;
222 })().catch(() => undefined);
223 });
224 const unsubServerConfigUpdated = onServerConfigUpdated((payload) => {