fix(clients): a steer splits the settled work fold #15421
ClosedGigioxx(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/15421/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/mobile/src/lib/threadActivity.ts line 1095Resolvedby Gigioxx(GitHub profile, opens in a new tab)@@ -1068,12 +1083,6 @@10681083 .map((entry) => entry.id),10691084 );10701085 const firstEntry = group.entries[0];1071- const firstHiddenEntry = group.entries.find((entry) => hiddenEntryIds.has(entry.id));10721086 const lastEntry = group.entries.at(-1);1073- if (!firstHiddenEntry || !firstEntry || !lastEntry) continue;1074- const hidesNonCompactionWork = group.entries.some(1075- (entry) =>1076- hiddenEntryIds.has(entry.id) &&1077- !(entry.type === "activity-group" && isContextCompactionActivityGroup(entry)),1078- );1079- if (!hidesNonCompactionWork) continue;1087+ if (!firstEntry || !lastEntry) continue;1088+ const sections = [{ startIndex: 0, startBoundary: group.startBoundary }, ...group.segments]apps/mobile/src/features/threads/ThreadFeed.tsx line 2175Resolvedby Gigioxx(GitHub profile, opens in a new tab)@@ -2168,4 +2168,4 @@21682168 readonly copiedRowId: string | null;21692169 readonly expandedWorkGroups: Record<string, boolean>;21702170 readonly expandedWorkRows: Record<string, boolean>;2171- readonly expandedTurnIds: ReadonlySet<RunId>;2171+ readonly expandedTurnIds: ReadonlySet<string>;apps/web/src/components/chat/MessagesTimeline.logic.ts line 950OutdatedResolvedby Gigioxx(GitHub profile, opens in a new tab)@@ -931,7 +942,9 @@931942 // to its own first entry.932943 startBoundary: pendingBoundary?.createdAt ?? null,933944 anchorEntryId: pendingBoundary?.anchorEntryId ?? entry.id,945+ segments: [],934946 };935947 pendingBoundary = null;936948 groupsByRunId.set(runId, group);937949 }950+ if (pendingSteer) {apps/web/src/components/chat/MessagesTimeline.logic.ts line 1452OutdatedResolvedby Gigioxx(GitHub profile, opens in a new tab)@@ -1400,8 +1444,9 @@14001444 if (turnFold) {14011445 nextRows.push({14021446 kind: "turn-fold",1403- id: `turn-fold:${turnFold.runId}`,1447+ id: `turn-fold:${turnFold.expandKey}`,14041448 createdAt: turnFold.createdAt,14051449 runId: turnFold.runId,1450+ expandKey: turnFold.expandKey,14061451 label: turnFold.label,1407- expanded: input.expandedRunIds?.has(turnFold.runId) ?? false,1452+ expanded: input.expandedRunIds?.has(turnFold.expandKey) ?? false,apps/mobile/src/lib/threadActivity.ts lines 1009 to 1009OutdatedResolvedby Gigioxx(GitHub profile, opens in a new tab)@@ -987,13 +990,20 @@987990 const failedRunIds = failedFeedRunIds(feed, latestRun);988991 const groupsByRunId = new Map<989992 RunId,990- { entries: ThreadFeedEntry[]; startBoundary: string | null }993+ {994+ entries: ThreadFeedEntry[];995+ startBoundary: string | null;996+ /** A steer splits the settled fold so work stays under the message it answered. */997+ segments: Array<{ startIndex: number; startBoundary: string }>;998+ }991999 >();9921000 // Fold state is keyed by run, so each runless prompt lends its response a9931001 // stable key of its own. Decide per prompt, not per thread: a V1 thread's9941002 // first V2 run must not unfold every imported turn above it.9951003 let runlessKey: RunId | null = null;9961004 let pendingUserBoundary: string | null = null;1005+ let pendingSteer: string | null = null;9971006 for (const entry of feed) {9981007 if (entry.type === "message" && entry.message.role === "user") {9991008 pendingUserBoundary = entry.message.createdAt;1009+ pendingSteer = entry.message.createdAt;
- apps/web/src/components/chat/MessagesTimeline.tsx lines 666 to 673OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -663,11 +663,11 @@663663 }, []);664664665665 const onToggleTurnFold = useCallback(666- (runId: RunId) => {667- suspendEndScrollMaintenanceForDisclosure(`turn-fold:${runId}`);666+ (expandKey: string) => {667+ suspendEndScrollMaintenanceForDisclosure(`turn-fold:${expandKey}`);668668 setExpandedRunIds((existing) => {669669 const next = new Set(existing);670- if (next.has(runId)) {671- next.delete(runId);670+ if (next.has(expandKey)) {671+ next.delete(expandKey);672672 } else {673- next.add(runId);673+ next.add(expandKey);
maria-rcks closed this
Sign in to join this conversation.



macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed