fix(chat): smooth worktree setup status #8922
Mergedjuliusmarmingemerged 3 commits into
main fromrefs/pull/8922/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -110,10 +110,16 @@110110111111 export function resolveDraftPromotionNavigationTarget(input: {112112 serverThreadRef: ScopedThreadRef | null;113- serverThreadStarted: boolean;113+ serverThread: Pick<Thread, "latestTurn" | "session"> | null | undefined;114114 backgroundSubmissionPending: boolean;115115 }): ScopedThreadRef | null {116116 if (input.backgroundSubmissionPending) {117117 return null;118118 }119- return input.serverThreadStarted ? input.serverThreadRef : null;119+ const sessionStatus = input.serverThread?.session?.status;120+ const turnStarted = input.serverThread?.latestTurn?.startedAt != null;121+ const startupStopped =122+ sessionStatus === "error" || sessionStatus === "stopped" || sessionStatus === "interrupted";123+ // Keep local preparation feedback mounted until the server can render the124+ // running turn or its startup error on the canonical thread route.125+ return turnStarted || startupStopped ? input.serverThreadRef : null;
- apps/web/src/components/chat/MessagesTimeline.tsx lines 1341 to 1341OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1323,12 +1333,9 @@1323- <div className="border-b border-border/60 pb-2 pt-1">1324- <div className="flex min-w-0 items-baseline px-1 text-sm leading-relaxed text-muted-foreground tabular-nums">1325- <span className="shrink-0 whitespace-nowrap">1326- {row.createdAt ? (1327- <>1328- Working for <WorkingTimer createdAt={row.createdAt} />1329- </>1330- ) : (1331- "Working..."1332- )}1333- </span>1334- </div>1333+ <div className="border-b border-border/60 pb-2 pt-1">1334+ <div className="flex h-6 min-w-0 items-baseline px-1 text-sm leading-relaxed text-muted-foreground tabular-nums">1335+ <span1336+ key={isPreparingWorktree ? "setup" : "working"}1337+ className="relative shrink-0 overflow-hidden whitespace-nowrap transition-opacity duration-150 starting:opacity-0 motion-reduce:transition-none"1338+ >1339+ {isPreparingWorktree ? (1340+ <>1341+ Setting up worktree…apps/web/src/components/chat/MessagesTimeline.tsx lines 1342 to 1351OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1333,2 +1333,19 @@1333- </span>1334- </div>1333+ <div className="border-b border-border/60 pb-2 pt-1">1334+ <div className="flex h-6 min-w-0 items-baseline px-1 text-sm leading-relaxed text-muted-foreground tabular-nums">1335+ <span1336+ key={isPreparingWorktree ? "setup" : "working"}1337+ className="relative shrink-0 overflow-hidden whitespace-nowrap transition-opacity duration-150 starting:opacity-0 motion-reduce:transition-none"1338+ >1339+ {isPreparingWorktree ? (1340+ <>1341+ Setting up worktree…1342+ <span1343+ aria-hidden1344+ className="live-activity-focus pointer-events-none absolute inset-y-0 select-none"1345+ >1346+ <span className="live-activity-focus-counter block">1347+ <span className="live-activity-focus-aligned block text-foreground">1348+ Setting up worktree…1349+ </span>1350+ </span>1351+ </span>apps/web/src/components/chat/MessagesTimeline.logic.ts lines 979 to 979OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -996,6 +976,4 @@996976997977 switch (a.kind) {998978 case "working":999- return (1000- a.createdAt === (b as typeof a).createdAt && a.showThinking === (b as typeof a).showThinking1001- );979+ return a.createdAt === (b as typeof a).createdAt;
juliusmarminge merged thisef84bc9
juliusmarminge closed this
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 Plus
Run ID:
20769c12-fd52-4451-b0a4-c95043d4049eYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Warning
Your free Security trial is over. An organization admin can activate Security or dismiss this notice.
Comment `@coderabbitai help` to get the list of available commands.