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 (