Skip to content

Commit 6a20a4d

Browse files
zansoncodex
andcommitted
fix(mobile): fork rows show a readable label instead of a thread ID
Fork timeline rows use the target thread ID as their detail, which the mobile row label prefers over "Thread forked". Keep the fork's readable label in collapsed and expanded rows while retaining its full details. Add regression coverage for local, inherited, and synthetic fork rows. Work done by GPT-6.1-Sol via Codex in Z6 Code. Co-Authored-By: GPT-6.1-Sol <[email protected]>
1 parent fb99076 commit 6a20a4d

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,34 @@ describe("buildThreadFeed", () => {
791791
expect(activities.at(-1)?.prominent).toBe(true);
792792
});
793793

794+
it.each(["local", "inherited", "synthetic"] as const)(
795+
"labels a %s fork row without exposing its target ID as the label",
796+
(visibility) => {
797+
const { providerThreadId: _providerThreadId, ...forkBase } = base(
798+
"item-fork",
799+
"2026-06-20T00:00:03.000Z",
800+
2,
801+
);
802+
const activity = buildThreadFeed([
803+
projected(
804+
{
805+
...forkBase,
806+
type: "fork",
807+
source: { type: "run", threadId: sourceThreadId, runId },
808+
targetThreadId: threadId,
809+
},
810+
0,
811+
visibility,
812+
),
813+
]).flatMap((entry) => (entry.type === "activity-group" ? entry.activities : []))[0]!;
814+
815+
expect(workEntryRowLabel(activity.workEntry)).toBe("Thread forked");
816+
expect(workEntryRowLabel(activity.workEntry, true)).toBe("Thread forked");
817+
expect(activity.canExpand).toBe(true);
818+
expect(activity.getFullDetail()).toContain(threadId);
819+
},
820+
);
821+
794822
it("keeps orchestration relationship cards visible when a completed run is folded", () => {
795823
const { providerThreadId: _providerThreadId, ...forkBase } = base(
796824
"item-fork",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ function compactWorkEntryText(value: string): string {
268268
}
269269

270270
export function workEntryRowLabel(entry: WorkLogPresentationEntry, expanded = false): string {
271+
if (entry.itemType === "fork") return entry.label;
271272
if (expanded && entry.itemType === "reasoning")
272273
return entry.toolLifecycleStatus === "inProgress" ? "Thinking" : "Thought";
273274
const presentation = resolveWorkEntryToolPresentation(entry);

0 commit comments

Comments
 (0)