diff --git a/CHANGELOG.md b/CHANGELOG.md index ecfcf9bb..c784ade3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ ### Unreleased +- 🃏 **任务卡小条只说原生状态**(首轮):运行中不再是「● 运行中 正在读取文件」这样把状态念两遍,而是**活动行取代状态词**——`正在分析请求` / `正在读取文件 · main.ts` / `正在准备读取文件` / `正在运行命令 · npm run build` 等措辞来自宿主 `chat` 命名空间,与主对话逐字一致;已结算小条同理(只留 `已读取文件、执行了命令`)。**`空闲` 与 `出错` 保留状态词**(不被任何活动措辞蕴含),完全没有活动数据时回退状态词,小条永不空着。状态点、执行扫光与折叠 chevron、22px 高度都不变。 +- 🧩 **主代理卡片接上自己的实时数据**:`subagents.live` 路由一直把拓扑根的 fold 结果放在 `live[rootSessionId]`,而模型从未把它挂到根节点上——于是主代理卡片的状态文本**恒为 thinking 兜底**,与主会话在做什么无关。现在根卡显示真实状态,树模式根行的实时行也从恒定的「思考中…」变成真实活动。 +- 🔎 **节点详情浮窗的活动行移到标题下方**:原来在键值格里(`最近活动 | 值`),右对齐的值列在 280px 被省略、标签又占掉三分之一宽;现在是标题下的一行 10px 小字(宿主措辞)+ 夹两行的实时文本尾行,**没有活动数据就不渲染**(此前每个浮窗都会显示「最近活动:正在分析请求」,已结算节点也一样)。词条 `tasksNodeActivity` 随这一行从 20 份词典删除。 +- 🗂 **聚合卡改为「按组展开」**:点一个聚合卡只展开**该组**(`fold:` / `fold::idle`),兄弟组、页级折叠与手工折叠都不受影响;控制条按钮仍是页级展开/折叠,且**收起时清掉按组展开**。树里的聚合行同一语义。**展开后卡片自己的 chevron 仍然有效**(手动折叠是该节点的最新意图,优先级高于组展开),聚合卡随之重新出现并能再次展开——否则「展开后点不回去了」。 +- 🔢 **聚合卡计数只说一次、小条变动作行**:待命组徽标此前印的是**字面量字母 N**(`tasksFoldIdleGroup` 在 20 份词典里都没有 `{count}` 插值),现在插值出真实计数;小条不再是重复计数的空条,而是「组图标 + 展开 + 出错尾注 + 展开箭头」,完整 tally 仍是卡片的 `aria-label` 与 tooltip。 +- 🏷 **模式词搬进徽标行**:子代理卡片此前每个都有一行 mono 元信息写着「一次性」——同一句话在每张卡上重复一次、还占一行高。现在模式(一次性 / 可持续)是**徽标旁的 chip**,智能体卡因此不再有元信息行、卡片高度预算同步收窄(只有工作流 run 卡还保留那行状态 / 成员元信息,行距按模型里有没有 run 取)。 +- 📊 **节点详情多两项事实**:新增 **Token 用量**(宿主 `tokenUsage` projection 的四个互斥桶求和,悬停给出未缓存输入 / 缓存读取 / 缓存写入 / 输出明细)与 **耗时**(宿主 `subagentTiming`:已结算回合 + 正在跑的那一轮,按页面轮询刷新)。两项都按宿主投影的**存在性**渲染——没有测量就不显示这一行,绝不打印一个说不清的 0;`SidebarProjectionSnapshot.values` 的镜像类型同步补上这两个键。 +- 🪟 **「查看转录」改为在原生右侧栏打开**(这是宿主自带能力):`dsh-resource://subagentchat/session/?parent=&mode=` + `ctx.sidebarRight.openResource(..., { kind: 'subagentchat', preferNewPane: true })`——与宿主自己的子代理列表(点行 = 主窗、点 chevron = 侧栏)同一套 tab 类型,主列保持不动;右侧新增小下拉按钮,菜单里可**在主窗中打开**(走原有的 `uiWorkspace.openSession` + 页签重挂)。宿主没有该 tab 类型 / 没有右栏 / 没有挂载会话时逐项降级回主窗并保持单按钮。 +- ✨ **动效**:接入 `@formkit/auto-animate`(`useAutoAnimateRef`,包一层 WAAPI 守卫,jsdom 与非 WAAPI 环境自动空转、并尊重 `prefers-reduced-motion`)——画布卡片、树模式行、后台任务行在折叠 / 新增 / 结算时滑入滑出而不是硬闪;详情卡另加入场关键帧(140ms,reduced-motion 下关闭)。 +- 🧪 测试:新增 `tests/session-metrics.spec.ts`(5 条:四桶求和、空投影、运行中耗时按渲染时钟、0 不算工作、时钟回拨不显示负数)与 `tests/activity-icons.spec.ts`(3 条:13 个类别全覆盖、读 / 命令 / 搜索 / 网页互不同型、`undefined` 走思考图标);`tests/tasks-page.spec.tsx` 补 6 条(原生状态取代状态词、无数据回退、根卡真实状态、浮窗活动块位置、一次只开一组 + 判据极性的判别性用例、展开后成员仍可手工折回、Token / 耗时两行、侧栏打开地址 + 下拉在主窗打开 + 无宿主能力时单按钮、模式 chip 在徽标行);`tests/tasks-graph-layout.spec.ts` 的高度 / 行距断言跟随新的卡片预算。[设计文档](docs/plans/2026-10-11-tasks-status-and-group-fold.md)。 + - 🃏 **任务卡小条只说原生状态**:运行中小条不再是「● 运行中 正在读取文件」这样把状态念两遍,而是**活动行取代状态词**——`正在分析请求` / `正在读取文件 · main.ts` / `正在准备读取文件` / `正在运行命令 · npm run build` 等措辞全部来自宿主 `chat` 命名空间,与主对话逐字一致;已结算小条同理(只留 `已读取文件、执行了命令`,不重复「已完成」)。**`空闲` 与 `出错` 保留状态词**(「待命」「失败」不被任何活动措辞蕴含),**完全没有活动数据时回退状态词**,小条永不空着。状态点、执行扫光与折叠 chevron 不变,小条仍是 22px——画布几何与卡片高度预算零改动。 - 🧩 **主代理卡片接上自己的实时数据**:`subagents.live` 路由一直把拓扑根的 fold 结果放在 `live[rootSessionId]`,而模型从未把它挂到根节点上——于是**主代理卡片的状态文本恒为 thinking 兜底**(「正在分析请求」),与主会话在做什么无关。现在根卡显示真实状态,树模式根行的实时行也从恒定的「思考中…」变成真实活动。 - 🔎 **节点详情浮窗的活动行移到标题下方**:那行原来在键值格里(`最近活动 | 值`),右对齐的值列在 280px 里被省略,标签又占掉三分之一宽;现在它是标题下的一行 10px 小字(宿主措辞),实时文本尾行紧接其下并夹到两行。**没有活动数据就不渲染这一块**——此前每个节点浮窗都会显示「最近活动:正在分析请求」,已结算节点也不例外。词条 `tasksNodeActivity` 随这一行从 20 份词典删除。 diff --git a/README.md b/README.md index 0afeb590..a590b948 100644 --- a/README.md +++ b/README.md @@ -224,9 +224,9 @@ dsh registry enable dsh-external/dsh-better-sidebar > 📦 **正式版**(npm `latest`):支持线**不变**——仍仅支持 **DSH 0.1.7-rc.1+**(peer 下限 `^0.1.7-rc.1`,CI 钉 `@deepseek-ai/dsh@0.1.7-rc.1`),0.21.1 的用户直接升级即可。**DSH 0.1.6-alpha.2 及更早请继续固定 v0.19.1**。 - 🧩 **任务管理页重做成工作流图**(主显示模式):会话树渲染为分层节点 + 贝塞尔连线——拖拽平移、滚轮缩放到光标、内容包围盒居中适配、右下角控制条(图/树切换 + 折叠开关 + 缩放 + 适配);**经典缩进树保留**(键盘可导航),两种模式共享同一个视图模型,折叠状态与团队富化不会视觉漂移。 -- 🃏 **双段式节点卡**:上段是类型徽章(主代理 / 子代理 / 成员 / 工作流 / 已完成聚合)+ 相位徽标 + 名称 + 元信息;下段小条是状态点 + **原生状态文本**(**主 Agent 同款合并活动行**:并发工具按类别归并 + 计数 + 在跑那条的细节,措辞取宿主 `chat` 词条——`正在分析请求` / `正在读取文件 · main.ts` / `正在准备读取文件` / `正在运行命令 · npm run build`),运行中与已结算都由它**取代状态词**(不再念两遍「运行中 / 已完成」),`空闲` 与 `出错` 保留状态词、没有活动数据时回退状态词;已完成节点在小条上有折叠按钮;运行中小条从左到右**完整扫过**(`prefers-reduced-motion` 下关闭)。8px 圆角、层级只用上段极淡底色表达、当前会话加粗 accent 描边。 +- 🃏 **双段式节点卡**:上段是类型徽章(主代理 / 子代理 / 成员 / 工作流 / 已完成聚合)+ 相位徽标 + **模式 chip**(一次性 / 可持续,与徽标同一行)+ 名称(只有工作流 run 另带一行状态 / 成员元信息);下段小条是状态点 + **原生状态文本**(**主 Agent 同款合并活动行**:并发工具按类别归并 + 计数 + 在跑那条的细节,措辞取宿主 `chat` 词条——`正在分析请求` / `正在读取文件 · main.ts` / `正在准备读取文件` / `正在运行命令 · npm run build`),运行中与已结算都由它**取代状态词**(不再念两遍「运行中 / 已完成」),`空闲` 与 `出错` 保留状态词、没有活动数据时回退状态词;已完成节点在小条上有折叠按钮;运行中小条从左到右**完整扫过**(`prefers-reduced-motion` 下关闭)。8px 圆角、层级只用上段极淡底色表达、当前会话加粗 accent 描边。 - 🔀 **工作流 run 入图**:从 `tool-workflow/*` 事件折叠出 run(与官方面板同一批),run 挂在发起代理下、成员 agent 重挂到 run 下并按相位分框、同色相位徽标;catalog 里没有的成员用 run 数据合成占位节点,跑完的 run 仍能看到成员。 -- 🗂 **折叠分两组、各自说清是什么**:`✓ N 已完成`(含出错,失败单独报 `出错 N`)与 `N 个待命`(跑完一轮、随时可被叫起来的 teammate)是**两行**;手动折叠按钮永远有效,自动聚合只在待命成员 ≥3 时收空闲成员;聚合卡名字行写「前两个名字 + `+N`」、徽标写**真实计数**(`✓ N 已完成` / `N 个待命`),小条只留出错尾注与展开箭头;**点聚合只展开该组**(兄弟组与页级折叠都不动),页级展开/折叠仍在右下控制条,且那里收起时会把按组展开一并清掉。 +- 🗂 **折叠分两组、各自说清是什么**:`✓ N 已完成`(含出错,失败单独报 `出错 N`)与 `N 个待命`(跑完一轮、随时可被叫起来的 teammate)是**两行**;手动折叠按钮永远有效,自动聚合只在待命成员 ≥3 时收空闲成员;聚合卡名字行写「前两个名字 + `+N`」、徽标写**真实计数**(`✓ N 已完成` / `N 个待命`),小条是动作行(图标 + 「展开」+ 出错尾注 + 展开箭头);**点聚合只展开该组**(兄弟组与页级折叠都不动),页级展开/折叠仍在右下控制条,且那里收起时会把按组展开一并清掉。 - 🪟 **两个常驻浮动窗**(抽出可复用的 `FloatingWindow`):后台任务输出与共享任务详情/编辑——可拖拽、可四边拉伸、内容区自滚动,只靠关闭按钮或 Escape 结束(外部点击 / 失焦 / 锚点离屏都不关);任务窗把余量交给描述区,拉大是给内容更多空间而不是留白,动作行固定在底部。 - 👥 **Agent Teams 任务板(实验层)**:成员富化到对应节点、常驻任务条列出成员与共享任务;状态机跟随宿主(待办 → 认领 → 进行中 → 完成 → 重开)+ 改派 / 编辑 / 两击删除,CAS 过期修订单独提示;成员活动由 `subagents.live` 的 running 叠加。 - 🔄 **后台任务改读宿主客户端 `ctx.jobs`**(推送 roster + 非消费输出流 + kill):删掉自建的 `jobs.list` / `jobs.output` / `jobs.kill` 三条路由与事件回放镜像,彻底不碰模型 `job_output` 游标;输出在常驻浮动窗里流式显示并尾随,代理数 ≥8 时抽屉自动折叠。 diff --git a/README_EN.md b/README_EN.md index d2725697..7367a40a 100644 --- a/README_EN.md +++ b/README_EN.md @@ -233,9 +233,9 @@ WeChat / QQ group QR codes will live here. After uploading the QR images (drag t > 📦 **Stable release** (npm `latest`): the support line is **unchanged** — DSH **0.1.7-rc.1+** only (peer floor `^0.1.7-rc.1`, CI pins `@deepseek-ai/dsh@0.1.7-rc.1`), so v0.21.1 users can upgrade straight away. **Hosts on DSH 0.1.6-alpha.2 or earlier keep pinning v0.19.1.** - 🧩 **The Tasks page is now a workflow graph** (the primary view): the session tree renders as layered nodes joined by bezier edges — drag to pan, wheel-zoom to the cursor, fit to the content box, a control cluster bottom-right (graph/tree toggle + fold switch + zoom + fit); the **classic indented tree is kept** (keyboard-navigable) and both modes share one view model, so fold state and team enrichment never drift apart. -- 🃏 **Two-segment node cards**: the top segment is the kind badge (main agent / subagent / teammate / workflow / completed aggregate) + phase badge + name + meta; the bottom bar is the state dot + the **native status text** (**the same merged activity line the main agent shows**: concurrent tools grouped and counted, with the running call's detail — wording from the host's `chat` namespace, i.e. analyzing the request / reading a file · main.ts / preparing to read a file / running a command · npm run build). That line **takes the state word's place** for running and settled nodes (the state is no longer printed twice), while `idle` and `error` keep their word and a node with no activity data falls back to it; finished nodes carry a fold button on the bar; a running bar is swept across its **whole** width (disabled under `prefers-reduced-motion`). 8px-rounded, hierarchy carried by a faint top-segment tint only, the session you are on wearing a heavier accent border. +- 🃏 **Two-segment node cards**: the top segment is the kind badge (main agent / subagent / teammate / workflow / completed aggregate) + phase badge + a **mode chip** (one-shot / continuable, sharing the badge's row) + name — only a workflow run keeps a mono meta line (status / member tally); the bottom bar is the state dot + the **native status text** (**the same merged activity line the main agent shows**: concurrent tools grouped and counted, with the running call's detail — wording from the host's `chat` namespace, i.e. analyzing the request / reading a file · main.ts / preparing to read a file / running a command · npm run build). That line **takes the state word's place** for running and settled nodes (the state is no longer printed twice), while `idle` and `error` keep their word and a node with no activity data falls back to it; finished nodes carry a fold button on the bar; a running bar is swept across its **whole** width (disabled under `prefers-reduced-motion`). 8px-rounded, hierarchy carried by a faint top-segment tint only, the session you are on wearing a heavier accent border. - 🔀 **Workflow runs enter the graph**: runs folded from `tool-workflow/*` events (the same events the official panel folds) hang under their origin agent, with member agents re-parented below and boxed per phase with matching badges; members with no catalog row are synthesized from the run's own data, so a finished run still shows who took part. -- 🗂 **Folding split into two groups that say what they hold**: `✓ N completed` (including failures, called out as `N failed`) and `N idle` (teammates that finished a turn and can be called back at any moment) are **two separate rows**; the manual fold button always works, the automatic rule only sweeps idle members once there are 3 or more, and an aggregate's name line reads "first two names + `+N`" while its badge carries the **real count** (`✓ N completed` / `N idle`) and the bar keeps only the failure tail plus the expand chevron. **Clicking an aggregate reveals THAT group only** — sibling groups and the page-level rule stay put; the page-level expand/collapse lives in the bottom-right cluster, and collapsing there drops the per-group openings too. +- 🗂 **Folding split into two groups that say what they hold**: `✓ N completed` (including failures, called out as `N failed`) and `N idle` (teammates that finished a turn and can be called back at any moment) are **two separate rows**; the manual fold button always works, the automatic rule only sweeps idle members once there are 3 or more, and an aggregate's name line reads "first two names + `+N`" while its badge carries the **real count** (`✓ N completed` / `N idle`) and its bar is the action row (group glyph + `Expand` + the failure tail + the expand chevron). **Clicking an aggregate reveals THAT group only** — sibling groups and the page-level rule stay put; the page-level expand/collapse lives in the bottom-right cluster, and collapsing there drops the per-group openings too. - 🪟 **Two persistent floating windows** (extracted into a reusable `FloatingWindow`): background-job output and the shared task's detail/edit surface — draggable, resizable from every edge, a self-scrolling body, dismissed only by the close button or Escape (no outside click / blur / anchor observer); the task window hands its spare height to the description, so enlarging it gives the content room, and the action row is pinned to the bottom. - 👥 **Agent Teams board (experimental layer)**: members enrich their nodes and an always-visible strip lists the roster and shared tasks; the state machine follows the host (pending → claim → in progress → complete → reopen) with reassign / edit / two-step delete, and stale CAS revisions get their own notice; member activity is overlaid from `subagents.live`'s `running` flag. - 🔄 **Background jobs now read the host's client `ctx.jobs`** (a pushed roster plus a non-consuming output stream and `kill`): the plugin deleted its own `jobs.list` / `jobs.output` / `jobs.kill` routes and the event-replay mirror, never touching the model's `job_output` cursor; output streams in a persistent floating window with tail-follow, and the drawer auto-collapses at 8+ agents. diff --git a/docs/plans/2026-10-11-tasks-status-and-group-fold.md b/docs/plans/2026-10-11-tasks-status-and-group-fold.md index d2aae766..6aed7a2c 100644 --- a/docs/plans/2026-10-11-tasks-status-and-group-fold.md +++ b/docs/plans/2026-10-11-tasks-status-and-group-fold.md @@ -112,14 +112,36 @@ state === 'running' → liveActivityLabel(summary) // 宿主 mess 已补 `tests/tasks-page.spec.tsx` 的「drops the per-group openings when the CLUSTER collapses the page」 用例;把判据翻回去即红(实测),这条用例是判别性的。 +## 第二轮(用户真机测试反馈,同日) + +用户在 3080 实例上实际测试后报回六条,逐条处置: + +| # | 反馈 | 处置 | +|---|---|---| +| 1 | 已完成的【聚合】卡下方空荡荡 | **是我上一轮的取舍造成的**:把计数收进徽标后,没有出错时那条只剩右侧一个 chevron。现在小条是**动作行**:组图标 + 「展开」+ 出错尾注 + 展开箭头(`tasksFoldExpandShort` 新词条,20 份词典) | +| 2 | 展开后的子代理点不回去 | **真缺陷**:`expandedGroups` 压过了 `foldedIds`,导致展开组内卡片的 chevron 失效。改为**手动折叠优先**(手动 → 页级规则 → 组展开),并补两层判别性用例(模型 + 组件) | +| 3 | 一次性子代理一直显示「一次性」 | 模式词**搬进徽标行**成 chip(用户口径:「和可续接等状态放到和子代理那个徽标一行上」)。智能体卡因此不再有 mono 元信息行,卡片高度预算拆成 `GRAPH_AGENT_NODE_H` / `GRAPH_NODE_H`(只有 workflow run 卡保留元信息行),`rowStrideFor(nodes)` 按模型里有没有 run 选行距 | +| 4 | 动效,允许引入新库 | 用户选定 `@formkit/auto-animate`(~3KB,无依赖无安装脚本)。加 `useAutoAnimateRef` 包装(WAAPI 守卫 → jsdom 空转;尊重 `prefers-reduced-motion`),挂到画布卡片层 / 树视图 / 任务抽屉;详情卡另加 140ms 入场关键帧。核心 bundle 因此增大约 56KB(未压缩 CJS,含库源码 27KB) | +| 5 | 弹窗多显示 token 与耗时 | 新增 **Token 用量** + **耗时** 两行。数据来自宿主投影(`tokenUsage` 四桶求和;`subagentTiming` 已结算 + 本次运行,按页面 3s 轮询刷新),`SidebarProjectionSnapshot.values` 镜像补两个键、模型新增 `metrics` 入参。**按存在性渲染**:没有测量就不显示这一行(0 是投影的初始态,与「没工作过」不可区分) | +| 6 | 「查看转录」改为在侧边栏打开(原生能力),右侧加下拉按钮可在主窗打开 | 确认宿主确有该能力:`@deepseek-ai/dsh-client-ui-subagent` 注册 `subagentchat` tab 类型,宿主自己的子代理列表就是「点行 = 主窗、点 chevron = 侧栏」。插件照抄其地址公式(宿主不导出 builder/parser)并调 `openResource(addr, {kind:'subagentchat', preferNewPane:true})`,三级降级回主窗;页脚变为「主按钮 + caret 菜单(在主窗口中打开)」 | + +### 第二轮的实施偏差与未验证项 + +1. **画布上的 FLIP 位移会被缩放比例影响**:auto-animate 用 `getBoundingClientRect` 量测、以未缩放的 `transform` 播放,而卡片层带着 fit 的 `scale(k)`——插入 / 移除的淡入淡出不受影响,**位置移动**的行程在 k≠1 时按 k 缩放(落点仍然正确)。选择接受并在 `use-auto-animate.ts` 里写明;若真机观感不够好,画布那一处可退化回 CSS 入场关键帧(库只保留树 / 抽屉)。 +2. **真机只跑通到「插件挂载 + 零 pageerror」**:新构建已装进 `sidebar-test` profile 并在 http://127.0.0.1:3080 提供服务(`[data-dsh-better-sidebar]` 挂载、`/sidebar/api/*` 200、无 pageerror / console error)。但**动效与观感的逐帧复核没做成**:宿主右栏在无头上下文里以 `transform` 平移到视口外,我的合成点击无法稳定地把任务页调出来(多次尝试后放弃)。这一条由维护者自己在实例上看。 +3. **实机数据的两个新行未在真机核验**:Token / 耗时两行通过夹具断言(25.5K / 2 分 42 秒)与 `session-metrics` 单测覆盖,但没有在真实子代理会话上截图确认数值口径(真实会话的 `tokenUsage` 是整段日志累计,包含 fork 继承前缀这一点已写进 `context-types.ts` 的注释)。 +4. **`uses` 依赖新增**:`@formkit/auto-animate@^0.10.0` 进 `dependencies`(无 `cordis`、无安装脚本,市场约束满足)。本 worktree 的 `node_modules` 因此从符号链接物化为独立副本(源仓库未被触碰,见仓库规则)。 + + ## 验证证据 | 项 | 结果 | |---|---| | `tsc --noEmit`(等价 `pnpm typecheck`) | ✅ 0 错误 | | `eslint .` | ✅ 0 错误 | -| `vitest run`(全套) | ✅ **2227 passed / 17 skipped / 0 failed**(190 文件) | -| `tsc -p tsconfig.build.json` + `tsdown` | ✅ 构建通过(核心 bundle 与三个 chunk 正常产出) | +| `vitest run`(全套) | ✅ **2238 passed / 17 skipped / 0 failed**(191 文件,含第二轮新增的 3 个 spec 文件) | +| `tsc -p tsconfig.build.json` + `tsdown` | ✅ 构建通过(核心 bundle 1,333,699 字节,较首轮 +56KB = auto-animate 及其包装) | +| 真机挂载(`sidebar-test` profile,DSH 0.2.0-rc.2,:3080) | ✅ 装进独立 profile 后 `[data-dsh-better-sidebar]` 挂载、`/sidebar/api/*`(settings.get / session.phase / session.cwd)200、**0 pageerror / 0 console error**;动效观感未逐帧核验(见偏差 2) | 本轮新增/改写的守护: diff --git a/package.json b/package.json index 55b6191e..fd564001 100644 --- a/package.json +++ b/package.json @@ -145,6 +145,7 @@ "@codemirror/state": "^6.7.1", "@codemirror/view": "^6.43.8", "@deepseek-ai/schemastery": "^3.18.4", + "@formkit/auto-animate": "^0.10.0", "@lezer/highlight": "^1.2.3", "@xterm/addon-fit": "^0.11.0", "@xterm/xterm": "^6.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7a50b58..6d7fd3cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -74,9 +74,12 @@ importers: '@deepseek-ai/schemastery': specifier: ^3.18.4 version: 3.18.4 + '@formkit/auto-animate': + specifier: ^0.10.0 + version: 0.10.0 '@lezer/highlight': specifier: ^1.2.3 - version: 1.2.3 + version: 1.2.5 '@xterm/addon-fit': specifier: ^0.11.0 version: 0.11.0 @@ -227,7 +230,7 @@ importers: version: 18.3.1 '@types/ws': specifier: ^8.5.10 - version: 8.18.1 + version: 8.18.2 anser: specifier: ^2.3.5 version: 2.3.5 @@ -269,7 +272,7 @@ importers: version: 3.0.0 micromark-core-commonmark: specifier: ^2.0.3 - version: 2.0.3 + version: 2.0.4 micromark-extension-gfm: specifier: ^3.0.0 version: 3.0.0 @@ -278,7 +281,7 @@ importers: version: 3.1.0 micromark-factory-space: specifier: ^2.0.1 - version: 2.0.1 + version: 2.1.0 micromark-util-character: specifier: ^2.1.1 version: 2.1.1 @@ -293,7 +296,7 @@ importers: version: 2.0.1 micromark-util-types: specifier: ^2.0.2 - version: 2.0.2 + version: 2.0.3 react: specifier: ^18.2.0 version: 18.2.0 @@ -950,6 +953,9 @@ packages: '@noble/hashes': optional: true + '@formkit/auto-animate@0.10.0': + resolution: {integrity: sha512-KGomRttjUfORuPUaR/ZGQw+6xfMrTM+sxnILv7JAd9AmabU9rg9i6gF/iC0Ih+QpKCubJpCA/1DX9UHKE8cX+A==} + '@huanlin/dsh-plugin-better-locale@0.1.0': resolution: {integrity: sha512-fGXDgVq1R3gVTi2M9TMn2x5ROqiaYkhEsFJqYF5xiVUFfs9KjwIpOF0ZbhUyK6vFBOeYP4uetc/ZVknQb38WrQ==} engines: {node: '>=22.0.0'} @@ -1050,8 +1056,8 @@ packages: '@lezer/go@1.0.1': resolution: {integrity: sha512-xToRsYxwsgJNHTgNdStpcvmbVuKxTapV0dM0wey1geMMRc9aggoVyKgzYp41D2/vVOx+Ii4hmE206kvxIXBVXQ==} - '@lezer/highlight@1.2.3': - resolution: {integrity: sha512-qXdH7UqTvGfdVBINrgKhDsVTJTxactNNxLk7+UMwZhU13lMHaOBlJe9Vqp907ya56Y3+ed2tlqzys7jDkTmW0g==} + '@lezer/highlight@1.2.5': + resolution: {integrity: sha512-O1GMVKgtf5YspFaRzpmqkVgMtIk2HG9uMAbH6wdAIdNh3TVzCsch/+cRi+6l2//UGDKe6NB9BW3cvuR5ezMQ0w==} '@lezer/html@1.3.13': resolution: {integrity: sha512-oI7n6NJml729m7pjm9lvLvmXbdoMoi2f+1pwSDJkl9d68zGr7a9Btz8NdHTGQZtW2DA25ybeuv/SyDb9D5tseg==} @@ -1495,8 +1501,8 @@ packages: '@types/unist@3.0.3': resolution: {integrity: sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==} - '@types/ws@8.18.1': - resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@types/ws@8.18.2': + resolution: {integrity: sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==} '@typescript-eslint/eslint-plugin@8.69.0': resolution: {integrity: sha512-t5jQTKPIgVW1PE6dR6H6Qz5gm8zjMlX5/2gRaOGd9eO6V7J+tQc6iWKukEe7dY8u9HyYasQ0yfF0/FSSTEO2gA==} @@ -2594,8 +2600,8 @@ packages: mermaid@11.17.0: resolution: {integrity: sha512-Jo9N377Wb4MSnHFPTbLi2SxFpsQl4eVHoxnW5U1Md9EazvgMp3s+4ohDxr81YNTgbn5Kj7HJ3yslrSJ52kwpbA==} - micromark-core-commonmark@2.0.3: - resolution: {integrity: sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==} + micromark-core-commonmark@2.0.4: + resolution: {integrity: sha512-wxEeE8v8XVvOrxn1TZj74qYhAtTQsSqufHVS3uNVyT1MupXxhyaHk8/9xDNPh9BmL77QNDgWTkZ3RsYHB2ry7w==} micromark-extension-gfm-autolink-literal@2.1.0: resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} @@ -2627,8 +2633,8 @@ packages: micromark-factory-label@2.0.1: resolution: {integrity: sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==} - micromark-factory-space@2.0.1: - resolution: {integrity: sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==} + micromark-factory-space@2.1.0: + resolution: {integrity: sha512-fS8hnLIjnjvdQIj39Geug8wWsR0HrYZ43KShKxNfwT7t2LOHo/LbWZEzEaSOjwtjdCsjoE6syHhonEzW0zv0+Q==} micromark-factory-title@2.0.1: resolution: {integrity: sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==} @@ -2654,6 +2660,9 @@ packages: micromark-util-decode-string@2.0.1: resolution: {integrity: sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==} + micromark-util-edit-map@1.0.0: + resolution: {integrity: sha512-Pa2ljlsEL6sVwFaYeyrOLSYbQt73JvGbPOYFq+9AElXiSnfI5Q4465RRZ1sHv7lDjDOnGRDDaqPXqClqWK/q1Q==} + micromark-util-encode@2.0.1: resolution: {integrity: sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==} @@ -2675,8 +2684,8 @@ packages: micromark-util-symbol@2.0.1: resolution: {integrity: sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==} - micromark-util-types@2.0.2: - resolution: {integrity: sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==} + micromark-util-types@2.0.3: + resolution: {integrity: sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==} micromark@4.0.2: resolution: {integrity: sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==} @@ -3002,6 +3011,10 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + source-map-js@1.2.2: + resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} + engines: {node: '>=0.10.0'} + space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} @@ -3639,7 +3652,7 @@ snapshots: '@codemirror/language': 6.12.4 '@codemirror/state': 6.7.1 '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@codemirror/lang-vue@0.1.3': @@ -3648,7 +3661,7 @@ snapshots: '@codemirror/lang-javascript': 6.2.5 '@codemirror/language': 6.12.4 '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@codemirror/lang-xml@6.1.0': @@ -3666,7 +3679,7 @@ snapshots: '@codemirror/language': 6.12.4 '@codemirror/state': 6.7.1 '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/yaml': 1.0.4 @@ -3675,7 +3688,7 @@ snapshots: '@codemirror/state': 6.7.1 '@codemirror/view': 6.43.9 '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 style-mod: 4.1.3 @@ -4128,6 +4141,8 @@ snapshots: '@exodus/bytes@1.15.1': {} + '@formkit/auto-animate@0.10.0': {} + '@huanlin/dsh-plugin-better-locale@0.1.0(@deepseek-ai/cordis@4.0.4)(@deepseek-ai/dsh-client-locale@0.2.0-rc.2(@deepseek-ai/cordis@4.0.4))(@deepseek-ai/dsh-client-ui-primitives@0.2.0-rc.2(@deepseek-ai/cordis@4.0.4))(@deepseek-ai/dsh-client-ui-settings@0.2.0-rc.2(@deepseek-ai/cordis@4.0.4))(@deepseek-ai/dsh-client-ui-slots@0.2.0-rc.2(@deepseek-ai/cordis@4.0.4))(@deepseek-ai/dsh-invariants@0.2.0-rc.2(@deepseek-ai/cordis@4.0.4))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@deepseek-ai/cordis': 4.0.4(@deepseek-ai/cordis-plugin-include@1.0.9)(@deepseek-ai/cordis-plugin-loader@1.0.5) @@ -4207,47 +4222,47 @@ snapshots: '@lezer/cpp@1.1.6': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/css@1.3.6': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/go@1.0.1': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 - '@lezer/highlight@1.2.3': + '@lezer/highlight@1.2.5': dependencies: '@lezer/common': 1.5.2 '@lezer/html@1.3.13': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/java@1.1.3': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/javascript@1.5.4': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/json@1.0.3': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/lr@1.4.10': @@ -4257,36 +4272,36 @@ snapshots: '@lezer/markdown@1.7.2': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/php@1.0.5': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/python@1.1.19': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/rust@1.0.2': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/xml@1.0.6': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@lezer/yaml@1.0.4': dependencies: '@lezer/common': 1.5.2 - '@lezer/highlight': 1.2.3 + '@lezer/highlight': 1.2.5 '@lezer/lr': 1.4.10 '@marijn/find-cluster-break@1.0.3': {} @@ -4630,7 +4645,7 @@ snapshots: '@types/unist@3.0.3': {} - '@types/ws@8.18.1': + '@types/ws@8.18.2': dependencies: '@types/node': 24.13.3 @@ -5634,7 +5649,7 @@ snapshots: micromark-util-decode-string: 2.0.1 micromark-util-normalize-identifier: 2.0.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 unist-util-stringify-position: 4.0.0 transitivePeerDependencies: - supports-color @@ -5768,42 +5783,43 @@ snapshots: ts-dedent: 2.3.0 uuid: 14.0.2 - micromark-core-commonmark@2.0.3: + micromark-core-commonmark@2.0.4: dependencies: decode-named-character-reference: 1.3.0 devlop: 1.1.0 micromark-factory-destination: 2.0.1 micromark-factory-label: 2.0.1 - micromark-factory-space: 2.0.1 + micromark-factory-space: 2.1.0 micromark-factory-title: 2.0.1 micromark-factory-whitespace: 2.0.1 micromark-util-character: 2.1.1 micromark-util-chunked: 2.0.1 micromark-util-classify-character: 2.0.1 + micromark-util-edit-map: 1.0.0 micromark-util-html-tag-name: 2.0.1 micromark-util-normalize-identifier: 2.0.1 micromark-util-resolve-all: 2.0.1 micromark-util-subtokenize: 2.1.0 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm-autolink-literal@2.1.0: dependencies: micromark-util-character: 2.1.1 micromark-util-sanitize-uri: 2.0.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm-footnote@2.1.0: dependencies: devlop: 1.1.0 - micromark-core-commonmark: 2.0.3 - micromark-factory-space: 2.0.1 + micromark-core-commonmark: 2.0.4 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-normalize-identifier: 2.0.1 micromark-util-sanitize-uri: 2.0.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm-strikethrough@2.1.0: dependencies: @@ -5812,27 +5828,27 @@ snapshots: micromark-util-classify-character: 2.0.1 micromark-util-resolve-all: 2.0.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm-table@2.1.1: dependencies: devlop: 1.1.0 - micromark-factory-space: 2.0.1 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm-tagfilter@2.0.0: dependencies: - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm-task-list-item@2.1.0: dependencies: devlop: 1.1.0 - micromark-factory-space: 2.0.1 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-gfm@3.0.0: dependencies: @@ -5843,54 +5859,54 @@ snapshots: micromark-extension-gfm-tagfilter: 2.0.0 micromark-extension-gfm-task-list-item: 2.1.0 micromark-util-combine-extensions: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-extension-math@3.1.0: dependencies: '@types/katex': 0.16.8 devlop: 1.1.0 katex: 0.16.47 - micromark-factory-space: 2.0.1 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-factory-destination@2.0.1: dependencies: micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-factory-label@2.0.1: dependencies: devlop: 1.1.0 micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 - micromark-factory-space@2.0.1: + micromark-factory-space@2.1.0: dependencies: micromark-util-character: 2.1.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-factory-title@2.0.1: dependencies: - micromark-factory-space: 2.0.1 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-factory-whitespace@2.0.1: dependencies: - micromark-factory-space: 2.0.1 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-util-character@2.1.1: dependencies: micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-util-chunked@2.0.1: dependencies: @@ -5900,12 +5916,12 @@ snapshots: dependencies: micromark-util-character: 2.1.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-util-combine-extensions@2.0.1: dependencies: micromark-util-chunked: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-util-decode-numeric-character-reference@2.0.2: dependencies: @@ -5918,6 +5934,10 @@ snapshots: micromark-util-decode-numeric-character-reference: 2.0.2 micromark-util-symbol: 2.0.1 + micromark-util-edit-map@1.0.0: + dependencies: + micromark-util-types: 2.0.3 + micromark-util-encode@2.0.1: {} micromark-util-html-tag-name@2.0.1: {} @@ -5928,7 +5948,7 @@ snapshots: micromark-util-resolve-all@2.0.1: dependencies: - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-util-sanitize-uri@2.0.1: dependencies: @@ -5941,11 +5961,11 @@ snapshots: devlop: 1.1.0 micromark-util-chunked: 2.0.1 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 micromark-util-symbol@2.0.1: {} - micromark-util-types@2.0.2: {} + micromark-util-types@2.0.3: {} micromark@4.0.2: dependencies: @@ -5953,8 +5973,8 @@ snapshots: debug: 4.4.3 decode-named-character-reference: 1.3.0 devlop: 1.1.0 - micromark-core-commonmark: 2.0.3 - micromark-factory-space: 2.0.1 + micromark-core-commonmark: 2.0.4 + micromark-factory-space: 2.1.0 micromark-util-character: 2.1.1 micromark-util-chunked: 2.0.1 micromark-util-combine-extensions: 2.0.1 @@ -5965,7 +5985,7 @@ snapshots: micromark-util-sanitize-uri: 2.0.1 micromark-util-subtokenize: 2.1.0 micromark-util-symbol: 2.0.1 - micromark-util-types: 2.0.2 + micromark-util-types: 2.0.3 transitivePeerDependencies: - supports-color @@ -6121,7 +6141,7 @@ snapshots: dependencies: nanoid: 3.3.18 picocolors: 1.1.1 - source-map-js: 1.2.1 + source-map-js: 1.2.2 prelude-ls@1.2.1: {} @@ -6277,6 +6297,8 @@ snapshots: source-map-js@1.2.1: {} + source-map-js@1.2.2: {} + space-separated-tokens@2.0.2: {} stackback@0.0.2: {} diff --git a/src/client/JobsDrawer.tsx b/src/client/JobsDrawer.tsx index f8fac715..8e1b870a 100644 --- a/src/client/JobsDrawer.tsx +++ b/src/client/JobsDrawer.tsx @@ -33,6 +33,7 @@ import { type TreeJob, } from './subagent-jobs.ts' import { FloatingWindow } from './FloatingWindow.tsx' +import { useAutoAnimateRef } from './use-auto-animate.ts' import { t } from './locales.ts' import css from './tasks-graph.module.css' @@ -69,6 +70,9 @@ export function JobsDrawer(props: JobsDrawerProps): ReactNode { /** Manual override; undefined = follow the auto rule. */ const [manualOpen, setManualOpen] = useState(undefined) const open = manualOpen ?? autoOpen + /** The rows: a job arriving or settling slides in instead of blinking. */ + const rowsRef = useRef(null) + useAutoAnimateRef(rowsRef) const [armedId, setArmedId] = useState(undefined) const [killingId, setKillingId] = useState(undefined) const [killErrorId, setKillErrorId] = useState(undefined) @@ -134,7 +138,7 @@ export function JobsDrawer(props: JobsDrawerProps): ReactNode { {!autoOpen &&
{t('jobsAutoCollapsed')}
} {open && ( -
+
{rows.map((row) => { const { job } = row const live = isJobLive(job) diff --git a/src/client/SubagentView.tsx b/src/client/SubagentView.tsx index 8e7805e8..43080270 100644 --- a/src/client/SubagentView.tsx +++ b/src/client/SubagentView.tsx @@ -48,6 +48,8 @@ import { rootAncestor, } from './subagent-detect.ts' import { subagentCatalogs } from './subagent-catalog.ts' +import { sessionMetrics } from './session-metrics.ts' +import { hasTranscriptAside, openTranscriptAside } from './subagent-chat.ts' import { teamMembersOf, teamProjectionOf } from './team-projection.ts' import { treeSessionIds } from './subagent-lineage.ts' import { orderJobs, type TreeJob } from './subagent-jobs.ts' @@ -205,6 +207,9 @@ export function SubagentView(props: { // The projected per-parent catalogs, already folded into the view shape the // topology consumes (see subagent-catalog.ts). const catalogs = useMemo(() => subagentCatalogs(list.projectionsBySession), [list.projectionsBySession]) + // Token usage and turn timing ride the same snapshot: the popover's two + // extra facts are read here, not fetched (see ./session-metrics.ts). + const metrics = useMemo(() => sessionMetrics(list.projectionsBySession), [list.projectionsBySession]) // The topology root: the main agent of the current session's tree. const rootId = useMemo(() => rootAncestor(byId, sessionId), [byId, sessionId]) @@ -266,6 +271,7 @@ export function SubagentView(props: { rootId, currentSessionId: sessionId, live, + metrics, runs, teamMembers, teamTasks: team?.tasks ?? [], @@ -273,7 +279,7 @@ export function SubagentView(props: { foldedIds, expandedGroups, })), - [byId, catalogs, rootId, sessionId, live, runs, teamMembers, team, folded, foldedIds, expandedGroups], + [byId, catalogs, rootId, sessionId, live, metrics, runs, teamMembers, team, folded, foldedIds, expandedGroups], ) /** @@ -293,7 +299,16 @@ export function SubagentView(props: { else sessions.openSubagent?.(target) }, [ctx, sessions]) - const openChild = useCallback((address: SidebarSubagentAddress): void => { + /** + * Show one child session. `'side'` (the default) hands the transcript to the + * host's OWN right-sidebar tab and leaves the main column alone — that is the + * native affordance the host's subagent list uses, and it is skipped when the + * deployment cannot host it (no `subagentchat` type, no right column, or no + * mounted seat). `'main'` is the old behavior: the shell re-roots the Tasks + * page on the child and the main view follows. + */ + const openChild = useCallback((address: SidebarSubagentAddress, place: 'side' | 'main' = 'side'): void => { + if (place === 'side' && openTranscriptAside(ctx, address)) return // Notify the shell first: the jump switches the sidebar to the child // session's own layout, and the shell re-opens the Tasks page on top // of it (the topology stays rooted at the main agent with the child @@ -304,7 +319,7 @@ export function SubagentView(props: { } catch (error) { console.error('[dsh-better-sidebar] open subagent failed:', error) } - }, [openConversation, onOpenChild]) + }, [ctx, openConversation, onOpenChild]) /** Jump back to the main agent (the topology root) from its node. */ const openMain = useCallback((): void => { @@ -325,9 +340,9 @@ export function SubagentView(props: { }, [sessions]) /** Jump from the detail window into the node's transcript. */ - const jumpToNode = useCallback((node: TasksAgentNode): void => { + const jumpToNode = useCallback((node: TasksAgentNode, place: 'side' | 'main' = 'side'): void => { if (node.childAddress !== undefined) { - openChild(node.childAddress) + openChild(node.childAddress, place) setPopover(null) return } @@ -337,6 +352,13 @@ export function SubagentView(props: { } }, [openChild, openMain]) + /** + * Whether this deployment can host a child transcript in its right column. + * Read once per ctx (the services arrive with the profile, not later), and it + * drives whether the detail window offers the choice at all. + */ + const asideAvailable = useMemo(() => hasTranscriptAside(ctx), [ctx]) + /** Fold one settled node into its parent's aggregate (its card's chevron). */ const foldNode = useCallback((node: TasksAgentNode): void => { setFoldedIds(current => { @@ -503,6 +525,7 @@ export function SubagentView(props: { return ( diff --git a/src/client/TasksGraph.tsx b/src/client/TasksGraph.tsx index f0973a33..7a3d8a2b 100644 --- a/src/client/TasksGraph.tsx +++ b/src/client/TasksGraph.tsx @@ -41,10 +41,11 @@ import { type GraphBox, } from './tasks-graph-layout.ts' import { - activityLine, agentIdentity, agentMeta, foldErrorTally, foldPreviews, foldTally, + activityLine, agentChip, agentMeta, foldErrorTally, foldPreviews, FoldGlyph, foldTally, TaskLine, WorkflowGlyph, workflowMeta, } from './tasks-shared.tsx' import { CardBar, CardTop, phaseClass, type CardKind } from './tasks-card.tsx' +import { useAutoAnimateRef } from './use-auto-animate.ts' import { t } from './locales.ts' import css from './tasks-graph.module.css' import canvasCss from './tasks-canvas.module.css' @@ -185,6 +186,14 @@ export function TasksGraph(props: TasksGraphProps): ReactNode { onFoldNode, mode, onModeChange, loading, } = props const containerRef = useRef(null) + /** + * The cards' own layer: FLIP-animated, so folding a group makes the cards + * leave (and the canvas re-slot) instead of blinking. The layer is the + * canvas's scaled child, so a move animation is scaled with the zoom — see + * use-auto-animate.ts. + */ + const cardsRef = useRef(null) + useAutoAnimateRef(cardsRef) const [tf, setTf] = useState({ x: 0, y: 0, k: 1 }) const [dragging, setDragging] = useState(false) /** Pointer travel of the in-flight gesture (click suppression). */ @@ -441,6 +450,7 @@ export function TasksGraph(props: TasksGraphProps): ReactNode {
)}
@@ -646,12 +658,14 @@ function renderWorkflowNode( /** * One fold aggregate node: the finished or the waiting members of one parent, - * collapsed. Its bar is the action row (expand THIS group), so the whole card - * stays one click target. + * collapsed. Its bar is the action row — the group's own glyph, the word that + * names what a click does, and the expand chevron — so the whole card stays one + * click target. * - * The count is printed ONCE: the badge names it, so the bar only carries what - * the badge cannot say — a stray failure ("出错 N" would otherwise hide inside - * the ✓) — beside the expand chevron. The full tally stays the card's + * The count is printed ONCE: the badge above names it, so the bar carries the + * ACTION instead (a bare chevron in an otherwise empty strip read as a broken + * card), plus the one fact the badge cannot say — a stray failure ("出错 N" + * would otherwise hide inside the ✓). The full tally stays the card's * accessible name and tooltip, which a screen reader reads instead of the * badge's inner text. */ @@ -686,8 +700,10 @@ function renderFoldNode( extraClass={css.cardNamePlain} /> + + {t('tasksFoldExpandShort')} {errors !== undefined && ( - {errors} + {errors} )}