Skip to content

Commit c0c307e

Browse files
maria-rcksclaude
andcommitted
fix(chat): keep a thought-only turn out of the work fold
Folding thinking with the work was right for a turn that ran tools and wrong for one that did not: a question answered by thought alone collapsed to "Worked for 12s" hiding a single "Thought for 12s". Thinking now follows the rule compaction rows already use — it joins a fold that hides real work, and never creates one on its own. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 parent 6e1ca46 commit c0c307e

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎apps/mobile/src/lib/threadActivity.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,13 +1706,16 @@ function deriveThreadFeedTurnFolds(
17061706
continue;
17071707
}
17081708
// A lone compaction row stays visible on its own; it only folds away as
1709-
// part of a turn that already folds other work.
1710-
const hidesNonCompactionWork = entries.some(
1709+
// part of a turn that already folds other work. Thinking is the same: a
1710+
// question answered by thought alone keeps its "Thought for ..." row
1711+
// rather than collapsing behind a "Worked for ..." that hides nothing else.
1712+
const hidesFoldableWork = entries.some(
17111713
(entry) =>
17121714
hiddenEntryIds.has(entry.id) &&
1713-
!(entry.type === "activity-group" && isContextCompactionActivityGroup(entry)),
1715+
!(entry.type === "activity-group" && isContextCompactionActivityGroup(entry)) &&
1716+
!(entry.type === "message" && entry.message.role === "reasoning"),
17141717
);
1715-
if (!hidesNonCompactionWork) {
1718+
if (!hidesFoldableWork) {
17161719
continue;
17171720
}
17181721

‎apps/web/src/components/chat/MessagesTimeline.logic.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,13 +688,16 @@ function deriveTurnFolds(input: {
688688
continue;
689689
}
690690
// A lone compaction row stays visible on its own; it only folds away as
691-
// part of a turn that already folds other work.
692-
const hidesNonCompactionWork = group.entries.some(
691+
// part of a turn that already folds other work. Thinking is the same: a
692+
// question answered by thought alone keeps its "Thought for ..." row
693+
// rather than collapsing behind a "Worked for ..." that hides nothing else.
694+
const hidesFoldableWork = group.entries.some(
693695
(entry) =>
694696
hiddenEntryIds.has(entry.id) &&
695-
!(entry.kind === "work" && entry.entry.sourceActivityKind === "context-compaction"),
697+
!(entry.kind === "work" && entry.entry.sourceActivityKind === "context-compaction") &&
698+
!(entry.kind === "message" && entry.message.role === "reasoning"),
696699
);
697-
if (!hidesNonCompactionWork) {
700+
if (!hidesFoldableWork) {
698701
continue;
699702
}
700703

0 commit comments

Comments
 (0)