import { useConsole } from "../context"; import { shortId } from "../api/client"; import { firstChar, durationOf, tokenOf } from "../api/taskMeta"; // 任务列表行 meta:首字 / 总耗时 / token,计算见 api/taskMeta.ts, // 与任务详情共用同一口径。 // GitHub issues-style task list: search on top, a 主要聊天 header with // a + button, then hairline rows with a Primer status dot at the // left. There is deliberately NO project selector here any more: // the left sidebar (ProjectNav) is the one project selector, and the // auto-select-first-project fix in the store keeps the list from // ever starting empty. // a 14px title and a 12px muted meta line. The search input IS the // existing task search (id/prompt); status and executor filters stay // as a compact row below it. The selected row gets the light // blue-grey background (#ddf4ff), not a bubble. export default function TaskListSection({ onNew }: { onNew: () => void }) { const ctx = useConsole(); return (
ctx.setSearchText(e.target.value)} />
主要聊天
{ctx.taskCountText}
第 {ctx.taskPage + 1} / {ctx.taskTotalPages} 页(每页 20 条,最新在前)
{ctx.taskError ?
{ctx.taskError}
: !ctx.projectId ?
先选项目
: ctx.filteredTasks.length === 0 ?
{ctx.taskTotal ? "没有符合筛选条件的任务" : "该项目暂无任务"}
: ( )}
); }