Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const STATUS_LABEL_BY_STATUS: Partial<
approval: { label: "Approval", className: "text-amber-700 dark:text-amber-300" },
input: { label: "Input", className: "text-indigo-600 dark:text-indigo-300" },
working: { label: "Working", className: "text-sky-600 dark:text-sky-400" },
// Colorless like the web sidebar: parked on background work, not "act now".
waiting: { label: "Waiting", className: "text-foreground-tertiary" },
failed: { label: "Failed", className: "text-red-700 dark:text-red-300" },
};

Expand Down
18 changes: 18 additions & 0 deletions apps/mobile/src/features/threads/threadListV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ describe("resolveThreadListV2Status", () => {
"ready",
);
});

it("resolves waiting for an idle session parked on background tasks", () => {
const thread = makeThread({
id: ThreadId.make("t"),
title: "t",
session: {
threadId: ThreadId.make("t"),
status: "idle",
providerName: "Codex",
providerInstanceId: ProviderInstanceId.make("codex"),
runtimeMode: "full-access",
activeTurnId: null,
lastError: null,
updatedAt: NOW,
},
});
expect(resolveThreadListV2Status(thread)).toBe("waiting");
});
});

describe("sortThreadsForListV2", () => {
Expand Down
10 changes: 7 additions & 3 deletions apps/mobile/src/features/threads/threadListV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import type { EnvironmentId, ProjectId } from "@t3tools/contracts";
* Thread List v2 model, ported from the web sidebar v2
* (apps/web/src/components/Sidebar.logic.ts + SidebarV2.tsx).
*
* Four visual states, three colors: color is reserved for "act now"
* Six visual states, three colors: color is reserved for "act now"
* (approval), "in motion" (working), and "broken" (failed). Ready is the
* unlabeled resting state.
* unlabeled resting state; waiting (session status "idle") is the agent
* parked on open background tasks — grey like working, not a false Done.
*/
export type ThreadListV2Status = "approval" | "input" | "working" | "failed" | "ready";
export type ThreadListV2Status = "approval" | "input" | "working" | "waiting" | "failed" | "ready";

// Settled-tail paging: recent history is the common lookup; the deep tail
// stays behind an explicit Show more. Shared by the compact Home list and
Expand All @@ -30,6 +31,9 @@ export function resolveThreadListV2Status(
if (thread.session?.status === "running" || thread.session?.status === "starting") {
return "working";
}
if (thread.session?.status === "idle") {
return "waiting";
}
if (thread.session?.status === "error") {
return "failed";
}
Expand Down
Loading
Loading