The best way to control Claude Code, Codex and more from any computer or phone
Fix sidebar highlighting for draft threads (#4679)
Julius Marminge committed
Jul 27, 2026 at 22:48 UTC
6a3df51707b67c3435f86b3b83a093aec8b03415
1 file changed
+12
-2
apps/web/src/components/SidebarV2.tsx
+12
-2
@@ -96,7 +96,11 @@ import { threadEnvironment } from "../state/threads";
96
import { projectEnvironment } from "../state/projects";
97
import { useEnvironmentQuery } from "../state/query";
98
import { useAtomCommand } from "../state/use-atom-command";
99
-import { buildThreadRouteParams, resolveThreadRouteTarget } from "../threadRoutes";
99
+import {
100
+ buildThreadRouteParams,
101
+ resolveActiveThreadRouteRef,
102
+ resolveThreadRouteTarget,
103
+} from "../threadRoutes";
104
import { formatRelativeTimeLabel, parseTimestampDate } from "../timestampFormat";
105
import type { SidebarThreadSummary } from "../types";
106
import { cn } from "~/lib/utils";
@@ -1052,7 +1056,13 @@ export default function SidebarV2() {
1056
strict: false,
1057
select: (params) => resolveThreadRouteTarget(params),
1058
});
1055
- const routeThreadRef = routeTarget?.kind === "server" ? routeTarget.threadRef : null;
1059
+ const routeDraftThread = useComposerDraftStore((store) =>
1060
+ routeTarget?.kind === "draft" ? store.getDraftSession(routeTarget.draftId) : null,
1061
+ );
1062
+ const routeThreadRef = useMemo(
1063
+ () => resolveActiveThreadRouteRef(routeTarget, routeDraftThread),
1064
+ [routeDraftThread, routeTarget],
1065
+ );
1066
const routeThreadKey = routeThreadRef ? scopedThreadKey(routeThreadRef) : null;
1067
const routeTargetRef = useRef(routeTarget);
1068
routeTargetRef.current = routeTarget;