Skip to content
TypeScript

fix(mobile): fork rows show a readable label instead of a thread ID (#22064)

Jeremiah Jordan1d7af6591b8d
diff --git a/apps/mobile/src/lib/threadActivity.test.ts b/apps/mobile/src/lib/threadActivity.test.ts
index acdee2249c0..f2ced2d6897 100644
--- a/apps/mobile/src/lib/threadActivity.test.ts
+++ b/apps/mobile/src/lib/threadActivity.test.ts
@@ -24,6 +24,7 @@ import { describe, expect, it } from "vite-plus/test";
import {
buildThreadFeed,
+ workEntryRowLabel,
threadFeedCompactionLabels,
createThreadFeedCache,
deriveThreadFeedPresentation,
@@ -731,6 +732,40 @@ describe("buildThreadFeed", () => {
expect(activities.at(-1)?.prominent).toBe(true);
});
+ it.each([
+ ["local", undefined],
+ ["inherited", undefined],
+ ["synthetic", undefined],
+ ["synthetic", "Forked from conversation"],
+ ] as const)(
+ "labels a %s fork row with title %s without exposing its target ID",
+ (visibility, title) => {
+ const { providerThreadId: _providerThreadId, ...forkBase } = base(
+ "item-fork",
+ "2026-06-20T00:00:03.000Z",
+ 2,
+ );
+ const activity = buildThreadFeed([
+ projected(
+ {
+ ...forkBase,
+ type: "fork",
+ title: title ?? null,
+ source: { type: "run", threadId: sourceThreadId, runId },
+ targetThreadId: threadId,
+ },
+ 0,
+ visibility,
+ ),
+ ]).flatMap((entry) => (entry.type === "activity-group" ? entry.activities : []))[0]!;
+
+ expect(workEntryRowLabel(activity.workEntry)).toBe(title ?? "Thread forked");
+ expect(workEntryRowLabel(activity.workEntry, true)).toBe(title ?? "Thread forked");
+ expect(activity.canExpand).toBe(true);
+ expect(activity.getFullDetail()).toContain(threadId);
+ },
+ );
+
it("names the fold that hides a progress message, with or without a run", () => {
const middle = {
...assistantMessage("2026-06-20T00:00:02.500Z"),
diff --git a/apps/mobile/src/lib/threadActivity.ts b/apps/mobile/src/lib/threadActivity.ts
index e17748d77aa..4cc5a842c21 100644
--- a/apps/mobile/src/lib/threadActivity.ts
+++ b/apps/mobile/src/lib/threadActivity.ts
@@ -253,6 +253,7 @@ function compactWorkEntryText(value: string): string {
}
export function workEntryRowLabel(entry: WorkLogPresentationEntry, expanded = false): string {
+ if (entry.itemType === "fork") return entry.label;
if (expanded && entry.itemType === "reasoning")
return entry.toolLifecycleStatus === "inProgress" ? "Thinking" : "Thought";
const presentation = resolveWorkEntryToolPresentation(entry);