feat(sidebar): pin chats within projects #3913
Closed12ya(GitHub profile, opens in a new tab)wants to merge 24 commits into
main fromrefs/pull/3913/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
- apps/web/src/components/Sidebar.tsx line 757Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -689,3 +714,4 @@689714 onDoubleClick={handleRowDoubleClick}690715 onKeyDown={handleRowKeyDown}691716 onContextMenu={handleRowContextMenu}717+ {...threadDrag.attributes}
- @@ -1025 +1205,20 @@1025- })}1205+ <SidebarMenuSub1206+ ref={attachThreadListAutoAnimateRef}1207+ className="mx-0.5 my-0 w-full translate-x-0 gap-0.5 overflow-hidden px-1 py-0 sm:mx-1 sm:px-1.5"1208+ >1209+ {shouldShowThreadPanel && showEmptyThreadState ? (1210+ <SidebarMenuSubItem className="w-full" data-thread-selection-safe>1211+ <div1212+ data-thread-selection-safe1213+ className="flex h-6 w-full translate-x-0 items-center px-2 text-left text-[10px] text-muted-foreground/60"1214+ >1215+ <span>No threads yet</span>1216+ </div>1217+ </SidebarMenuSubItem>1218+ ) : null}1219+ {shouldShowThreadPanel && renderedPinnedThreads.length > 0 && (1220+ <SidebarThreadSection attachAutoAnimateRef={attachThreadListAutoAnimateRef}>1221+ {renderedPinnedThreads.map(renderThreadRow)}1222+ </SidebarThreadSection>1223+ )}1224+ {shouldShowThreadPanel &&
- @@ -1025,0 +1212,21 @@1212+ data-thread-selection-safe1213+ className="flex h-6 w-full translate-x-0 items-center px-2 text-left text-[10px] text-muted-foreground/60"1214+ >1215+ <span>No threads yet</span>1216+ </div>1217+ </SidebarMenuSubItem>1218+ ) : null}1219+ {shouldShowThreadPanel && renderedPinnedThreads.length > 0 && (1220+ <SidebarThreadSection attachAutoAnimateRef={attachThreadListAutoAnimateRef}>1221+ {renderedPinnedThreads.map(renderThreadRow)}1222+ </SidebarThreadSection>1223+ )}1224+ {shouldShowThreadPanel &&1225+ renderedPinnedThreads.length > 0 &&1226+ renderedRegularThreads.length > 0 && (1227+ <SidebarPinnedDivider nodeRef={setDividerElement} flow={dragFlow} />1228+ )}1229+ {shouldShowThreadPanel && renderedRegularThreads.length > 0 && (1230+ <SidebarThreadSection attachAutoAnimateRef={attachThreadListAutoAnimateRef}>1231+ {renderedRegularThreads.map(renderThreadRow)}1232+ </SidebarThreadSection>@@ -1277,4 +1498,4 @@12771498 projectStatus,12781499 visibleProjectThreads,12791500 };1280- }, [projectThreads, threadLastVisitedAts, threadSortOrder]);1501+ }, [pinnedThreadKeys, projectThreads, threadLastVisitedAts, threadSortOrder]);@@ -471,6 +488,7 @@471488 const isConfirmingArchive = confirmingArchiveThreadKey === threadKey && !isThreadRunning;472489 const threadMetaClassName = isConfirmingArchive473490 ? "pointer-events-none opacity-0"474- : !isThreadRunning475- ? "pointer-events-none transition-opacity duration-150 max-sm:pr-6 group-hover/menu-sub-item:opacity-0 group-focus-within/menu-sub-item:opacity-0"476- : "pointer-events-none";491+ : `pointer-events-none transition-opacity duration-150 ${showRowActions ? "opacity-0" : ""}`;492+ const rowActionVisibilityClass = showRowActions493+ ? "pointer-events-auto opacity-100"494+ : "pointer-events-none opacity-0";
- apps/web/src/components/Sidebar.tsx line 1230OutdatedResolvedby 12ya(GitHub profile, opens in a new tab)@@ -1025,0 +1210,21 @@1210+ {shouldShowThreadPanel && showEmptyThreadState ? (1211+ <SidebarMenuSubItem className="w-full" data-thread-selection-safe>1212+ <div1213+ data-thread-selection-safe1214+ className="flex h-6 w-full translate-x-0 items-center px-2 text-left text-[10px] text-muted-foreground/60"1215+ >1216+ <span>No threads yet</span>1217+ </div>1218+ </SidebarMenuSubItem>1219+ ) : null}1220+ {shouldShowThreadPanel && renderedPinnedThreads.length > 0 && (1221+ <SidebarThreadSection attachAutoAnimateRef={attachThreadListAutoAnimateRef}>1222+ {renderedPinnedThreads.map(renderThreadRow)}1223+ </SidebarThreadSection>1224+ )}1225+ {shouldShowThreadPanel &&1226+ shouldShowPinnedThreadDivider({1227+ isDragging: isThreadDragActive,1228+ pinnedCount: renderedPinnedThreads.length,1229+ regularCount: renderedRegularThreads.length,1230+ }) && <SidebarPinnedDivider nodeRef={setDividerElement} flow={dragFlow} />}
- apps/web/src/components/Sidebar.tsx line 1604Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1330,7 +1574,11 @@13301574 : visibleProjectThreads.filter((thread) =>13311575 visibleThreadKeys.has(scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id))),13321576 );1333- const hiddenThreads = visibleProjectThreads.filter(1334- (thread) =>1335- !visibleThreadKeys.has(scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id))),1336- );1577+ const hiddenThreads = pinnedCollapsedThread1578+ ? visibleProjectThreads.filter(1579+ (thread) =>1580+ !visibleThreadKeys.has(1581+ scopedThreadKey(scopeThreadRef(thread.environmentId, thread.id)),1582+ ),1583+ )1584+ : threadPreview.hiddenThreads;apps/web/src/components/Sidebar.tsx line 1049OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -935 +1029,21 @@93510291030+function SidebarPinnedDivider({1031+ nodeRef,1032+ flow,1033+ overlaysThreadList = false,1034+}: {1035+ nodeRef: (node: HTMLLIElement | null) => void;1036+ flow: ThreadPinDropAction | null;1037+ overlaysThreadList?: boolean;1038+}) {1039+ const colorClass =1040+ flow === "pin"1041+ ? "text-amber-400 before:bg-amber-400/75 after:bg-amber-400/75"1042+ : flow === "unpin"1043+ ? "text-rose-500 before:bg-rose-500/75 after:bg-rose-500/75"1044+ : "text-muted-foreground/45 before:bg-border/80 after:bg-border/80";1045+ return (1046+ <SidebarMenuSubItem1047+ ref={nodeRef}1048+ aria-hidden="true"1049+ className={`flex h-3 w-full items-center gap-1.5 px-2 transition-colors before:h-px before:flex-1 after:h-px after:flex-1 ${overlaysThreadList ? "absolute inset-x-0 z-10" : ""} ${colorClass}`}apps/web/src/components/Sidebar.logic.ts line 546Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -481,9 +535,11 @@481535 };482536 }483537484- const visibleThreadIds = new Set([...previewThreads, activeThread].map((thread) => thread.id));538+ const visibleThreadIds = new Set(539+ [...previewThreads, activeThread].map((thread) => getThreadId(thread)),540+ );485541486542 return {487543 hasHiddenThreads: true,488- hiddenThreads: threads.filter((thread) => !visibleThreadIds.has(thread.id)),489- visibleThreads: threads.filter((thread) => visibleThreadIds.has(thread.id)),544+ hiddenThreads: threads.filter((thread) => !visibleThreadIds.has(getThreadId(thread))),545+ visibleThreads: threads.filter((thread) => visibleThreadIds.has(getThreadId(thread))),
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XXL
- apps/desktop/src/app/DesktopEnvironment.ts line 160Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -156,5 +156,5 @@156156 });157157 const displayName = branding.displayName;158158 const stateDir = path.join(baseDir, isDevelopment ? "dev" : "userdata");159- const userDataDirName = isDevelopment ? "t3code-dev" : "t3code";160- const legacyUserDataDirName = isDevelopment ? "T3 Code (Dev)" : "T3 Code (Alpha)";159+ const userDataDirName = isDevelopment ? "v12-dev" : "v12";160+ const legacyUserDataDirName = isDevelopment ? "V12 (Dev)" : "V12 (Alpha)";@@ -147,4 +147,4 @@147147 : input.platform === "darwin"148148 ? path.join(homeDirectory, "Library", "Application Support")149149 : Option.getOrElse(config.xdgConfigHome, () => path.join(homeDirectory, ".config"));150- const baseDir = Option.getOrElse(config.t3Home, () => path.join(homeDirectory, ".t3"));150+ const baseDir = Option.getOrElse(config.v12Home, () => path.join(homeDirectory, ".v12"));
- @@ -262,0 +291,21 @@291+ return yield* new OrchestrationCommandInvariantError({292+ commandType: command.type,293+ detail: `Message '${command.throughMessageId}' does not exist on thread '${command.sourceThreadId}'.`,294+ });295+ }296+ const throughMessage = sourceThread.messages[throughMessageIndex];297+ if (!throughMessage || throughMessage.streaming) {298+ return yield* new OrchestrationCommandInvariantError({299+ commandType: command.type,300+ detail: `Message '${command.throughMessageId}' is still streaming and cannot be used as a fork point.`,301+ });302+ }303+304+ const includedMessages = sourceThread.messages.slice(0, throughMessageIndex + 1);305+ const messageIdBySourceId = new Map<string, MessageId>();306+ for (const message of includedMessages) {307+ messageIdBySourceId.set(message.id, yield* randomMessageId);308+ }309+ const cutoff = throughMessage.updatedAt;310+ const includedPlans = sourceThread.proposedPlans.filter((plan) => plan.createdAt <= cutoff);311+ const includedCheckpoints = sourceThread.checkpoints.filter(
- @@ -3856,0 +4009,21 @@4009+ useTaskHudStore.getState().copyContextTasksToFork({4010+ sourceThreadKey: scopedThreadKey(routeThreadRef),4011+ targetThreadKey: scopedThreadKey(recoveryThreadRef),4012+ sourceThreadId: historyThread.id,4013+ targetThreadId: recoveryThreadId,4014+ messageIdBySourceId: buildForkMessageIdMap(4015+ historyThread.messages,4016+ recoveryThread.messages,4017+ ),4018+ });4019+4020+ const revertResult = await revertThreadCheckpoint({4021+ environmentId,4022+ input: {4023+ threadId: activeThread.id,4024+ turnCount,4025+ },4026+ });4027+ if (revertResult._tag === "Failure") {4028+ throw squashAtomCommandFailure(revertResult);4029+ }@@ -3857,3 +4027,20 @@4027+ if (revertResult._tag === "Failure") {4028+ throw squashAtomCommandFailure(revertResult);4029+ }4030+4031+ clearComposerDraftContent(routeThreadRef);4032+ setComposerDraftPrompt(routeThreadRef, message.text);4033+ addComposerDraftImages(routeThreadRef, restoredImages);4034+ restoredToComposer = true;4035+ composerRef.current?.resetCursorState({4036+ cursor: message.text.length,4037+ prompt: message.text,4038+ });4039+ composerRef.current?.focusAtEnd();4040+ } catch (error) {4041+ if (!restoredToComposer) {4042+ for (const image of restoredImages) revokeBlobPreviewUrl(image.previewUrl);4043+ }38574044 setThreadError(38584045 activeThread.id,3859- error instanceof Error ? error.message : "Failed to revert thread state.",4046+ error instanceof Error ? error.message : "Failed to prepare this request for rerun.",@@ -262,0 +360,21 @@360+ createdAt: message.createdAt,361+ updatedAt: message.updatedAt,362+ },363+ });364+ }365+366+ const planEvents: PlannedOrchestrationEvent[] = [];367+ for (const proposedPlan of includedPlans) {368+ planEvents.push({369+ ...(yield* withEventBase({370+ aggregateKind: "thread",371+ aggregateId: command.threadId,372+ occurredAt: command.createdAt,373+ commandId: command.commandId,374+ })),375+ type: "thread.proposed-plan-upserted",376+ payload: {377+ threadId: command.threadId,378+ proposedPlan,379+ },380+ });
- @@ -0,0 +196,21 @@196+ case "running":197+ return <LoaderCircleIcon className="size-3.5 animate-spin text-sky-500" aria-hidden />;198+ case "waiting_for_approval":199+ return <Clock3Icon className="size-3.5 text-amber-500" aria-hidden />;200+ case "waiting_for_input":201+ return <MessageCircleQuestionIcon className="size-3.5 text-indigo-500" aria-hidden />;202+ case "failed":203+ return <CircleAlertIcon className="size-3.5 text-destructive" aria-hidden />;204+ case "complete":205+ return <CheckCircle2Icon className="size-3.5 text-emerald-500" aria-hidden />;206+ }207+}208+209+export const OpenThreadActivityStatus = memo(function OpenThreadActivityStatus({210+ status,211+ variant = "pill",212+}: {213+ readonly status: OpenThreadActivityPresentation | null;214+ readonly variant?: "pill" | "toolbar";215+}) {216+ const [nowMs, setNowMs] = useState(() => Date.now());@@ -782,7 +797,15 @@782797 previous: DerivedWorkLogEntry,783798 next: DerivedWorkLogEntry,784799 ): boolean {785- if (previous.activityKind !== "tool.updated" && previous.activityKind !== "tool.completed") {800+ if (801+ previous.activityKind !== "tool.started" &&802+ previous.activityKind !== "tool.updated" &&803+ previous.activityKind !== "tool.completed"804+ ) {786805 return false;787806 }788- if (next.activityKind !== "tool.updated" && next.activityKind !== "tool.completed") {807+ if (808+ next.activityKind !== "tool.started" &&809+ next.activityKind !== "tool.updated" &&810+ next.activityKind !== "tool.completed"811+ ) {@@ -0,0 +70,21 @@70+ input: DeriveOpenThreadActivityInput,71+): OpenThreadActivityPresentation | null {72+ const activeTurnId = input.session?.activeTurnId ?? input.latestTurn?.turnId ?? null;73+ const latestActivity = latestUsefulActivity(input.activities, activeTurnId);74+ const base = {75+ latestActivity,76+ };77+78+ // A settled server snapshot is authoritative. Local dispatch flags, stale79+ // pending activities, and a lagging latest turn must not resurrect work after80+ // a reconnect confirms that the session has stopped.81+ if (input.session?.status === "error") {82+ return {83+ ...base,84+ phase: "failed",85+ label: "Failed",86+ startedAt: input.latestTurn?.startedAt ?? input.latestTurn?.requestedAt ?? null,87+ endedAt: input.latestTurn?.completedAt ?? input.session.updatedAt,88+ };89+ }90+ if (input.session?.status === "ready" || input.session?.status === "idle") {@@ -0,0 +42,21 @@42+43+function latestUsefulActivity(44+ activities: ReadonlyArray<OrchestrationThreadActivity>,45+ turnId: string | null,46+): string | null {47+ let latest: OrchestrationThreadActivity | null = null;48+ for (const activity of activities) {49+ if (turnId !== null && activity.turnId !== null && activity.turnId !== turnId) {50+ continue;51+ }52+ if (53+ latest === null ||54+ activity.createdAt > latest.createdAt ||55+ (activity.createdAt === latest.createdAt &&56+ (activity.sequence ?? -1) > (latest.sequence ?? -1))57+ ) {58+ latest = activity;59+ }60+ }61+ return latest?.summary ?? null;62+}@@ -1015,4 +1057,21 @@1057+ ) : null}10151058 </>10161059 );10171060 }101810611062+function useMessageTaskSelection() {1063+ const selectionContainerRef = useRef<HTMLDivElement>(null);1064+ const [selectedQuote, setSelectedQuote] = useState<string | null>(null);1065+ const [selectionAnchorRect, setSelectionAnchorRect] = useState<SelectionAnchorRect | null>(null);1066+ const selectionTimerRef = useRef<number | null>(null);1067+ const captureSelection = useCallback(() => {1068+ if (selectionTimerRef.current !== null) window.clearTimeout(selectionTimerRef.current);1069+ selectionTimerRef.current = window.setTimeout(() => {1070+ selectionTimerRef.current = null;1071+ const container = selectionContainerRef.current;1072+ if (!container) return;1073+ const selection = readSelectionWithin(container);1074+ if (selection) {1075+ setSelectedQuote(selection.quote);1076+ setSelectionAnchorRect(selection.anchorRect);1077+ }@@ -0,0 +1,19 @@1+import type { OrchestrationMessage } from "@v12/contracts";2+3+const ROLE_LABELS = {4+ user: "User",5+ assistant: "Assistant",6+ system: "System",7+} as const;8+9+/**10+ * Rehydrates a fork in a fresh provider session without changing the message11+ * stored or rendered by V12. Provider-native sessions are not shared between12+ * branches, so the copied transcript is supplied as context on the first turn.13+ */14+export function buildForkContinuationInput(input: {15+ readonly history: ReadonlyArray<OrchestrationMessage>;16+ readonly nextRequest: string;17+}): string {18+ const transcript = input.history19+ .map((message) => `${ROLE_LABELS[message.role]}:\n${message.text}`)@@ -1851,0 +2117,21 @@2117+ }2118+ if (workEntry.itemType === "web_search") return "web";2119+ return "other";2120+}2121+2122+function workEntryCategoryClass(workEntry: TimelineWorkEntry): string {2123+ switch (workEntryCategory(workEntry)) {2124+ case "command":2125+ return "border-s-sky-500/45 bg-sky-500/[0.025]";2126+ case "file-read":2127+ return "border-s-cyan-500/45 bg-cyan-500/[0.025]";2128+ case "file-change":2129+ return "border-s-amber-500/45 bg-amber-500/[0.025]";2130+ case "web":2131+ return "border-s-indigo-500/45 bg-indigo-500/[0.025]";2132+ case "other":2133+ return "border-s-border/50";2134+ }2135+}2136+2137+function workEntryStatusLabel(workEntry: TimelineWorkEntry): string | null {
- @@ -316,15 +316,15 @@316- T3CODE_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}317- T3CODE_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}318- T3CODE_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}319- T3CODE_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}316+ V12_CLERK_PUBLISHABLE_KEY: ${{ needs.relay_public_config.outputs.clerk_publishable_key }}317+ V12_CLERK_JWT_TEMPLATE: ${{ needs.relay_public_config.outputs.clerk_jwt_template }}318+ V12_CLERK_CLI_OAUTH_CLIENT_ID: ${{ needs.relay_public_config.outputs.clerk_cli_oauth_client_id }}319+ V12_RELAY_URL: ${{ needs.relay_public_config.outputs.relay_url }}320320 strategy:321321 fail-fast: false322322 matrix:323323 include:324324 - label: macOS arm64325- runner: blacksmith-12vcpu-macos-26325+ runner: macos-15326326 platform: mac327327 target: dmg328328 arch: arm64329329 - label: macOS x64330- runner: blacksmith-12vcpu-macos-26330+ runner: macos-15
12ya(GitHub profile, opens in a new tab) closed this
- @@ -146,18 +57,8 @@146- setLogicalProjectDraftThreadId(logicalProjectKey, projectRef, currentRouteTarget.draftId, {147- threadId: latestActiveDraftThread.threadId,148- createdAt: latestActiveDraftThread.createdAt,149- runtimeMode: latestActiveDraftThread.runtimeMode,150- interactionMode: latestActiveDraftThread.interactionMode,151- ...(hasBranchOption ? { branch: options?.branch ?? null } : {}),152- ...(hasWorktreePathOption ? { worktreePath: options?.worktreePath ?? null } : {}),153- ...(hasEnvModeOption ? { envMode: options?.envMode } : {}),154- ...(hasStartFromOriginOption ? { startFromOrigin: options?.startFromOrigin } : {}),155- });156- return Promise.resolve();157- }158-15957 const draftId = newDraftId();16058 const threadId = newThreadId();16159 const createdAt = new Date().toISOString();16260 const initialEnvMode = options?.envMode ?? environmentSettings.defaultThreadEnvMode;16361 return (async () => {62+ if (currentRouteTarget?.kind === "draft") {63+ await materializeDraftThread(currentRouteTarget.draftId);64+ }@@ -0,0 +59,21 @@59+60+ const materialization = (async () => {61+ const trimmedPrompt = composerDraft?.prompt.trim() ?? "";62+ const result = await createThread({63+ environmentId: draftSession.environmentId,64+ input: {65+ threadId: draftSession.threadId,66+ projectId: draftSession.projectId,67+ title: trimmedPrompt.length > 0 ? truncate(trimmedPrompt) : "Draft",68+ modelSelection: resolveDraftModelSelection(draftId),69+ runtimeMode: draftSession.runtimeMode,70+ interactionMode: draftSession.interactionMode,71+ branch: draftSession.branch,72+ worktreePath: draftSession.worktreePath,73+ createdAt: draftSession.createdAt,74+ },75+ });76+ if (result._tag === "Failure") {77+ throw squashAtomCommandFailure(result);78+ }79+ useComposerDraftStore.getState().markDraftThreadPromoting(draftId, threadRef);@@ -682,3 +682,8 @@682682 );683683 }684684685+/** Whether the composer contains user-authored content worth materializing as a thread. */686+export function hasComposerDraftUserContent(draft: ComposerThreadDraftState | null): boolean {687+ return Boolean(688+ draft &&689+ (draft.prompt.length > 0 ||
- @@ -0,0 +54,21 @@54+ const threadKey = scopedThreadKey(threadRef);55+ const existing = materializationsInFlight.get(threadKey);56+ if (existing) {57+ return existing;58+ }59+60+ const materialization = (async () => {61+ const trimmedPrompt = composerDraft?.prompt.trim() ?? "";62+ const result = await createThread({63+ environmentId: draftSession.environmentId,64+ input: {65+ threadId: draftSession.threadId,66+ projectId: draftSession.projectId,67+ title: trimmedPrompt.length > 0 ? truncate(trimmedPrompt) : "Draft",68+ modelSelection: resolveDraftModelSelection(draftId),69+ runtimeMode: draftSession.runtimeMode,70+ interactionMode: draftSession.interactionMode,71+ branch: draftSession.branch,72+ worktreePath: draftSession.worktreePath,73+ createdAt: draftSession.createdAt,74+ },@@ -0,0 +47,21 @@47+ const draftSession = store.getDraftSession(draftId);48+ const composerDraft = store.getComposerDraft(draftId);49+ if (!draftSession || draftSession.promotedTo || !hasComposerDraftUserContent(composerDraft)) {50+ return false;51+ }52+53+ const threadRef = scopeThreadRef(draftSession.environmentId, draftSession.threadId);54+ const threadKey = scopedThreadKey(threadRef);55+ const existing = materializationsInFlight.get(threadKey);56+ if (existing) {57+ return existing;58+ }59+60+ const materialization = (async () => {61+ const trimmedPrompt = composerDraft?.prompt.trim() ?? "";62+ const result = await createThread({63+ environmentId: draftSession.environmentId,64+ input: {65+ threadId: draftSession.threadId,66+ projectId: draftSession.projectId,67+ title: trimmedPrompt.length > 0 ? truncate(trimmedPrompt) : "Draft",@@ -0,0 +60,21 @@60+ const materialization = (async () => {61+ const trimmedPrompt = composerDraft?.prompt.trim() ?? "";62+ const result = await createThread({63+ environmentId: draftSession.environmentId,64+ input: {65+ threadId: draftSession.threadId,66+ projectId: draftSession.projectId,67+ title: trimmedPrompt.length > 0 ? truncate(trimmedPrompt) : "Draft",68+ modelSelection: resolveDraftModelSelection(draftId),69+ runtimeMode: draftSession.runtimeMode,70+ interactionMode: draftSession.interactionMode,71+ branch: draftSession.branch,72+ worktreePath: draftSession.worktreePath,73+ createdAt: draftSession.createdAt,74+ },75+ });76+ if (result._tag === "Failure") {77+ throw squashAtomCommandFailure(result);78+ }79+ useComposerDraftStore.getState().markDraftThreadPromoting(draftId, threadRef);80+ return true;@@ -146,18 +57,8 @@146- setLogicalProjectDraftThreadId(logicalProjectKey, projectRef, currentRouteTarget.draftId, {147- threadId: latestActiveDraftThread.threadId,148- createdAt: latestActiveDraftThread.createdAt,149- runtimeMode: latestActiveDraftThread.runtimeMode,150- interactionMode: latestActiveDraftThread.interactionMode,151- ...(hasBranchOption ? { branch: options?.branch ?? null } : {}),152- ...(hasWorktreePathOption ? { worktreePath: options?.worktreePath ?? null } : {}),153- ...(hasEnvModeOption ? { envMode: options?.envMode } : {}),154- ...(hasStartFromOriginOption ? { startFromOrigin: options?.startFromOrigin } : {}),155- });156- return Promise.resolve();157- }158-15957 const draftId = newDraftId();16058 const threadId = newThreadId();16159 const createdAt = new Date().toISOString();16260 const initialEnvMode = options?.envMode ?? environmentSettings.defaultThreadEnvMode;16361 return (async () => {62+ if (currentRouteTarget?.kind === "draft") {63+ await materializeDraftThread(currentRouteTarget.draftId);64+ }
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
c47995d4-f6d9-49d1-931d-e68f5d27a2a9You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share