From 4e90040b706eb6543512a84124b6f23edd53eec3 Mon Sep 17 00:00:00 2001 From: Claude Belizaire <139932571+Claudesaul@users.noreply.github.com> Date: Tue, 20 Oct 2026 09:59:48 -0400 Subject: [PATCH 1/2] fix(mobile): no Thinking row while a thread is compacting Co-authored-by: Claude Opus 5.5 --- apps/mobile/src/features/threads/ThreadDetailScreen.tsx | 1 + apps/mobile/src/features/threads/ThreadFeed.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx index d32c35f6c7d5..a2d90d564534 100644 --- a/apps/mobile/src/features/threads/ThreadDetailScreen.tsx +++ b/apps/mobile/src/features/threads/ThreadDetailScreen.tsx @@ -1139,6 +1139,7 @@ export const ThreadDetailScreen = function ThreadDetailScreen(props: ThreadDetai threadTitle={props.selectedThread.title} latestRun={props.activityRun} activeWorkStartedAt={props.activeWorkStartedAt} + isCompacting={props.isCompacting} runlessWorkActive={props.runlessWorkActive ?? false} listRef={listRef} freeze={freeze} diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx index 03e9066c9c2d..53c68841dcfc 100644 --- a/apps/mobile/src/features/threads/ThreadFeed.tsx +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx @@ -303,6 +303,7 @@ export interface ThreadFeedProps { readonly agentLabel: string; readonly latestRun: ThreadFeedLatestRun | null; readonly activeWorkStartedAt: string | null; + readonly isCompacting?: boolean; readonly runlessWorkActive?: boolean; readonly listRef: RefObject; readonly freeze: SharedValue; @@ -2155,7 +2156,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { reportHeaderMaterialVisibility(false); }, [feedThreadKey, reportHeaderMaterialVisibility]); - const presentedFeed = appendPendingThreadMessages( + const derivedFeed = appendPendingThreadMessages( deriveThreadFeedPresentation( props.feed, props.latestRun, @@ -2172,6 +2173,10 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { props.feed, props.queuedMessages, ); + // The floating control already says Compacting; web hides this row too. + const presentedFeed = props.isCompacting + ? derivedFeed.filter((entry) => entry.type !== "thinking") + : derivedFeed; const setupAnchorIndex = presentedFeed.findIndex( (entry) => entry.type === "message" && entry.message.role === "user", ); From cc3ef6a7549a77906fd934d0834f4fb12f4dc98a Mon Sep 17 00:00:00 2001 From: Claude Belizaire <139932571+Claudesaul@users.noreply.github.com> Date: Tue, 20 Oct 2026 14:31:38 -0400 Subject: [PATCH 2/2] Test hiding Thinking while compacting --- apps/mobile/src/features/threads/ThreadFeed.tsx | 11 ++++++----- .../features/threads/pending-thread-feed.test.ts | 14 +++++++++++++- .../src/features/threads/pending-thread-feed.ts | 8 ++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/apps/mobile/src/features/threads/ThreadFeed.tsx b/apps/mobile/src/features/threads/ThreadFeed.tsx index 53c68841dcfc..26874352641e 100644 --- a/apps/mobile/src/features/threads/ThreadFeed.tsx +++ b/apps/mobile/src/features/threads/ThreadFeed.tsx @@ -204,7 +204,11 @@ import { ThreadWorkLog, WORK_GROUP_TOGGLE_HEIGHT, } from "./thread-work-log"; -import { appendPendingThreadMessages, type PendingThreadFeedEntry } from "./pending-thread-feed"; +import { + appendPendingThreadMessages, + hideThinkingWhileCompacting, + type PendingThreadFeedEntry, +} from "./pending-thread-feed"; import type { QueuedThreadMessage } from "../../state/thread-outbox-model"; import { resolveThreadFeedFixedItemSize } from "./thread-feed-item-size"; import { htmlRenderFrameHeight } from "@t3tools/shared/htmlRender"; @@ -2173,10 +2177,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) { props.feed, props.queuedMessages, ); - // The floating control already says Compacting; web hides this row too. - const presentedFeed = props.isCompacting - ? derivedFeed.filter((entry) => entry.type !== "thinking") - : derivedFeed; + const presentedFeed = hideThinkingWhileCompacting(derivedFeed, props.isCompacting === true); const setupAnchorIndex = presentedFeed.findIndex( (entry) => entry.type === "message" && entry.message.role === "user", ); diff --git a/apps/mobile/src/features/threads/pending-thread-feed.test.ts b/apps/mobile/src/features/threads/pending-thread-feed.test.ts index 109439778c7a..dd78af7fe639 100644 --- a/apps/mobile/src/features/threads/pending-thread-feed.test.ts +++ b/apps/mobile/src/features/threads/pending-thread-feed.test.ts @@ -7,7 +7,7 @@ import { ThreadId, } from "@t3tools/contracts"; import type { QueuedThreadMessage } from "../../state/thread-outbox-model"; -import { appendPendingThreadMessages } from "./pending-thread-feed"; +import { appendPendingThreadMessages, hideThinkingWhileCompacting } from "./pending-thread-feed"; const pending = (id: string): QueuedThreadMessage => ({ environmentId: EnvironmentId.make("env"), @@ -54,6 +54,18 @@ describe("pending timeline messages", () => { expect(entries[1]?.pendingMessage?.text).toBe("first"); }); + it("hides the live Thinking row only while the thread is compacting", () => { + const thinking = { + type: "thinking", + runId: null, + id: "thinking", + createdAt: "2026-09-06T11:00:00.000Z", + } as const; + const entries = appendPendingThreadMessages([thinking], [], [pending("queued")]); + expect(hideThinkingWhileCompacting(entries, true).map((entry) => entry.id)).toEqual(["queued"]); + expect(hideThinkingWhileCompacting(entries, false)).toBe(entries); + }); + it("reuses the message id and suppresses the pending copy when delivery appears", () => { const queued = pending("sent"); const optimistic = appendPendingThreadMessages([], [], [queued])[0]!; diff --git a/apps/mobile/src/features/threads/pending-thread-feed.ts b/apps/mobile/src/features/threads/pending-thread-feed.ts index 80d2aa2f48dd..d9b76303ee2c 100644 --- a/apps/mobile/src/features/threads/pending-thread-feed.ts +++ b/apps/mobile/src/features/threads/pending-thread-feed.ts @@ -40,3 +40,11 @@ export function appendPendingThreadMessages( })), ]; } + +// The floating control already says Compacting; web hides this row too. +export function hideThinkingWhileCompacting( + feed: ReadonlyArray, + isCompacting: boolean, +): ReadonlyArray { + return isCompacting ? feed.filter((entry) => entry.type !== "thinking") : feed; +}