fix(tasks): restore graph expansion and configurable branch folding

Reset per-gesture travel before node guards so a preceding background pan cannot suppress the next card click. Index and iteratively lay out graph topology, memoize agent card contents, and project complete settled branches under independent existing-settings preferences.

Keep unknown real workflow catalogs and explicitly opened descendant paths visible. Add regression coverage and real rc.1 browser/baseline validation evidence.
This commit is contained in:
Menghuan1918 committed 2026-10-23 12:38:23 +08:00
1 parent 0fab0afdbb
commit 787d873a8c
41 files changed
+1230 -242

No files matched your search

+7
View File
@@ -2,6 +2,13 @@
> 本文档收录 dsh-better-sidebar 的完整发布历史(最新版摘要见 [README](README_ZH.md);同步发布于 [GitHub Releases](https://github.com/omdsh-dev/DSH-better-sidebar/releases))。
### 未发布
- **任务图展开修复**:平移画布后,聚合卡和 Agent 卡的下一次点击不再被误判为拖动;展开聚合与查看详情恢复正常。
- **任务图性能**:卡片内容使用独立 memo 边界,平移与布局补间不再重复渲染内容;布局用索引和显式栈替代逐边查找与深递归,同次宽度适配复用相同列数的布局。2000 个非根 Agent 的纯布局对照及 200/500 Agent 真浏览器证据见[验证记录](docs/plans/2026-10-23-tasks-folding-performance-validation.md),布局加速不外推为整页加速。
- **已结束分支整体聚合**:只有整条分支全部结束才自动聚合;仍有运行后代、当前查看路径或未知子代理目录的分支保持可见,聚合计数覆盖隐藏的 Agent 后代。
- **四项独立自动规则**:复用设置齿轮与现有偏好存储,分别控制已结束叶子聚合、已结束分支聚合、同一父级至少 3 个空闲队友聚合(workflow 内沿用原规则,也受空闲开关控制),以及 Agent 总数至少 8 个时后台任务抽屉自动收起,默认全部开启。未手动操作时设置即时生效;手动展开或收起始终优先。
### v0.28.0
- **正式版支持线前移到 DSH 0.2.1-rc.1+**:13 条 DSH peer 下限统一为 `^0.2.1-rc.1`,开发依赖、CI 与安装脚本使用精确 RC 基线。不新增运行时兼容层、不改功能实现。
+3 -1
View File
@@ -1032,7 +1032,9 @@ ctx.effect(() =>
)
```
> ⚠️ **`toggles` 的 key 必须是本插件 `PrefsSchema` 的字段**(`PrefsSchema` 已并入本插件 Loader 行的 `Config`;内置键:`autoOpenSubagent` / `autoOpenJobs` / `tasksViewMode` / `mobileNoAutoOpen` / `mobileDefaultTree` / `agentOpenTools` / `editorExplorer` / `editorGitGutter` / `explorerExclude` / `customCss` / `htmlViewerNoSandbox` / `htmlViewerDefaultUnsafe` / `tabsEnabled` / `viewersEnabled` / `pluginSettings`;**已删除**:`workspaceFence`(v0.23.0,围栏整体移除,见 §8.1)/ `titleBarScheme` / `titleBarPresetId` / `titleBarCompat` / `titleBarStripPx`(titleBar 让位机制整体移除,见 §12.1)/ `agentTerminalTools` / `terminalShell` / `terminalShellArgs` / `terminalFontFamily` / `terminalFontSize` / `bottomPanelAutoTerminal` / `browserNoSandbox` / `browserAllowedLoopback` / 三个按协议分流的旧外链接管键)。**v0.12.0 起设置 seam 已开放**:你自己的设置走 `pluginToggles`(声明式行)或 `render`(自定义面板),值持久化在 `pluginSettings[id]`——不再需要本插件的 schema 字段,也不再被 seam 丢弃。值须 JSON 可序列化(行控件只产出 string/number/boolean;自定义面板自行负责)。
> ⚠️ **`toggles` 的 key 必须是本插件 `PrefsSchema` 的字段**(`PrefsSchema` 已并入本插件 Loader 行的 `Config`;内置键:`autoOpenSubagent` / `autoOpenJobs` / `tasksViewMode` / `tasksAutoFoldSettled` / `tasksAutoFoldBranches` / `tasksAutoFoldIdle` / `jobsAutoCollapse` / `mobileNoAutoOpen` / `mobileDefaultTree` / `agentOpenTools` / `editorExplorer` / `editorGitGutter` / `explorerExclude` / `customCss` / `htmlViewerNoSandbox` / `htmlViewerDefaultUnsafe` / `tabsEnabled` / `viewersEnabled` / `pluginSettings`;**已删除**:`workspaceFence`(v0.23.0,围栏整体移除,见 §8.1)/ `titleBarScheme` / `titleBarPresetId` / `titleBarCompat` / `titleBarStripPx`(titleBar 让位机制整体移除,见 §12.1)/ `agentTerminalTools` / `terminalShell` / `terminalShellArgs` / `terminalFontFamily` / `terminalFontSize` / `bottomPanelAutoTerminal` / `browserNoSandbox` / `browserAllowedLoopback` / 三个按协议分流的旧外链接管键)。**v0.12.0 起设置 seam 已开放**:你自己的设置走 `pluginToggles`(声明式行)或 `render`(自定义面板),值持久化在 `pluginSettings[id]`——不再需要本插件的 schema 字段,也不再被 seam 丢弃。值须 JSON 可序列化(行控件只产出 string/number/boolean;自定义面板自行负责)。
任务管理卡片的原有齿轮还提供四个默认开启的布尔偏好:`tasksAutoFoldSettled` 仅自动折叠已结束且无子 Agent 的叶子任务;`tasksAutoFoldBranches` 仅在整条分支全部结束时聚合(含运行中后代的分支不自动折叠),此开关独立于叶子开关,关闭叶子折叠不影响全结束分支聚合;`tasksAutoFoldIdle` 在同一父级至少 3 个队友空闲时聚合(workflow 内沿用原有不设数量阈值的聚合规则,也受此开关控制);`jobsAutoCollapse` 在 Agent 总数达到 8 时自动收起后台任务抽屉,仍保留手动展开/收起。它们沿用 `PrefsSchema` → Loader `Config` 的 volatile 设置路径,修改实时生效、不重挂插件;旧文档缺字段或客户端读到非布尔值时回退 `true`,显式 `false` 保留。
### 8.2 宿主设置表单(DSH 0.1.7+:`SettingsForms`)
@@ -0,0 +1,91 @@
# 任务页展开、性能与自动折叠设置验证(2026-10-23)
## 范围与行为
基点 `0fab0afdbb2eff6294caa49b4b6aab8ffbc01f0b`,修复分支 `fix/tasks-folding-performance`。本批只改插件,不修改 DSH 源码、用户 profile 或发布版本。用户最终选择通过 PR 合入 `dev`,不直接本地集成。
- 图模式的背景平移会留下上一手势的移动量;下一次节点 pointerdown 先清零,避免聚合展开和 Agent 详情点击被吞。回归使用完整 pointerdown → pointerup → click,不用孤立 click 代替真实手势。
- Agent 卡内容有独立 memo 边界,语言签名进入 key;布局用 id 索引、显式栈和单次宽度适配内的列数复用,不新增全局缓存、轮询、路由或存储。
- 自动聚合只吞整条已结束且目录已知的分支;当前查看路径、运行后代和未知目录保持可达。聚合成员覆盖所有隐藏 Agent 后代,不把 workflow 本身计为 Agent。
- 现有设置齿轮增加四个默认 `true` 的独立偏好:`tasksAutoFoldSettled`(已结束叶子)、`tasksAutoFoldBranches`(整条已结束分支)、`tasksAutoFoldIdle`(空闲队友)、`jobsAutoCollapse`(Agent 总数至少 8 时收起后台任务抽屉)。普通空闲队友阈值仍为同父级 3 个;workflow 内保留原有不设数量阈值的规则,也受空闲开关控制。
- 偏好走现有 volatile Config,未手动操作时实时生效;手动展开/收起优先。叶子与分支开关独立,不新增总开关。
## 审查闭环
Standards 与 Spec 两轴独立审查。Standards 没有确认的硬规则违反或值得额外抽象的坏味道。Spec 发现的两项已先红后绿修复并复审:
1. 从 workflow 成员合成的**真实会话**缺目录时,原实现误用纯占位成员的已知叶子豁免。现在只有没有真实 child address 的占位成员才可豁免,done/idle 均保护未知目录。
2. 用户展开后代聚合组后,祖先稍后结束会再次自动吞掉后代。现在在已有反向预序中将展开保护传至所有祖先,显式手动折叠祖先仍优先。
`tests/tasks-model.spec.ts` 从 43 项增加为 54 项,覆盖两种状态、目录就绪后恢复聚合、多层祖先、workflow 穿透、手动收回、兄弟隔离及 12000 层深链。两个原 workflow fixture 补充了已知空目录,不再把未知目录自动折叠当作正常前提。独立模型测试 54/54 通过,`pnpm typecheck` 通过。
## 真实浏览器
宿主精确钉 `@deepseek-ai/dsh@0.2.1-rc.1`;本机用已缓存 CLI,并核验 `--version`。全部通过 `scripts/e2e-context.sh --variant no-context --grep 'tasks graph'` 在全新 scratch profile 上挂载真实 tarball;没有调用模型,Agent 会话由仅测试用宿主 fixture 通过公开服务播种。
两个 tarball 都叫 0.28.0,必须按路径区分,不能按版本名或浮动 dist-tag 区分:
| 包 | 相对仓库路径 | SHA-256 |
|---|---|---|
| 修复包 | `dsh-better-sidebar-0.28.0.tgz` | `6a36a4854d291cb6aae7a56adaf37fb8a296f56d19a53ab093cd43e623ff39ac` |
| 基线包 | `.worktrees/tasks-baseline/dsh-better-sidebar-0.28.0.tgz` | `d40bd48d9b64fc7b546937e411fb1afc5f7d8b43bae0be4fcd5a98f2d7bdd668` |
### 完整交互回归
| 包 / Agent 数(不含根) | 结果 | 点击至完整节点数后两帧 | Long Task |
|---|---|---:|---:|
| 初始修复包 / 10(校准) | 通过 | 8.4 ms | 0 |
| 最终修复包 / 200 | 通过,201 节点 | 21.8 ms | 0 |
| 最终修复包 / 500 | 通过,501 节点 | 44.5 ms | 0 |
| 基线包 / 200 | **预期失败,复现原问题** | 平移后点击 60 秒仍为 2 节点,预期 201 | 未计时完成 |
通过内容包括:聚合卡完整计数 → 真鼠标背景平移 → 点击聚合展开 → 再平移 → 点击 Agent 打开详情 → Escape 关闭 → 手动折回聚合;pageerror 和 console error 均为空。10-Agent 校准包早于 Spec 边界修复,最终验收以 200/500 为准。
### 同口径纯展开测量
为避免旧包已知的拖后点击问题阻止性能采样,设置 `DSH_E2E_TASKS_MEASURE_ONLY=1`,只省略初次平移与测量后的交互,真实点击、完整节点数断言、两帧采样和错误断言仍为共同路径。这些结果**不能代替完整交互回归**。
| Agent 数(不含根) | 修复包 | 基线包 | Long Task(两版) |
|---|---:|---:|---:|
| 200 | 26.0 ms | 22.1 ms | 0 |
| 500 | 65.9 ms | 62.2 ms | 0 |
每格为一次真浏览器采样,不是统计中位;包含 React、布局、DOM、绘制和帧等待。两版数量级相近,**没有据此证明整页展开更快**。性能收益的明确证据是下节纯布局对照,不能把布局加速倍数外推到整页。
复跑示例(先 `pnpm build && pnpm pack`;`DSH_CMD` 指向已核验 rc.1 的可执行 CLI):
```bash
DSH_E2E_CONTEXT_AGENTS=500 \
NODE_OPTIONS=--max-old-space-size=4096 \
DSH_CMD='/absolute/path/to/rc.1/dsh' \
TARBALL="$PWD/dsh-better-sidebar-0.28.0.tgz" \
bash scripts/e2e-context.sh --variant no-context --grep 'tasks graph'
```
测量模式另设 `DSH_E2E_TASKS_MEASURE_ONLY=1`;基线只换 `TARBALL` 为上表基线路径。Playwright 附件 `tasks-graph-paint.json` 保存原始 elapsed/cards/longTasks。最终浏览器原始附件保存在本机 `/tmp/tasks-browser-evidence.XPiy9D/`,日志为 `/tmp/tasks-final-*.log`;这些临时路径不是仓库发布产物。
## 纯布局基线对照
实际 UI 入口 `layoutTasksGraphForWidth(nodes, 360, 0.78)`,N **含根节点**。两版同一个 Node 进程导入,输入数组相同且运行前后 digest 不变;每 case/实现预热 8 次,11 个交错样本取中位,交替先运行修复版/基线版。平铺 parentId=root;深链每节点 parentId=前一节点。
| 节点数(含根) | 平铺基线 → 修复(ms) | 减少 | 深链基线 → 修复(ms) | 减少 |
|---|---:|---:|---:|---:|
| 501 | 1.916 → 0.271 | 85.86% | 11.196 → 0.358 | 96.80% |
| 1001 | 7.716 → 0.315 | 95.92% | 42.027 → 0.336 | 99.20% |
| 2001 | 14.549 → 0.590 | 95.95% | 174.334 → 0.770 | 99.56% |
单命令 `bash /tmp/tasks-layout-bench/run.sh`,exit 0。原始 11 样本、输入/source/bundle SHA-256 与运行环境在 `/tmp/tasks-final-layout-benchmark.json`。同机当时有浏览器验证,loadavg 约 12.5/10 核,绝对毫秒仅参考,结论基于同进程交错的相对中位。2000 个非根 Agent 的布局耗时至少减少 50% 的目标达成;布局坐标/顺序及深链安全由对应 spec 验证,不以计时 harness 代替行为测试。
## 既有 fs-watch 偶发失败
没有修改 watcher 或它的测试。首次全量失败后,独立复跑得到:工作树 18 轮,14 通过 / 4 失败;未改动的基点 worktree 12 轮,11 通过 / 1 失败。失败同为单次写入后 15 秒未收到 notice(spec 的断言行 50 或 111),基线也会复现,不能算本批引入的回归,也不能把这些失败记作通过。
依赖闭包的 diff 为空;纯 Node 的单次写最小探针 60/60 送达,仍不足以证明 vitest/macOS 组合下是事件丢失还是延迟。保留该风险,不为本任务修改无关生产逻辑或用重试掩盖失败。原始记录 `/tmp/tasks-resume-fs-watch*.log`。
## 最终门禁
- 已通过:`pnpm build && pnpm pack`、`pnpm check:consumer-types`、`pnpm check:engines`、`pnpm typecheck`、`pnpm lint`、`git diff --check`。
- 正常权限下默认并行 `pnpm test`:220 文件通过 / 1 文件失败,2718 passed / 1 failed / 17 skipped。唯一失败为上述既有 `fs-watch` 单次写入 notice 超时;未忽略或修改断言。
- `pnpm test --maxWorkers=1`:**221 文件全部通过,2719 passed / 17 skipped,exit 0**(110.89 秒)。包含 watcher 6/6、任务页 63/63、任务模型 54/54、布局 14/14。仅切换仓库已有单 worker 执行方式,没有跳过失败项、重写断言或更改测试预算;这次通过不代表既有 watcher flake 已修复。
- `pnpm test:mount`(精确 rc.1):**13 passed / 4 skipped,exit 0**(2.7 分钟)。包含原生唯一终端条目、真实 xterm、tab sweep、页内重新注册、Git、文件树与稳态检查;4 个需要专门 Context profile/scale env 的用例按设计跳过,scale 完整回归已由上节专门 lane 独立验证。
- 初次受限沙箱运行的 npm cache/home-relative 临时文件 EPERM 不是产品失败;受限挂载的终端用例失败在正常权限下重跑通过,未修改终端代码。所有早期失败保留日志,不用后一次通过改写早期结果。
+4 -2
View File
@@ -117,6 +117,8 @@ export interface JobsDrawerProps {
observed: SidebarObservedJob | undefined
/** Agent count of the tree (root included) — the auto-collapse signal. */
agentCount: number
/** Follow the agent-count collapse rule unless the reader overrides it. */
autoCollapse?: boolean
/** Open the output popover of one row (anchor = the row's main button). */
onOpenOutput(row: TreeJob, anchor: HTMLElement): void
/** The job whose output popover is currently open (row highlight). */
@@ -128,8 +130,8 @@ export interface JobsDrawerProps {
}
export function JobsDrawer(props: JobsDrawerProps): ReactNode {
const { rows, agentCount, jobs, onOpenOutput, openJobId, visible = true } = props
const autoOpen = agentCount < JOBS_DRAWER_COLLAPSE_AT
const { rows, agentCount, jobs, onOpenOutput, openJobId, visible = true, autoCollapse = true } = props
const autoOpen = !autoCollapse || agentCount < JOBS_DRAWER_COLLAPSE_AT
/** Manual override; undefined = follow the auto rule. */
const [manualOpen, setManualOpen] = useState<boolean | undefined>(undefined)
const open = manualOpen ?? autoOpen
+18 -9
View File
@@ -73,6 +73,7 @@ import { TaskWindow } from './TaskWindow.tsx'
import type { SidebarStore } from './state.ts'
import type { WorkflowRunView } from '../workflow-runs.ts'
import type { ProcessActivitySummary } from '../process-activity.ts'
import { SIDEBAR_PREFS_DEFAULTS } from '../prefs-shared.ts'
import legacy from './SubagentView.module.css'
/** Poll cadence of the live "last text + tool call" lines while a child runs. */
@@ -334,18 +335,21 @@ export function SubagentView(props: {
// `mobileDefaultTree` preference swaps that default to the classic tree —
// only the default: the toggle below still flips this session's page.
const narrow = useNarrowViewport()
const prefsMode = useSyncExternalStore(
// getPrefs() returns a copy; the snapshot's prefs keep their identity until
// setPrefs(), so unrelated sidebar updates do not re-render this page.
const prefs = useSyncExternalStore(
useMemo(() => (callback: () => void) => store?.subscribe(callback) ?? (() => {}), [store]),
useCallback((): 'graph' | 'tree' => {
const prefs = store?.getPrefs()
if (narrow && prefs?.mobileDefaultTree === true) return 'tree'
return prefs?.tasksViewMode ?? 'graph'
}, [store, narrow]),
useCallback(() => store?.getSnapshot().prefs ?? SIDEBAR_PREFS_DEFAULTS, [store]),
)
const prefsMode = narrow && prefs.mobileDefaultTree ? 'tree' : prefs.tasksViewMode
const [modeOverride, setModeOverride] = useState<'graph' | 'tree' | undefined>(undefined)
const mode = modeOverride ?? prefsMode
const [folded, setFolded] = useState(true)
const [foldOverride, setFoldOverride] = useState<boolean | undefined>(undefined)
const autoFoldSettled = foldOverride ?? prefs.tasksAutoFoldSettled
const autoFoldBranches = foldOverride ?? prefs.tasksAutoFoldBranches
const autoFoldIdle = foldOverride ?? prefs.tasksAutoFoldIdle
const folded = autoFoldSettled || autoFoldBranches || autoFoldIdle
/**
* Nodes the reader folded by hand from their own card bar. Kept apart from
* `folded` (the global rule) so the control cluster and a single card never
@@ -383,10 +387,14 @@ export function SubagentView(props: {
teamMembers,
teamTasks: team?.tasks ?? [],
folded,
autoFoldSettled,
autoFoldBranches,
autoFoldIdle,
foldedIds,
expandedGroups,
})),
[byId, catalogs, rootId, sessionId, live, metrics, runs, teamMembers, team, folded, foldedIds, expandedGroups],
[byId, catalogs, rootId, sessionId, live, metrics, runs, teamMembers, team, folded,
autoFoldSettled, autoFoldBranches, autoFoldIdle, foldedIds, expandedGroups],
)
/**
@@ -557,7 +565,7 @@ export function SubagentView(props: {
*/
const toggleFold = useCallback((): void => {
if (!folded) setExpandedGroups(current => (current.size === 0 ? current : new Set()))
setFolded(!folded)
setFoldOverride(!folded)
}, [folded])
/** Open the shared task window from a board row (undefined = create). */
@@ -807,6 +815,7 @@ export function SubagentView(props: {
<JobsDrawer
rows={jobRows}
agentCount={agentCount}
autoCollapse={prefs.jobsAutoCollapse}
jobs={treeJobs.jobs}
observed={observedJob}
openJobId={popover?.kind === 'job' ? popover.jobId : undefined}
+48 -25
View File
@@ -20,6 +20,7 @@
* empty canvas shows the same hint as the tree (`loading`).
*/
import {
memo,
useCallback,
useEffect,
useMemo,
@@ -55,7 +56,7 @@ import {
foldTally, TaskLine, WorkflowGlyph, workflowMeta,
} from './tasks-shared.tsx'
import { CardBar, CardTop, phaseClass, type CardKind } from './tasks-card.tsx'
import { t } from './locales.ts'
import { localeSignature, t } from './locales.ts'
import css from './tasks-graph.module.css'
import canvasCss from './tasks-canvas.module.css'
@@ -418,10 +419,12 @@ export function TasksGraph(props: TasksGraphProps): ReactNode {
const onPointerDown = useCallback((event: ReactPointerEvent<HTMLDivElement>): void => {
if (event.button !== 0) return
stopGlide()
// Click suppression belongs to ONE gesture. A node's next pointerdown
// must release the previous background pan before the node guard returns.
travelRef.current = 0
const target = event.target as HTMLElement
if (target.closest('[data-graph-node]') !== null) return
if (target.closest('[data-graph-controls]') !== null) return
travelRef.current = 0
const startX = event.clientX
const startY = event.clientY
const { x, y } = tfRef.current
@@ -645,6 +648,46 @@ function renderAgentNode(
clickAllowed: () => boolean,
onFold?: (node: TasksAgentNode) => void,
): ReactNode {
const settled = node.state === 'done' || node.state === 'error'
return (
<div
key={node.id}
data-graph-node={node.id}
data-depth={node.depth}
role="button"
tabIndex={-1}
aria-label={`${node.label} ${agentMeta(node)}`}
aria-current={node.current ? 'true' : undefined}
className={clsx(
css.node,
node.team?.role === 'teammate' && css.nodeTeam,
node.current && css.nodeCurrent,
settled && !node.current && css.nodeSettled,
node.state === 'error' && css.nodeError,
)}
style={style}
onClick={(event) => {
if (!clickAllowed()) return
onNodeInfo(node, event.currentTarget)
}}
>
<AgentCardContents
key={localeSignature()}
node={node}
onOpenTask={onOpenTask}
onFold={onFold}
/>
</div>
)
}
/** Position changes do not rebuild the card's text, badges or task controls. */
const AgentCardContents = memo(function AgentCardContents(props: {
node: TasksAgentNode
onOpenTask: (taskId: string, anchor: HTMLElement) => void
onFold: ((node: TasksAgentNode) => void) | undefined
}): ReactNode {
const { node, onOpenTask, onFold } = props
const settled = node.state === 'done' || node.state === 'error'
/**
* Whether this card offers its own fold chevron. A WAITING member counts:
@@ -672,27 +715,7 @@ function renderAgentNode(
*/
const tail = node.live?.text === undefined ? undefined : flatten(node.live.text)
return (
<div
key={node.id}
data-graph-node={node.id}
data-depth={node.depth}
role="button"
tabIndex={-1}
aria-label={`${node.label} ${agentMeta(node)}`}
aria-current={node.current ? 'true' : undefined}
className={clsx(
css.node,
node.team?.role === 'teammate' && css.nodeTeam,
node.current && css.nodeCurrent,
settled && !node.current && css.nodeSettled,
node.state === 'error' && css.nodeError,
)}
style={style}
onClick={(event) => {
if (!clickAllowed()) return
onNodeInfo(node, event.currentTarget)
}}
>
<>
<CardTop
kind={agentCardKind(node)}
depth={node.depth}
@@ -711,9 +734,9 @@ function renderAgentNode(
? { onFold: () => { onFold(node) } }
: {})}
/>
</div>
</>
)
}
})
/** One workflow run node card: same frame, its own badges and state. */
function renderWorkflowNode(
+18 -2
View File
@@ -153,8 +153,8 @@ export function builtinTabs(ctx: Context): readonly TabDescriptor[] {
icon: tasksTabIcon,
order: 30,
single: true,
// Declarative settings: the auto-open switches render under this row in
// the Side card settings page (the Tasks page's related settings).
// Declarative settings: auto-open, default view, task folding, and the
// jobs drawer switches share the existing Tasks card's settings gear.
settings: {
toggles: [{
key: 'autoOpenSubagent',
@@ -181,6 +181,22 @@ export function builtinTabs(ctx: Context): readonly TabDescriptor[] {
desc: () => t('settingsViewModeTreeDesc'),
},
],
}, {
key: 'tasksAutoFoldSettled',
title: () => t('settingsTasksAutoFoldSettledTitle'),
desc: () => t('settingsTasksAutoFoldSettledDesc'),
}, {
key: 'tasksAutoFoldBranches',
title: () => t('settingsTasksAutoFoldBranchesTitle'),
desc: () => t('settingsTasksAutoFoldBranchesDesc'),
}, {
key: 'tasksAutoFoldIdle',
title: () => t('settingsTasksAutoFoldIdleTitle'),
desc: () => t('settingsTasksAutoFoldIdleDesc'),
}, {
key: 'jobsAutoCollapse',
title: () => t('settingsJobsAutoCollapseTitle'),
desc: () => t('settingsJobsAutoCollapseDesc'),
}],
},
component: ({ ctx, store, scope, visible, onSubagentJump }) => (
+8
View File
@@ -342,6 +342,14 @@ export const ar: Record<string, string> = {
settingsSubagentDesc: 'عندما تُنشئ المحادثة الحالية وكيلاً فرعياً جديداً، تُنشأ صفحة المهام في البطاقة الجانبية وتُعلَّم بنقطة غير مقروءة؛ وإذا كانت البطاقة الجانبية مفتوحة على صفحة أخرى فلا تُستولى عليها — انقر النقطة للانتقال إليها؛ وفي الشاشات العريضة تُوسَّع البطاقة الجانبية أيضاً، أما في الشاشات الضيقة فلا يُفرض فتح الدرج بملء الشاشة؛ أوقف الخيار للتوقف عن إنشائها تلقائياً',
settingsJobsTitle: 'تفعيل صفحة المهام تلقائياً عند ظهور مهمة خلفية جديدة',
settingsJobsDesc: 'عند ظهور مهمة خلفية جديدة للمحادثة الحالية، تُنشأ صفحة المهام في البطاقة الجانبية وتُعلَّم بنقطة غير مقروءة (كل مهمة جديدة تُطلق الإنشاء)؛ وإذا كانت البطاقة الجانبية مفتوحة على صفحة أخرى فلا تُستولى عليها — انقر النقطة للانتقال إليها؛ وفي الشاشات العريضة تُوسَّع البطاقة الجانبية أيضاً، أما في الشاشات الضيقة فلا يُفرض فتح الدرج بملء الشاشة؛ أوقف الخيار للتوقف عن إنشائها تلقائياً',
settingsTasksAutoFoldSettledTitle: 'الطي التلقائي للمهام الورقية المنتهية',
settingsTasksAutoFoldSettledDesc: 'يتم طي المهام الورقية التي اكتملت أو فشلت أو توقفت ولا تحتوي على وكلاء فرعيين تلقائياً؛ مفعّل افتراضياً',
settingsTasksAutoFoldBranchesTitle: 'الطي التلقائي للفروع المنتهية فقط',
settingsTasksAutoFoldBranchesDesc: 'لا يتم طي الفرع تلقائياً إلا عندما ينتهي الفرع بأكمله؛ والفروع التي بها فروع تابعة قيد التشغيل لا تُطوى أبداً؛ مفعّل افتراضياً',
settingsTasksAutoFoldIdleTitle: 'الطي التلقائي لأعضاء الفريق الخاملين',
settingsTasksAutoFoldIdleDesc: 'يتم طي أعضاء الفريق الخاملين تلقائياً عندما يبلغ عددهم 3 أو أكثر وهم ينتظرون تعليمات جديدة؛ مفعّل افتراضياً',
settingsJobsAutoCollapseTitle: 'الطي التلقائي لدرج المهام الخلفية',
settingsJobsAutoCollapseDesc: 'يتم طي درج المهام الخلفية تلقائياً عندما يبلغ إجمالي الوكلاء 8 أو أكثر؛ ويبقى المفتاح اليدوي متاحاً؛ مفعّل افتراضياً',
settingsToolsTitle: 'حقن أدوات الطرفية للنموذج',
settingsToolsDesc: 'عند التفعيل، يمكن للنموذج إنشاء وتشغيل طرفيات الشريط الجانبي عبر أدوات terminal_* الثمانية (معطّل افتراضياً)',
settingsBottomTerminalTitle: 'فتح طرفية تلقائياً عند أول توسيع للوحة السفلية',
+8
View File
@@ -327,6 +327,14 @@ export const de: Record<string, string> = {
settingsSubagentDesc: 'Wenn die aktuelle Unterhaltung einen neuen Subagenten erzeugt, wird die Aufgaben-Seite in der Seitenkarte angelegt und mit einem Ungelesen-Punkt markiert; eine Seitenkarte, die bereits eine andere Seite zeigt, wird nicht übernommen – ein Klick auf den Punkt führt dorthin; auf breiten Ansichten wird zusätzlich die Seitenkarte ausgeklappt, auf schmalen Ansichten wird das Öffnen der Vollbild-Schublade nicht erzwungen; ausschalten, um sie nicht mehr automatisch anzulegen',
settingsJobsTitle: 'Aufgaben-Seite bei einer neuen Hintergrundaufgabe automatisch aktivieren',
settingsJobsDesc: 'Sobald für die aktuelle Unterhaltung eine neue Hintergrundaufgabe erscheint, wird die Aufgaben-Seite in der Seitenkarte angelegt und mit einem Ungelesen-Punkt markiert (jede neue Aufgabe löst dies aus); eine Seitenkarte, die bereits eine andere Seite zeigt, wird nicht übernommen – ein Klick auf den Punkt führt dorthin; auf breiten Ansichten wird zusätzlich die Seitenkarte ausgeklappt, auf schmalen Ansichten wird das Öffnen der Vollbild-Schublade nicht erzwungen; ausschalten, um sie nicht mehr automatisch anzulegen',
settingsTasksAutoFoldSettledTitle: 'Abgeschlossene Blattaufgaben automatisch einklappen',
settingsTasksAutoFoldSettledDesc: 'Blattaufgaben, die erledigt, fehlgeschlagen oder gestoppt sind und keine untergeordneten Agenten haben, automatisch einklappen; standardmäßig aktiviert',
settingsTasksAutoFoldBranchesTitle: 'Nur vollständig abgeschlossene Zweige automatisch einklappen',
settingsTasksAutoFoldBranchesDesc: 'Einen Zweig erst automatisch einklappen, wenn der gesamte Zweig abgeschlossen ist; Zweige mit laufenden Nachfahren werden nie eingeklappt; standardmäßig aktiviert',
settingsTasksAutoFoldIdleTitle: 'Inaktive Teammitglieder automatisch einklappen',
settingsTasksAutoFoldIdleDesc: 'Inaktive Teammitglieder automatisch einklappen, sobald mindestens 3 auf neue Anweisungen warten; standardmäßig aktiviert',
settingsJobsAutoCollapseTitle: 'Hintergrundaufgaben-Schublade automatisch einklappen',
settingsJobsAutoCollapseDesc: 'Die Hintergrundaufgaben-Schublade automatisch einklappen, sobald insgesamt mindestens 8 Agenten vorhanden sind; der manuelle Schalter bleibt verfügbar; standardmäßig aktiviert',
settingsToolsTitle: 'Terminal-Werkzeuge für das Modell bereitstellen',
settingsToolsDesc: 'Wenn aktiviert, kann das Modell über die 8 terminal_*-Werkzeuge Terminale in der Seitenleiste erstellen und steuern (standardmäßig deaktiviert)',
settingsBottomTerminalTitle: 'Beim ersten Ausklappen des unteren Panels automatisch ein Terminal öffnen',
+8
View File
@@ -334,6 +334,14 @@ export const fr: Record<string, string> = {
settingsSubagentDesc: 'Lorsqu’un nouveau sous-agent est créé dans la session actuelle, la page Gestion des tâches est créée dans la carte latérale et marquée d’un point non lu ; une carte latérale déjà déployée sur une autre page n’est pas reprise — cliquez sur le point pour vous y rendre ; sur les écrans larges, la carte latérale est aussi déployée, tandis que sur les écrans étroits le tiroir plein écran n’est pas ouvert de force ; désactivez pour ne plus la créer automatiquement',
settingsJobsTitle: 'Activer automatiquement la page Gestion des tâches à l’arrivée d’une tâche d’arrière-plan',
settingsJobsDesc: 'À chaque nouvelle tâche d’arrière-plan dans la session actuelle, la page Gestion des tâches est créée dans la carte latérale et marquée d’un point non lu (chaque nouvelle tâche déclenche l’action) ; une carte latérale déjà déployée sur une autre page n’est pas reprise — cliquez sur le point pour vous y rendre ; sur les écrans larges, la carte latérale est aussi déployée, tandis que sur les écrans étroits le tiroir plein écran n’est pas ouvert de force ; désactivez pour ne plus la créer automatiquement',
settingsTasksAutoFoldSettledTitle: 'Replier automatiquement les tâches feuilles terminées',
settingsTasksAutoFoldSettledDesc: 'Replier automatiquement les tâches feuilles terminées, échouées ou arrêtées qui n’ont aucun sous-agent ; activé par défaut',
settingsTasksAutoFoldBranchesTitle: 'Ne replier que les branches entièrement terminées',
settingsTasksAutoFoldBranchesDesc: 'Une branche n’est repliée automatiquement que lorsque toute la branche est terminée ; une branche avec des descendants en cours d’exécution n’est jamais repliée ; activé par défaut',
settingsTasksAutoFoldIdleTitle: 'Replier automatiquement les membres d’équipe inactifs',
settingsTasksAutoFoldIdleDesc: 'Replier automatiquement les membres d’équipe inactifs dès qu’au moins 3 attendent de nouvelles instructions ; activé par défaut',
settingsJobsAutoCollapseTitle: 'Replier automatiquement le tiroir des tâches d’arrière-plan',
settingsJobsAutoCollapseDesc: 'Le tiroir des tâches d’arrière-plan se replie automatiquement dès qu’il y a au moins 8 agents au total ; la bascule manuelle reste disponible ; activé par défaut',
settingsToolsTitle: 'Injecter des outils de terminal au modèle',
settingsToolsDesc: 'Une fois activé, le modèle peut créer et piloter des terminaux de la barre latérale via les 8 outils terminal_* (désactivé par défaut)',
settingsBottomTerminalTitle: 'Ouvrir automatiquement un terminal au premier déploiement du panneau inférieur',
+8
View File
@@ -341,6 +341,14 @@ export const hi: Record<string, string> = {
settingsSubagentDesc: 'जब वर्तमान वार्तालाप नया सबएजेंट बनाता है, तो साइड कार्ड में कार्य पृष्ठ बनाया जाता है और उस पर अपठित बिंदु लगाया जाता है; किसी अन्य पृष्ठ पर खुला साइड कार्ड अधिग्रहित नहीं किया जाता — वहाँ जाने के लिए बिंदु पर क्लिक करें; चौड़ी स्क्रीन पर साइड कार्ड भी विस्तृत होता है, जबकि संकीर्ण स्क्रीन पर पूर्ण-स्क्रीन दराज जबरन नहीं खोली जाती; स्वतः बनाना बंद करने के लिए इसे बंद करें',
settingsJobsTitle: 'नया बैकग्राउंड कार्य आने पर कार्य पृष्ठ स्वतः सक्रिय करें',
settingsJobsDesc: 'वर्तमान वार्तालाप में हर नया बैकग्राउंड कार्य आने पर साइड कार्ड में कार्य पृष्ठ बनाया जाता है और उस पर अपठित बिंदु लगाया जाता है (हर नया कार्य ट्रिगर करता है); किसी अन्य पृष्ठ पर खुला साइड कार्ड अधिग्रहित नहीं किया जाता — वहाँ जाने के लिए बिंदु पर क्लिक करें; चौड़ी स्क्रीन पर साइड कार्ड भी विस्तृत होता है, जबकि संकीर्ण स्क्रीन पर पूर्ण-स्क्रीन दराज जबरन नहीं खोली जाती; स्वतः बनाना बंद करने के लिए इसे बंद करें',
settingsTasksAutoFoldSettledTitle: 'समाप्त लीफ़ कार्य स्वतः संकुचित करें',
settingsTasksAutoFoldSettledDesc: 'जो लीफ़ कार्य पूर्ण, विफल या रुके हैं और जिनके कोई उप-एजेंट नहीं हैं, उन्हें स्वतः संकुचित करें; डिफ़ॉल्ट रूप से चालू',
settingsTasksAutoFoldBranchesTitle: 'केवल पूरी तरह समाप्त शाखाएँ संकुचित करें',
settingsTasksAutoFoldBranchesDesc: 'शाखा को केवल तब स्वतः संकुचित करें जब पूरी शाखा समाप्त हो जाए; जिन शाखाओं में उप-एजेंट चल रहे हों, वे कभी संकुचित नहीं होतीं; डिफ़ॉल्ट रूप से चालू',
settingsTasksAutoFoldIdleTitle: 'निष्क्रिय टीम सदस्य स्वतः संकुचित करें',
settingsTasksAutoFoldIdleDesc: 'जब 3 या अधिक निष्क्रिय टीम सदस्य नए निर्देशों की प्रतीक्षा कर रहे हों, तो उन्हें स्वतः संकुचित करें; डिफ़ॉल्ट रूप से चालू',
settingsJobsAutoCollapseTitle: 'पृष्ठभूमि कार्य दराज स्वतः संकुचित करें',
settingsJobsAutoCollapseDesc: 'कुल 8 या अधिक एजेंट होने पर पृष्ठभूमि कार्य दराज स्वतः संकुचित करें; मैन्युअल टॉगल उपलब्ध रहता है; डिफ़ॉल्ट रूप से चालू',
settingsToolsTitle: 'मॉडल के लिए टर्मिनल टूल इंजेक्ट करें',
settingsToolsDesc: 'सक्षम होने पर, मॉडल 8 terminal_* टूल्स से साइडबार टर्मिनल बना और चला सकता है (डिफ़ॉल्ट रूप से बंद)',
settingsBottomTerminalTitle: 'निचला पैनल पहली बार खुलने पर स्वतः टर्मिनल खोलें',
+8
View File
@@ -339,6 +339,14 @@ export const id: Record<string, string> = {
settingsSubagentDesc: 'Saat obrolan saat ini membuat subagen baru, halaman Tasks dibuat di kartu samping dan ditandai titik belum dibaca; kartu samping yang sudah terbuka pada halaman lain tidak diambil alih — klik titiknya untuk ke sana; pada layar lebar kartu samping juga dibentangkan, sedangkan pada layar sempit laci layar penuh tidak dipaksa terbuka; matikan untuk berhenti membuatnya otomatis',
settingsJobsTitle: 'Aktifkan otomatis halaman Tasks saat ada tugas latar baru',
settingsJobsDesc: 'Setiap kali tugas latar baru muncul untuk obrolan saat ini, halaman Tasks dibuat di kartu samping dan ditandai titik belum dibaca (setiap tugas baru memicu); kartu samping yang sudah terbuka pada halaman lain tidak diambil alih — klik titiknya untuk ke sana; pada layar lebar kartu samping juga dibentangkan, sedangkan pada layar sempit laci layar penuh tidak dipaksa terbuka; matikan untuk berhenti membuatnya otomatis',
settingsTasksAutoFoldSettledTitle: 'Lipat otomatis tugas daun yang selesai',
settingsTasksAutoFoldSettledDesc: 'Lipat otomatis tugas daun yang telah selesai (berhasil, gagal, atau dihentikan) dan tidak memiliki subagen; aktif secara default',
settingsTasksAutoFoldBranchesTitle: 'Hanya lipat otomatis cabang yang selesai seluruhnya',
settingsTasksAutoFoldBranchesDesc: 'Lipat otomatis cabang hanya setelah seluruh cabang selesai; cabang dengan turunan yang sedang berjalan tidak pernah dilipat; aktif secara default',
settingsTasksAutoFoldIdleTitle: 'Lipat otomatis anggota tim yang menganggur',
settingsTasksAutoFoldIdleDesc: 'Lipat otomatis anggota tim yang menganggur saat ada 3 atau lebih yang menunggu instruksi baru; aktif secara default',
settingsJobsAutoCollapseTitle: 'Lipat otomatis laci tugas latar',
settingsJobsAutoCollapseDesc: 'Laci tugas latar dilipat otomatis saat total agen mencapai 8 atau lebih; tombol manual tetap tersedia; aktif secara default',
settingsToolsTitle: 'Suntik alat terminal untuk model',
settingsToolsDesc: 'Saat diaktifkan, model dapat membuat dan mengendalikan terminal sidebar melalui 8 alat terminal_* (nonaktif secara default)',
settingsBottomTerminalTitle: 'Buka terminal otomatis saat panel bawah pertama kali dibentangkan',
+8
View File
@@ -332,6 +332,14 @@ export const it: Record<string, string> = {
settingsSubagentDesc: 'Quando nella conversazione attuale compare un nuovo sottoagente, la pagina Attività viene creata nella scheda laterale e contrassegnata con un punto non letto; una scheda laterale già espansa su un’altra pagina non viene occupata — fai clic sul punto per andarci; sugli schermi ampi viene espansa anche la barra laterale, mentre sugli schermi stretti il pannello a schermo intero non viene forzato; disattiva per smettere di crearla automaticamente',
settingsJobsTitle: 'Attiva automaticamente la pagina Attività quando compare una nuova attività in background',
settingsJobsDesc: 'Quando nella conversazione attuale compare una nuova attività in background, la pagina Attività viene creata nella scheda laterale e contrassegnata con un punto non letto (l’attivazione avviene per ogni nuova attività); una scheda laterale già espansa su un’altra pagina non viene occupata — fai clic sul punto per andirci; sugli schermi ampi viene espansa anche la barra laterale, mentre sugli schermi stretti il pannello a schermo intero non viene forzato; disattiva per smettere di crearla automaticamente',
settingsTasksAutoFoldSettledTitle: 'Comprimi automaticamente le attività foglia concluse',
settingsTasksAutoFoldSettledDesc: 'Comprimi automaticamente le attività foglia che sono concluse (completate, non riuscite o fermate) e non hanno sottoagenti; attivo per impostazione predefinita',
settingsTasksAutoFoldBranchesTitle: 'Comprimi automaticamente solo i rami conclusi',
settingsTasksAutoFoldBranchesDesc: 'Un ramo viene compresso automaticamente solo quando l’intero ramo è concluso; i rami con discendenti in esecuzione non vengono mai compressi; attivo per impostazione predefinita',
settingsTasksAutoFoldIdleTitle: 'Comprimi automaticamente i membri del team inattivi',
settingsTasksAutoFoldIdleDesc: 'Comprimi automaticamente i membri del team inattivi quando almeno 3 attendono nuove istruzioni; attivo per impostazione predefinita',
settingsJobsAutoCollapseTitle: 'Comprimi automaticamente il pannello dei job in background',
settingsJobsAutoCollapseDesc: 'Il pannello dei job in background si comprime automaticamente quando ci sono almeno 8 agenti in totale; l’interruttore manuale resta disponibile; attivo per impostazione predefinita',
settingsToolsTitle: 'Inietta strumenti del terminale per il modello',
settingsToolsDesc: 'Se attivato, il modello può creare e gestire terminali della barra laterale attraverso gli 8 strumenti terminal_* (disattivato per impostazione predefinita)',
settingsBottomTerminalTitle: 'Apri automaticamente un terminale alla prima espansione del pannello inferiore',
+8
View File
@@ -341,6 +341,14 @@ export const ja: Record<string, string> = {
settingsSubagentDesc: '現在の会話で新しいサブエージェントが発生したとき、サイドカードにタスク管理ページを作成し未読ドットを表示する。右カラムが別のページを展開中の場合はフォーカスを奪わない(ドットをクリックすれば移動できる)。広い画面ではサイドカードも展開するが、狭い画面では全画面ドロワーを強制的に開かない。オフにすると自動作成しない',
settingsJobsTitle: '新規バックグラウンドタスク時にタスク管理ページを自動的にアクティブ化',
settingsJobsDesc: '現在の会話で新しいバックグラウンドタスクが発生するたびに、サイドカードにタスク管理ページを作成し未読ドットを表示する(新規タスクごとに発火)。右カラムが別のページを展開中の場合はフォーカスを奪わない(ドットをクリックすれば移動できる)。広い画面ではサイドカードも展開するが、狭い画面では全画面ドロワーを強制的に開かない。オフにすると自動作成しない',
settingsTasksAutoFoldSettledTitle: '完了したリーフタスクを自動折りたたみ',
settingsTasksAutoFoldSettledDesc: '完了(成功・失敗・停止)し、子エージェントを持たないリーフタスクを自動的に折りたたみます。既定でオン',
settingsTasksAutoFoldBranchesTitle: '完全に終了したブランチのみ自動折りたたみ',
settingsTasksAutoFoldBranchesDesc: 'ブランチ全体が終了した場合にのみ自動的に折りたたみます。実行中の子孫を持つブランチは折りたたまれません。既定でオン',
settingsTasksAutoFoldIdleTitle: 'アイドル状態のチームメンバーを自動折りたたみ',
settingsTasksAutoFoldIdleDesc: '新しい指示を待機しているアイドル状態のチームメンバーが 3 人以上になると自動的に折りたたみます。既定でオン',
settingsJobsAutoCollapseTitle: 'バックグラウンドタスクのドロワーを自動折りたたみ',
settingsJobsAutoCollapseDesc: 'エージェントが合計 8 体以上になるとバックグラウンドタスクのドロワーを自動的に折りたたみます。手動切り替えは引き続き使えます。既定でオン',
settingsToolsTitle: 'モデルにターミナルツールを注入',
settingsToolsDesc: 'オンにすると、モデルが terminal_create 等 8 個のツールでサイドバーターミナルを作成・操作可能(デフォルトオフ)',
settingsBottomTerminalTitle: '下パネル初回展開時に自動でターミナルを開く',
+8
View File
@@ -333,6 +333,14 @@ export const ko: Record<string, string> = {
settingsSubagentDesc: '현재 대화에서 새 서브 에이전트가 생기면 사이드 카드에 작업 관리 페이지를 만들고 읽지 않음 점을 표시합니다. 오른쪽 열이 다른 페이지를 펼쳐 둔 경우에는 포커스를 빼앗지 않습니다(점을 클릭하면 이동). 넓은 화면에서는 사이드 카드도 펼치지만, 좁은 화면에서는 전체 화면 드로어를 강제로 열지 않습니다. 끄면 자동으로 만들지 않습니다',
settingsJobsTitle: '새 백그라운드 작업이 생기면 작업 관리 페이지 자동 활성화',
settingsJobsDesc: '현재 대화에 새 백그라운드 작업이 생길 때마다 사이드 카드에 작업 관리 페이지를 만들고 읽지 않음 점을 표시합니다(새 작업마다 트리거됨). 오른쪽 열이 다른 페이지를 펼쳐 둔 경우에는 포커스를 빼앗지 않습니다(점을 클릭하면 이동). 넓은 화면에서는 사이드 카드도 펼치지만, 좁은 화면에서는 전체 화면 드로어를 강제로 열지 않습니다. 끄면 자동으로 만들지 않습니다',
settingsTasksAutoFoldSettledTitle: '완료된 리프 작업 자동 접기',
settingsTasksAutoFoldSettledDesc: '완료(성공, 실패 또는 중지)되었고 하위 에이전트가 없는 리프 작업을 자동으로 접습니다. 기본적으로 켜짐',
settingsTasksAutoFoldBranchesTitle: '완전히 끝난 분기만 자동 접기',
settingsTasksAutoFoldBranchesDesc: '분기 전체가 끝났을 때만 자동으로 접습니다. 실행 중인 하위 항목이 있는 분기는 절대 접지 않습니다. 기본적으로 켜짐',
settingsTasksAutoFoldIdleTitle: '대기 중인 팀 멤버 자동 접기',
settingsTasksAutoFoldIdleDesc: '새 지시를 기다리는 대기 중 팀 멤버가 3명 이상이면 자동으로 접습니다. 기본적으로 켜짐',
settingsJobsAutoCollapseTitle: '백그라운드 작업 드로어 자동 접기',
settingsJobsAutoCollapseDesc: '전체 에이전트가 8개 이상이면 백그라운드 작업 드로어를 자동으로 접습니다. 수동 전환은 그대로 사용할 수 있습니다. 기본적으로 켜짐',
settingsToolsTitle: '모델에 터미널 도구 주입',
settingsToolsDesc: '켜면 모델이 terminal_create 등 8개 도구로 사이드바 터미널을 만들고 조작할 수 있습니다(기본 꺼짐)',
settingsBottomTerminalTitle: '하단 패널을 처음 펼칠 때 터미널 자동 열기',
+8
View File
@@ -339,6 +339,14 @@ export const nl: Record<string, string> = {
settingsSubagentDesc: 'Wanneer de huidige conversatie een nieuwe subagent start, wordt de Taken-pagina in de zijkaart aangemaakt en met een ongelezen punt gemarkeerd; een zijkaart die al een andere pagina toont, wordt niet overgenomen — klik op het punt om erheen te gaan; op brede schermen wordt ook de zijkaart uitgeklapt, terwijl op smalle schermen het schuifpaneel op volledig scherm niet geforceerd wordt geopend; schakel uit om hem niet meer automatisch aan te maken',
settingsJobsTitle: 'Activeer de Taken-pagina automatisch bij een nieuwe achtergrondtaak',
settingsJobsDesc: 'Wanneer er voor de huidige conversatie een nieuwe achtergrondtaak verschijnt, wordt de Taken-pagina in de zijkaart aangemaakt en met een ongelezen punt gemarkeerd (dit gebeurt bij elke nieuwe taak); een zijkaart die al een andere pagina toont, wordt niet overgenomen — klik op het punt om erheen te gaan; op brede schermen wordt ook de zijkaart uitgeklapt, terwijl op smalle schermen het schuifpaneel op volledig scherm niet geforceerd wordt geopend; schakel uit om hem niet meer automatisch aan te maken',
settingsTasksAutoFoldSettledTitle: 'Voltooide leaf-taken automatisch inklappen',
settingsTasksAutoFoldSettledDesc: 'Leaf-taken die zijn voltooid, mislukt of gestopt en geen onderliggende agents hebben, automatisch inklappen; standaard aan',
settingsTasksAutoFoldBranchesTitle: 'Alleen volledig afgeronde takken automatisch inklappen',
settingsTasksAutoFoldBranchesDesc: 'Een tak wordt alleen automatisch ingeklapt als de hele tak is afgerond; takken met actieve afstammelingen worden nooit ingeklapt; standaard aan',
settingsTasksAutoFoldIdleTitle: 'Inactieve teamleden automatisch inklappen',
settingsTasksAutoFoldIdleDesc: 'Inactieve teamleden automatisch inklappen zodra er minstens 3 op nieuwe instructies wachten; standaard aan',
settingsJobsAutoCollapseTitle: 'De achtergrondtaken-lade automatisch inklappen',
settingsJobsAutoCollapseDesc: 'De achtergrondtaken-lade wordt automatisch ingeklapt zodra er in totaal minstens 8 agents zijn; de handmatige schakelaar blijft beschikbaar; standaard aan',
settingsToolsTitle: 'Terminaltools voor het model injecteren',
settingsToolsDesc: 'Indien ingeschakeld kan het model zijbalk-terminals aanmaken en besturen via de 8 terminal_*-tools (standaard uit)',
settingsBottomTerminalTitle: 'Automatisch een terminal openen bij de eerste uitklap van het onderpaneel',
+8
View File
@@ -343,6 +343,14 @@ export const pl: Record<string, string> = {
settingsSubagentDesc: 'Gdy w bieżącej rozmowie pojawi się nowy podagent, strona „Zadania” zostaje utworzona na karcie bocznej i oznaczona kropką nieprzeczytania; karta boczna rozwinięta już na innej stronie nie jest przejmowana — kliknij kropkę, aby tam przejść; na szerokich ekranach rozwijany jest także panel boczny, a na wąskich nie wymusza się otwarcia pełnoekranowego panelu; wyłącz, aby przestać tworzyć ją automatycznie',
settingsJobsTitle: 'Automatycznie aktywuj stronę „Zadania” po pojawieniu się nowego zadania w tle',
settingsJobsDesc: 'Gdy w bieżącej rozmowie pojawi się nowe zadanie w tle, strona „Zadania” zostaje utworzona na karcie bocznej i oznaczona kropką nieprzeczytania (akcja jest wyzwalana przez każde nowe zadanie); karta boczna rozwinięta już na innej stronie nie jest przejmowana — kliknij kropkę, aby tam przejść; na szerokich ekranach rozwijany jest także panel boczny, a na wąskich nie wymusza się otwarcia pełnoekranowego panelu; wyłącz, aby przestać tworzyć ją automatycznie',
settingsTasksAutoFoldSettledTitle: 'Automatycznie zwijaj zakończone zadania liściowe',
settingsTasksAutoFoldSettledDesc: 'Automatycznie zwijaj zadania liściowe, które zakończyły się sukcesem, niepowodzeniem lub zostały zatrzymane i nie mają podagentów; domyślnie włączone',
settingsTasksAutoFoldBranchesTitle: 'Automatycznie zwijaj tylko całkowicie zakończone gałęzie',
settingsTasksAutoFoldBranchesDesc: 'Gałąź jest automatycznie zwijana tylko wtedy, gdy cała gałąź się zakończy; gałęzie z uruchomionymi potomkami nigdy nie są zwijane; domyślnie włączone',
settingsTasksAutoFoldIdleTitle: 'Automatycznie zwijaj bezczynnych członków zespołu',
settingsTasksAutoFoldIdleDesc: 'Automatycznie zwijaj bezczynnych członków zespołu, gdy co najmniej 3 czekają na nowe instrukcje; domyślnie włączone',
settingsJobsAutoCollapseTitle: 'Automatycznie zwijaj szufladę zadań w tle',
settingsJobsAutoCollapseDesc: 'Szuflada zadań w tle zwija się automatycznie, gdy łącznie jest co najmniej 8 agentów; ręczny przełącznik nadal działa; domyślnie włączone',
settingsToolsTitle: 'Wstrzyknij narzędzia terminala dla modelu',
settingsToolsDesc: 'Po włączeniu model może tworzyć i sterować terminalami panelu bocznego przez 8 narzędzi terminal_* (domyślnie wyłączone)',
settingsBottomTerminalTitle: 'Automatycznie otwieraj terminal przy pierwszym rozwinięciu panelu dolnego',
+8
View File
@@ -324,6 +324,14 @@ export const pt: Record<string, string> = {
settingsSubagentDesc: 'Quando a conversa atual gerar um novo subagente, criar a página de Tarefas no cartão lateral e marcá-la com um ponto de não lido; um cartão lateral já aberto em outra página não é assumido — clique no ponto para ir até lá; em telas largas, o cartão lateral também é expandido, enquanto em telas estreitas a gaveta em tela cheia não é aberta à força; desative para parar de criá-la automaticamente',
settingsJobsTitle: 'Ativar automaticamente a página de Tarefas quando houver uma nova tarefa em segundo plano',
settingsJobsDesc: 'Sempre que uma nova tarefa em segundo plano aparecer na conversa atual, criar a página de Tarefas no cartão lateral e marcá-la com um ponto de não lido (cada nova tarefa aciona a criação); um cartão lateral já aberto em outra página não é assumido — clique no ponto para ir até lá; em telas largas, o cartão lateral também é expandido, enquanto em telas estreitas a gaveta em tela cheia não é aberta à força; desative para parar de criá-la automaticamente',
settingsTasksAutoFoldSettledTitle: 'Recolher automaticamente tarefas folha concluídas',
settingsTasksAutoFoldSettledDesc: 'Recolher automaticamente tarefas folha que terminaram (concluídas, com falha ou interrompidas) e não têm subagentes; ativado por padrão',
settingsTasksAutoFoldBranchesTitle: 'Recolher automaticamente apenas ramos totalmente concluídos',
settingsTasksAutoFoldBranchesDesc: 'Um ramo só é recolhido automaticamente quando todo o ramo termina; ramos com descendentes em execução nunca são recolhidos; ativado por padrão',
settingsTasksAutoFoldIdleTitle: 'Recolher automaticamente membros da equipe inativos',
settingsTasksAutoFoldIdleDesc: 'Recolher automaticamente membros da equipe inativos quando 3 ou mais estiverem aguardando novas instruções; ativado por padrão',
settingsJobsAutoCollapseTitle: 'Recolher automaticamente a gaveta de tarefas em segundo plano',
settingsJobsAutoCollapseDesc: 'A gaveta de tarefas em segundo plano é recolhida automaticamente quando há 8 agentes ou mais no total; o botão manual continua disponível; ativado por padrão',
settingsToolsTitle: 'Injetar ferramentas de terminal para o modelo',
settingsToolsDesc: 'Quando ativado, o modelo pode criar e operar terminais da barra lateral por meio das 8 ferramentas terminal_* (desativado por padrão)',
settingsBottomTerminalTitle: 'Abrir um terminal automaticamente na primeira expansão do painel inferior',
+8
View File
@@ -338,6 +338,14 @@ export const ru: Record<string, string> = {
settingsSubagentDesc: 'При появлении нового субагента в текущей сессии страница «Задачи» создаётся в боковой панели и помечается точкой непрочитанного; панель, уже развёрнутая на другой странице, не перехватывается — нажмите на точку, чтобы перейти; на широких экранах боковая панель также разворачивается, а на узких полноэкранная выдвижная панель не открывается принудительно; отключите, чтобы страница больше не создавалась автоматически',
settingsJobsTitle: 'Автоматически активировать страницу «Задачи» при появлении новой фоновой задачи',
settingsJobsDesc: 'При появлении новой фоновой задачи в текущей сессии страница «Задачи» создаётся в боковой панели и помечается точкой непрочитанного (срабатывает для каждой новой задачи); панель, уже развёрнутая на другой странице, не перехватывается — нажмите на точку, чтобы перейти; на широких экранах боковая панель также разворачивается, а на узких полноэкранная выдвижная панель не открывается принудительно; отключите, чтобы страница больше не создавалась автоматически',
settingsTasksAutoFoldSettledTitle: 'Автоматически сворачивать завершённые листовые задачи',
settingsTasksAutoFoldSettledDesc: 'Автоматически сворачивать листовые задачи, которые завершились успешно, с ошибкой или были остановлены и не имеют дочерних агентов; включено по умолчанию',
settingsTasksAutoFoldBranchesTitle: 'Автоматически сворачивать только полностью завершённые ветки',
settingsTasksAutoFoldBranchesDesc: 'Ветка сворачивается автоматически, только когда завершена вся ветка; ветки с работающими потомками никогда не сворачиваются; включено по умолчанию',
settingsTasksAutoFoldIdleTitle: 'Автоматически сворачивать простаивающих участников команды',
settingsTasksAutoFoldIdleDesc: 'Автоматически сворачивать простаивающих участников команды, когда 3 или более ждут новых инструкций; включено по умолчанию',
settingsJobsAutoCollapseTitle: 'Автоматически сворачивать панель фоновых задач',
settingsJobsAutoCollapseDesc: 'Панель фоновых задач автоматически сворачивается, когда общее число агентов достигает 8; ручной переключатель остаётся доступен; включено по умолчанию',
settingsToolsTitle: 'Внедрить терминальные инструменты для модели',
settingsToolsDesc: 'Если включено, модель может через 8 инструментов (terminal_create и др.) создавать терминалы боковой панели и управлять ими (по умолчанию выключено)',
settingsBottomTerminalTitle: 'Автооткрытие терминала при первом разворачивании нижней панели',
+8
View File
@@ -324,6 +324,14 @@ export const sv: Record<string, string> = {
settingsSubagentDesc: 'När den aktuella konversationen skapar en ny subagent skapas sidan Uppgifter i sidokortet och markeras med en oläst punkt; ett sidokort som redan visar en annan sida tas inte över — klicka på punkten för att gå dit; på breda skärmar expanderas även sidokortet, medan helskärmspanelen inte tvingas öppnas på smala skärmar; stäng av för att sluta skapa den automatiskt',
settingsJobsTitle: 'Aktivera sidan Uppgifter automatiskt vid ett nytt bakgrundsjobb',
settingsJobsDesc: 'När ett nytt bakgrundsjobb dyker upp för den aktuella konversationen skapas sidan Uppgifter i sidokortet och markeras med en oläst punkt (detta sker för varje nytt jobb); ett sidokort som redan visar en annan sida tas inte över — klicka på punkten för att gå dit; på breda skärmar expanderas även sidokortet, medan helskärmspanelen inte tvingas öppnas på smala skärmar; stäng av för att sluta skapa den automatiskt',
settingsTasksAutoFoldSettledTitle: 'Fäll ihop avslutade lövnoder automatiskt',
settingsTasksAutoFoldSettledDesc: 'Fäll automatiskt ihop lövnoder som är avslutade, misslyckade eller stoppade och inte har några underordnade agenter; på som standard',
settingsTasksAutoFoldBranchesTitle: 'Fäll endast ihop helt avslutade grenar automatiskt',
settingsTasksAutoFoldBranchesDesc: 'En gren fälls endast ihop automatiskt när hela grenen har avslutats; grenar med körande ättlingar fälls aldrig ihop; på som standard',
settingsTasksAutoFoldIdleTitle: 'Fäll ihop inaktiva teammedlemmar automatiskt',
settingsTasksAutoFoldIdleDesc: 'Fäll automatiskt ihop inaktiva teammedlemmar när minst 3 väntar på nya instruktioner; på som standard',
settingsJobsAutoCollapseTitle: 'Fäll ihop bakgrundsjobbspanelen automatiskt',
settingsJobsAutoCollapseDesc: 'Bakgrundsjobbspanelen fälls ihop automatiskt när det finns minst 8 agenter totalt; den manuella växlingen fungerar fortfarande; på som standard',
settingsToolsTitle: 'Injicera terminalverktyg för modellen',
settingsToolsDesc: 'När aktiverat kan modellen skapa och styra sidopanelsterminaler via de 8 terminal_*-verktygen (av som standard)',
settingsBottomTerminalTitle: 'Öppna automatiskt en terminal vid bottenpanelens första expandering',
+8
View File
@@ -341,6 +341,14 @@ export const th: Record<string, string> = {
settingsSubagentDesc: 'เมื่อแชทปัจจุบันสร้างตัวแทนย่อยใหม่ ระบบจะสร้างหน้า Tasks ในการ์ดด้านข้างและทำเครื่องหมายจุดยังไม่ได้อ่าน; หากการ์ดด้านข้างเปิดหน้าอื่นอยู่ ระบบจะไม่แย่งไป — คลิกจุดเพื่อไปที่นั่น; ในมุมมองแบบกว้าง ระบบจะขยายการ์ดด้านข้างด้วย ส่วนในมุมมองแบบแคบ ระบบจะไม่บังคับเปิดลิ้นชักเต็มหน้าจอ; ปิดเพื่อหยุดสร้างโดยอัตโนมัติ',
settingsJobsTitle: 'เลือกหน้า Tasks โดยอัตโนมัติเมื่อมีงานเบื้องหลังใหม่',
settingsJobsDesc: 'เมื่อมีงานเบื้องหลังใหม่ปรากฏในแชทปัจจุบัน ระบบจะสร้างหน้า Tasks ในการ์ดด้านข้างและทำเครื่องหมายจุดยังไม่ได้อ่าน (ทุกงานใหม่จะทริกเกอร์); หากการ์ดด้านข้างเปิดหน้าอื่นอยู่ ระบบจะไม่แย่งไป — คลิกจุดเพื่อไปที่นั่น; ในมุมมองแบบกว้าง ระบบจะขยายการ์ดด้านข้างด้วย ส่วนในมุมมองแบบแคบ ระบบจะไม่บังคับเปิดลิ้นชักเต็มหน้าจอ; ปิดเพื่อหยุดสร้างโดยอัตโนมัติ',
settingsTasksAutoFoldSettledTitle: 'ย่องานโหนดใบที่เสร็จสิ้นอัตโนมัติ',
settingsTasksAutoFoldSettledDesc: 'ย่องานโหนดใบที่เสร็จสิ้น ล้มเหลว หรือหยุดแล้ว และไม่มีเอเจนต์ย่อยโดยอัตโนมัติ; เปิดเป็นค่าเริ่มต้น',
settingsTasksAutoFoldBranchesTitle: 'ย่อเฉพาะสาขาที่เสร็จสิ้นทั้งหมดอัตโนมัติ',
settingsTasksAutoFoldBranchesDesc: 'สาขาจะถูกย่ออัตโนมัติเมื่อสาขาทั้งหมดเสร็จสิ้นเท่านั้น; สาขาที่มีลูกหลานกำลังทำงานจะไม่ถูกย่อ; เปิดเป็นค่าเริ่มต้น',
settingsTasksAutoFoldIdleTitle: 'ย่อสมาชิกทีมที่ว่างอัตโนมัติ',
settingsTasksAutoFoldIdleDesc: 'ย่อสมาชิกทีมที่ว่างอัตโนมัติเมื่อมี 3 คนขึ้นไปรอคำสั่งใหม่; เปิดเป็นค่าเริ่มต้น',
settingsJobsAutoCollapseTitle: 'ย่อลิ้นชักงานเบื้องหลังอัตโนมัติ',
settingsJobsAutoCollapseDesc: 'ลิ้นชักงานเบื้องหลังจะย่ออัตโนมัติเมื่อมีเอเจนต์รวม 8 ตัวขึ้นไป; ปุ่มสลับด้วยตนเองยังใช้ได้; เปิดเป็นค่าเริ่มต้น',
settingsToolsTitle: 'ฉีดเครื่องมือเทอร์มินัลสำหรับโมเดล',
settingsToolsDesc: 'เมื่อเปิดใช้ โมเดลสามารถสร้างและควบคุมเทอร์มินัลแถบด้านข้างผ่านเครื่องมือ terminal_* 8 ตัว (ปิดเป็นค่าเริ่มต้น)',
settingsBottomTerminalTitle: 'เปิดเทอร์มินัลอัตโนมัติเมื่อพาเนลล่างขยายครั้งแรก',
+8
View File
@@ -341,6 +341,14 @@ export const tr: Record<string, string> = {
settingsSubagentDesc: 'Geçerli sohbet yeni bir alt aracı oluşturduğunda Görevler sayfası yan kartta oluşturulur ve okunmamış noktasıyla işaretlenir; başka bir sayfada açık olan yan kart ele geçirilmez — oraya gitmek için noktaya tıklayın; geniş ekranlarda yan kart da genişletilir, dar ekranlarda tam ekran çekmecesi zorla açılmaz; otomatik oluşturmayı durdurmak için kapatın',
settingsJobsTitle: 'Yeni bir arka plan işi belirdiğinde Görevler sayfasını otomatik etkinleştir',
settingsJobsDesc: 'Geçerli sohbette her yeni arka plan işi belirdiğinde Görevler sayfası yan kartta oluşturulur ve okunmamış noktasıyla işaretlenir (her yeni iş tetikler); başka bir sayfada açık olan yan kart ele geçirilmez — oraya gitmek için noktaya tıklayın; geniş ekranlarda yan kart da genişletilir, dar ekranlarda tam ekran çekmecesi zorla açılmaz; otomatik oluşturmayı durdurmak için kapatın',
settingsTasksAutoFoldSettledTitle: 'Tamamlanan yaprak görevleri otomatik daralt',
settingsTasksAutoFoldSettledDesc: 'Tamamlanan, başarısız olan veya durdurulan ve alt aracısı olmayan yaprak görevleri otomatik daralt; varsayılan olarak açık',
settingsTasksAutoFoldBranchesTitle: 'Yalnızca tamamen biten dalları otomatik daralt',
settingsTasksAutoFoldBranchesDesc: 'Bir dal yalnızca dalın tamamı bittiğinde otomatik daraltılır; çalışan alt öğeleri olan dallar asla daraltılmaz; varsayılan olarak açık',
settingsTasksAutoFoldIdleTitle: 'Etkin olmayan ekip üyelerini otomatik daralt',
settingsTasksAutoFoldIdleDesc: 'Yeni talimat bekleyen etkin olmayan ekip üyesi sayısı 3 veya daha fazla olduğunda otomatik daralt; varsayılan olarak açık',
settingsJobsAutoCollapseTitle: 'Arka plan işleri çekmecesini otomatik daralt',
settingsJobsAutoCollapseDesc: 'Toplam 8 veya daha fazla ajan olduğunda arka plan işleri çekmecesini otomatik daralt; manuel geçiş hâlâ çalışır; varsayılan olarak açık',
settingsToolsTitle: 'Model için terminal araçları enjekte et',
settingsToolsDesc: 'Etkinleştirildiğinde model, 8 terminal_* aracı üzerinden kenar çubuğu terminalleri oluşturup kullanabilir (varsayılan kapalı)',
settingsBottomTerminalTitle: 'Alt panelin ilk genişletilmesinde otomatik terminal aç',
+8
View File
@@ -341,6 +341,14 @@ export const vi: Record<string, string> = {
settingsSubagentDesc: 'Khi phiên hiện tại tạo tác nhân con mới, trang Quản lý tác vụ được tạo trong thẻ bên và đánh dấu chấm chưa đọc; thẻ bên đang mở ở trang khác sẽ không bị chiếm — bấm vào chấm để đến đó; trên màn hình rộng, thẻ bên cũng được mở rộng; trên màn hình hẹp, ngăn kéo toàn màn hình không bị ép mở; tắt để ngừng tạo tự động',
settingsJobsTitle: 'Tự động kích hoạt trang Quản lý tác vụ khi có tác vụ nền mới',
settingsJobsDesc: 'Mỗi khi phiên hiện tại có tác vụ nền mới, trang Quản lý tác vụ được tạo trong thẻ bên và đánh dấu chấm chưa đọc (mỗi tác vụ mới đều kích hoạt); thẻ bên đang mở ở trang khác sẽ không bị chiếm — bấm vào chấm để đến đó; trên màn hình rộng, thẻ bên cũng được mở rộng; trên màn hình hẹp, ngăn kéo toàn màn hình không bị ép mở; tắt để ngừng tạo tự động',
settingsTasksAutoFoldSettledTitle: 'Tự động thu gọn tác vụ lá đã hoàn tất',
settingsTasksAutoFoldSettledDesc: 'Tự động thu gọn tác vụ lá đã hoàn tất, thất bại hoặc đã dừng và không có tác nhân con; mặc định bật',
settingsTasksAutoFoldBranchesTitle: 'Chỉ tự động thu gọn nhánh đã kết thúc hoàn toàn',
settingsTasksAutoFoldBranchesDesc: 'Chỉ thu gọn nhánh khi toàn bộ nhánh đã kết thúc; nhánh còn tác nhân con đang chạy sẽ không bao giờ bị thu gọn; mặc định bật',
settingsTasksAutoFoldIdleTitle: 'Tự động thu gọn thành viên nhóm đang rảnh',
settingsTasksAutoFoldIdleDesc: 'Tự động thu gọn thành viên nhóm đang rảnh khi có từ 3 thành viên trở lên đang chờ hướng dẫn mới; mặc định bật',
settingsJobsAutoCollapseTitle: 'Tự động thu gọn ngăn tác vụ nền',
settingsJobsAutoCollapseDesc: 'Ngăn tác vụ nền tự động thu gọn khi tổng số tác nhân từ 8 trở lên; nút chuyển thủ công vẫn dùng được; mặc định bật',
settingsToolsTitle: 'Tiêm công cụ terminal cho mô hình',
settingsToolsDesc: 'Khi bật, mô hình có thể tạo và điều khiển terminal thanh bên qua 8 công cụ terminal_* (mặc định tắt)',
settingsBottomTerminalTitle: 'Tự động mở terminal khi panel dưới mở rộng lần đầu',
+8
View File
@@ -356,6 +356,14 @@ export const zhHK: Record<string, string> = {
settingsSubagentDesc: '目前工作階段產生新的子代理時,在側邊欄建立任務管理頁並標記未讀紅點;若右欄正展開在其他頁面則不搶焦點,點紅點即可前往;寬螢幕時亦會展開側邊欄,窄螢幕時不會強制開啟全螢幕抽屜;關閉後不再自動建立',
settingsJobsTitle: '有新背景任務時自動選取任務管理頁',
settingsJobsDesc: '目前工作階段出現新的背景任務時,在側邊欄建立任務管理頁並標記未讀紅點(每個新任務都會觸發);若右欄正展開在其他頁面則不搶焦點,點紅點即可前往;寬螢幕時亦會展開側邊欄,窄螢幕時不會強制開啟全螢幕抽屜;關閉後不再自動建立',
settingsTasksAutoFoldSettledTitle: '自動摺疊已結束葉子任務',
settingsTasksAutoFoldSettledDesc: '自動摺疊已完成、失敗或停止且沒有子代理的葉子任務;預設開啟',
settingsTasksAutoFoldBranchesTitle: '僅自動摺疊完全結束的分支',
settingsTasksAutoFoldBranchesDesc: '僅當整條分支全部結束時才自動摺疊;含有執行中後代的分支絕不摺疊;預設開啟',
settingsTasksAutoFoldIdleTitle: '自動摺疊閒置成員',
settingsTasksAutoFoldIdleDesc: '閒置成員達到 3 個或以上時自動摺疊;預設開啟',
settingsJobsAutoCollapseTitle: '自動收起背景任務抽屜',
settingsJobsAutoCollapseDesc: '代理總數達到 8 個或以上時自動收起背景任務抽屜;手動開關仍然可用;預設開啟',
settingsToolsTitle: '為模型注入終端工具',
settingsToolsDesc: '開啟後,模型可透過 terminal_create 等 8 個工具建立並操作側邊欄終端(預設關閉)',
settingsBottomTerminalTitle: '底部面板首次展開自動開終端',
+8
View File
@@ -356,6 +356,14 @@ export const zhMO: Record<string, string> = {
settingsSubagentDesc: '目前工作階段產生新的子代理時,在側邊欄建立任務管理頁並標記未讀紅點;若右欄正展開在其他頁面則不搶焦點,點紅點即可前往;寬螢幕時亦會展開側邊欄,窄螢幕時不會強制開啟全螢幕抽屜;關閉後不再自動建立',
settingsJobsTitle: '有新背景任務時自動選取任務管理頁',
settingsJobsDesc: '目前工作階段出現新的背景任務時,在側邊欄建立任務管理頁並標記未讀紅點(每個新任務都會觸發);若右欄正展開在其他頁面則不搶焦點,點紅點即可前往;寬螢幕時亦會展開側邊欄,窄螢幕時不會強制開啟全螢幕抽屜;關閉後不再自動建立',
settingsTasksAutoFoldSettledTitle: '自動摺疊已結束葉子任務',
settingsTasksAutoFoldSettledDesc: '自動摺疊已完成、失敗或停止且沒有子代理的葉子任務;預設開啟',
settingsTasksAutoFoldBranchesTitle: '僅自動摺疊完全結束的分支',
settingsTasksAutoFoldBranchesDesc: '僅當整條分支全部結束時才自動摺疊;含有執行中後代的分支絕不摺疊;預設開啟',
settingsTasksAutoFoldIdleTitle: '自動摺疊閒置成員',
settingsTasksAutoFoldIdleDesc: '閒置成員達到 3 個或以上時自動摺疊;預設開啟',
settingsJobsAutoCollapseTitle: '自動收起背景任務抽屜',
settingsJobsAutoCollapseDesc: '代理總數達到 8 個或以上時自動收起背景任務抽屜;手動開關仍然可用;預設開啟',
settingsToolsTitle: '為模型注入終端工具',
settingsToolsDesc: '開啟後,模型可透過 terminal_create 等 8 個工具建立並操作側邊欄終端(預設關閉)',
settingsBottomTerminalTitle: '底部面板首次展開自動開終端',
+8
View File
@@ -356,6 +356,14 @@ export const zhTW: Record<string, string> = {
settingsSubagentDesc: '目前工作階段產生新的子代理時,在側邊欄建立任務管理頁並標記未讀紅點;若右欄正展開在其他頁面則不搶焦點,點紅點即可前往;寬螢幕時亦會展開側邊欄,窄螢幕時不會強制開啟全螢幕抽屜;關閉後不再自動建立',
settingsJobsTitle: '有新背景任務時自動選取任務管理頁',
settingsJobsDesc: '目前工作階段出現新的背景任務時,在側邊欄建立任務管理頁並標記未讀紅點(每個新任務都會觸發);若右欄正展開在其他頁面則不搶焦點,點紅點即可前往;寬螢幕時亦會展開側邊欄,窄螢幕時不會強制開啟全螢幕抽屜;關閉後不再自動建立',
settingsTasksAutoFoldSettledTitle: '自動摺疊已結束葉子任務',
settingsTasksAutoFoldSettledDesc: '自動摺疊已完成、失敗或停止且沒有子代理的葉子任務;預設開啟',
settingsTasksAutoFoldBranchesTitle: '僅自動摺疊完全結束的分支',
settingsTasksAutoFoldBranchesDesc: '僅當整條分支全部結束時才自動摺疊;含有執行中後代的分支絕不摺疊;預設開啟',
settingsTasksAutoFoldIdleTitle: '自動摺疊閒置成員',
settingsTasksAutoFoldIdleDesc: '閒置成員達到 3 個或以上時自動摺疊;預設開啟',
settingsJobsAutoCollapseTitle: '自動收起背景任務抽屜',
settingsJobsAutoCollapseDesc: '代理總數達到 8 個或以上時自動收起背景任務抽屜;手動開關仍然可用;預設開啟',
settingsToolsTitle: '為模型注入終端工具',
settingsToolsDesc: '開啟後,模型可透過 terminal_create 等 8 個工具建立並操作側邊欄終端(預設關閉)',
settingsBottomTerminalTitle: '底部面板首次展開自動開終端',
+16
View File
@@ -353,6 +353,14 @@ export const zh = {
settingsSubagentDesc: '当前会话产生新的子代理时,在侧边栏创建任务管理页并标记未读红点;若侧边栏正展开在其他页面则不抢焦点,点红点即可前往;宽屏同时展开侧边栏,窄屏不强制展开全屏抽屉;关闭后不再自动创建',
settingsJobsTitle: '有新后台任务时自动激活任务管理页',
settingsJobsDesc: '当前会话出现新的后台任务时,在侧边栏创建任务管理页并标记未读红点(每个新任务都会触发);若侧边栏正展开在其他页面则不抢焦点,点红点即可前往;宽屏同时展开侧边栏,窄屏不强制展开全屏抽屉;关闭后不再自动创建',
settingsTasksAutoFoldSettledTitle: '自动折叠已结束叶子任务',
settingsTasksAutoFoldSettledDesc: '自动折叠已完成、失败或停止且没有子代理的叶子任务;默认开启',
settingsTasksAutoFoldBranchesTitle: '仅自动折叠完全结束的分支',
settingsTasksAutoFoldBranchesDesc: '仅当整条分支全部结束才自动折叠;含有运行中后代的分支绝不折叠;默认开启',
settingsTasksAutoFoldIdleTitle: '自动折叠空闲成员',
settingsTasksAutoFoldIdleDesc: '空闲成员达到 3 个或以上时自动折叠;默认开启',
settingsJobsAutoCollapseTitle: '自动收起后台任务抽屉',
settingsJobsAutoCollapseDesc: '代理总数达到 8 个或以上时自动收起后台任务抽屉;手动开关仍然可用;默认开启',
settingsToolsTitle: '为模型注入终端工具',
settingsToolsDesc: '开启后,模型可通过 terminal_create 等 8 个工具创建并操作侧边栏终端(默认关闭)',
settingsBottomTerminalTitle: '底部面板首次展开自动开终端',
@@ -986,6 +994,14 @@ export const en: Record<keyof typeof zh, string> = {
settingsSubagentDesc: 'When the current conversation spawns a new subagent, create the Tasks page in the side card and mark it with an unread dot; a side card already expanded on another page is left alone instead of being taken over — click the dot to go there; wide viewports also expand the side card, while narrow full-screen drawers are not forced open; turn off to stop creating it automatically',
settingsJobsTitle: 'Auto-activate the Tasks page on a new background job',
settingsJobsDesc: 'Whenever a new background job appears for the current conversation, create the Tasks page in the side card and mark it with an unread dot (every new job triggers); a side card already expanded on another page is left alone instead of being taken over — click the dot to go there; wide viewports also expand the side card, while narrow full-screen drawers are not forced open; turn off to stop creating it automatically',
settingsTasksAutoFoldSettledTitle: 'Auto-fold settled leaf tasks',
settingsTasksAutoFoldSettledDesc: 'Automatically fold leaf tasks that have completed, failed, or stopped and have no child agents; on by default',
settingsTasksAutoFoldBranchesTitle: 'Auto-fold fully finished branches only',
settingsTasksAutoFoldBranchesDesc: 'Automatically fold a branch only once the whole branch has finished; a branch with any running descendant is never folded; on by default',
settingsTasksAutoFoldIdleTitle: 'Auto-fold idle teammates',
settingsTasksAutoFoldIdleDesc: 'Automatically fold idle teammates once 3 or more are waiting for new instructions; on by default',
settingsJobsAutoCollapseTitle: 'Auto-collapse the background jobs drawer',
settingsJobsAutoCollapseDesc: 'Automatically collapse the background jobs drawer when there are 8 or more agents in total; the manual toggle still works; on by default',
settingsToolsTitle: 'Inject terminal tools for the model',
settingsToolsDesc: 'When enabled, the model can create and drive sidebar terminals through the 8 terminal_* tools (off by default)',
settingsBottomTerminalTitle: 'Auto-open a terminal on the bottom panel\'s first expansion',
+12
View File
@@ -49,6 +49,18 @@ export function parsePrefs(value: unknown): SidebarPrefs {
tasksViewMode: record.tasksViewMode === 'tree' || record.tasksViewMode === 'graph'
? record.tasksViewMode
: SIDEBAR_PREFS_DEFAULTS.tasksViewMode,
tasksAutoFoldSettled: typeof record.tasksAutoFoldSettled === 'boolean'
? record.tasksAutoFoldSettled
: SIDEBAR_PREFS_DEFAULTS.tasksAutoFoldSettled,
tasksAutoFoldBranches: typeof record.tasksAutoFoldBranches === 'boolean'
? record.tasksAutoFoldBranches
: SIDEBAR_PREFS_DEFAULTS.tasksAutoFoldBranches,
tasksAutoFoldIdle: typeof record.tasksAutoFoldIdle === 'boolean'
? record.tasksAutoFoldIdle
: SIDEBAR_PREFS_DEFAULTS.tasksAutoFoldIdle,
jobsAutoCollapse: typeof record.jobsAutoCollapse === 'boolean'
? record.jobsAutoCollapse
: SIDEBAR_PREFS_DEFAULTS.jobsAutoCollapse,
mobileNoAutoOpen: typeof record.mobileNoAutoOpen === 'boolean'
? record.mobileNoAutoOpen
: SIDEBAR_PREFS_DEFAULTS.mobileNoAutoOpen,
+73 -48
View File
@@ -204,77 +204,93 @@ function bands(children: readonly TasksNode[], cols: number): TasksNode[][] {
export function layoutTasksGraph(nodes: readonly TasksNode[], options: LayoutOptions = {}): GraphLayout {
const cols = Math.max(1, options.maxBandCols ?? 4)
const stride = rowStrideFor(nodes)
const ids = new Set(nodes.map(node => node.id))
const roots = nodes.filter(node => node.parentId === undefined || !ids.has(node.parentId))
const nodeById = new Map(nodes.map(node => [node.id, node]))
const roots = nodes.filter(node => node.parentId === undefined || !nodeById.has(node.parentId))
const childrenOf = new Map<string, TasksNode[]>()
for (const edge of tasksEdges(nodes)) {
const child = nodes.find(node => node.id === edge.to)
const child = nodeById.get(edge.to)
if (child === undefined) continue
const list = childrenOf.get(edge.from)
if (list === undefined) childrenOf.set(edge.from, [child])
else list.push(child)
}
/** Post-order: the width of the subtree rooted at `node`. */
const subtreeWidth = (node: TasksNode): number => {
// Collect an explicit traversal, then visit it backwards so every child's
// dimensions are available before its parent, even if input is not pre-order.
const order: TasksNode[] = []
const pending = roots.slice()
while (pending.length > 0) {
const node = pending.pop()!
order.push(node)
for (const child of childrenOf.get(node.id) ?? []) pending.push(child)
}
const subtrees = new Map<string, { width: number; rows: number }>()
for (let index = order.length - 1; index >= 0; index -= 1) {
const node = order[index]!
let width = GRAPH_NODE_W
let rows = 1
const children = childrenOf.get(node.id) ?? []
if (children.length === 0) return GRAPH_NODE_W
let widest = GRAPH_NODE_W
for (const band of bands(children, cols)) {
const width = band.reduce((sum, child) => sum + subtreeWidth(child), 0)
+ GRAPH_GAP_X * (band.length - 1)
widest = Math.max(widest, width)
let bandWidth = GRAPH_GAP_X * (band.length - 1)
let bandRows = 0
for (const child of band) {
const subtree = subtrees.get(child.id)!
bandWidth += subtree.width
bandRows = Math.max(bandRows, subtree.rows)
}
width = Math.max(width, bandWidth)
rows += bandRows
}
return widest
subtrees.set(node.id, { width, rows })
}
const boxes = new Map<string, GraphBox>()
/**
* Place `node` centered on `centerX` at row `row`; returns the LAST row its
* subtree occupies. Wrapped bands advance to the row after the deepest row
* of the previous band, so a sibling's children can never land on top of
* the next band (the overlap a naive +1 counter produced).
*/
const place = (node: TasksNode, centerX: number, row: number): number => {
boxes.set(node.id, {
// Cached subtree row counts let each wrapped band start below the deepest
// previous band without waiting for recursive placement to return.
const placements: { node: TasksNode; centerX: number; row: number }[] = []
let offset = GRAPH_PAD
for (const root of roots) {
const width = subtrees.get(root.id)!.width
placements.push({ node: root, centerX: offset + width / 2, row: 0 })
offset += width + GRAPH_GAP_X
}
placements.reverse()
let width = GRAPH_PAD * 2 + GRAPH_NODE_W
let height = GRAPH_PAD * 2 + GRAPH_AGENT_NODE_H
while (placements.length > 0) {
const { node, centerX, row } = placements.pop()!
const box = {
id: node.id,
x: Math.round(centerX - GRAPH_NODE_W / 2),
y: GRAPH_PAD + row * stride,
w: GRAPH_NODE_W,
h: nodeHeight(node),
})
}
boxes.set(node.id, box)
width = Math.max(width, box.x + box.w + GRAPH_PAD)
height = Math.max(height, box.y + box.h + GRAPH_PAD)
const children = childrenOf.get(node.id) ?? []
if (children.length === 0) return row
let deepest = row
const next: typeof placements = []
let bandRow = row + 1
for (const band of bands(children, cols)) {
const bandWidth = band.reduce((sum, child) => sum + subtreeWidth(child), 0)
+ GRAPH_GAP_X * (band.length - 1)
let cursor = centerX - bandWidth / 2
let bandDeepest = bandRow
let bandWidth = GRAPH_GAP_X * (band.length - 1)
let bandRows = 0
for (const child of band) {
const width = subtreeWidth(child)
bandDeepest = Math.max(bandDeepest, place(child, cursor + width / 2, bandRow))
cursor += width + GRAPH_GAP_X
const subtree = subtrees.get(child.id)!
bandWidth += subtree.width
bandRows = Math.max(bandRows, subtree.rows)
}
deepest = Math.max(deepest, bandDeepest)
bandRow = bandDeepest + 1
let cursor = centerX - bandWidth / 2
for (const child of band) {
const childWidth = subtrees.get(child.id)!.width
next.push({ node: child, centerX: cursor + childWidth / 2, row: bandRow })
cursor += childWidth + GRAPH_GAP_X
}
bandRow += bandRows
}
return deepest
// Preserve the original depth-first box insertion order as well as pixels.
for (let index = next.length - 1; index >= 0; index -= 1) placements.push(next[index]!)
}
// Single-root forest in practice (the topology root); the loop stays so a
// defensive orphan still lands inside the canvas extent.
let offset = GRAPH_PAD
for (const root of roots) {
const width = subtreeWidth(root)
place(root, offset + width / 2, 0)
offset += width + GRAPH_GAP_X
}
const allBoxes = [...boxes.values()]
const width = Math.max(GRAPH_PAD * 2 + GRAPH_NODE_W, ...allBoxes.map(box => box.x + box.w + GRAPH_PAD))
const height = Math.max(GRAPH_PAD * 2 + GRAPH_AGENT_NODE_H, ...allBoxes.map(box => box.y + box.h + GRAPH_PAD))
return { boxes, width, height }
}
@@ -312,18 +328,27 @@ export function layoutTasksGraphForWidth(
): GraphLayout {
const budget = containerWidth <= 0 ? Number.POSITIVE_INFINITY : (containerWidth - 24) / minScale
const widest = bandColsFor(containerWidth <= 0 ? 360 : containerWidth)
const layouts = new Map<number, GraphLayout>()
const layoutFor = (cols: number): GraphLayout => {
let layout = layouts.get(cols)
if (layout === undefined) {
layout = layoutTasksGraph(nodes, { maxBandCols: cols })
layouts.set(cols, layout)
}
return layout
}
// Pass 1: the least-tall arrangement that FITS the readability budget at
// two or more columns (below two the graph degenerates into a ladder).
for (let cols = widest; cols >= 2; cols -= 1) {
const layout = layoutTasksGraph(nodes, { maxBandCols: cols })
const layout = layoutFor(cols)
if (layout.width <= budget) return layout
}
// Pass 2: nothing flat fits — accept a slight horizontal overflow (the
// reader pans a little) rather than stacking every child vertically.
const tolerant = budget * 1.2
for (let cols = widest; cols >= 2; cols -= 1) {
const layout = layoutTasksGraph(nodes, { maxBandCols: cols })
const layout = layoutFor(cols)
if (layout.width <= tolerant) return layout
}
return layoutTasksGraph(nodes, { maxBandCols: 1 })
return layoutFor(1)
}
+137 -123
View File
@@ -15,8 +15,8 @@
* member data (so a finished run still shows its members);
* - team members enrich matching agent nodes in place (role/phase/status);
* the lead's roster row lands on the root node;
* - fold: per parent, settled agent LEAVES (state done/error, never the
* current session, never a workflow member's run node) collapse into one
* - fold: per parent, settled agent leaves and fully settled known branches
* (never the current session or its ancestors) collapse into one
* trailing `fold` node per GROUP (finished work / waiting members) carrying
* the member ids and label previews; a group the reader opened
* ({@link TasksModelInput.expandedGroups}) keeps its members visible while
@@ -85,7 +85,7 @@ export interface TasksAgentNode {
depth: number
/** Workflow phase this node is a member of (workflow runs only). */
phase?: { key: string; index: number; title?: string }
/** The catalog's durable children signal (fold candidacy's leaf test). */
/** Unknown/nonempty catalog signal (known branches are checked as subtrees). */
hasChildren?: boolean
/** Shared tasks owned by this agent (team boards only; empty otherwise). */
tasks?: TasksNodeTask[]
@@ -129,7 +129,7 @@ export interface TasksFoldNode {
idleCount: number
/** How many ended in a failure (出错); they belong to the `done` group. */
errorCount: number
/** The folded session ids, in original order (expansion restores them). */
/** All hidden agent ids, including descendants, in topology order. */
memberIds: string[]
/** Up to two label previews for the collapsed subtitle. */
previews: string[]
@@ -156,14 +156,20 @@ export interface TasksModelInput {
teamMembers: readonly TeamMemberRow[]
/** The team's shared tasks; each lands on its OWNER's node. */
teamTasks?: readonly SidebarTeamTaskView[]
/** Whether settled leaves collapse into fold nodes. */
/** Global gate for automatic folding; manual foldedIds remain independent. */
folded: boolean
/** Automatically aggregate settled leaves (default true). */
autoFoldSettled?: boolean
/** Automatically aggregate fully settled, known branches (default true). */
autoFoldBranches?: boolean
/** Automatically aggregate idle members at the existing threshold (default true). */
autoFoldIdle?: boolean
/**
* Nodes the READER folded by hand (a settled card's bar chevron). This is a
* PER-NODE trigger, not a second copy of the global rule, so it only has to
* satisfy the guards that protect the reader from hiding live work: never a
* satisfy the existing per-node guards: never a
* running node, never the current session. It is deliberately NOT subject to
* {@link isAutoFoldable} — the chevron is drawn on every settled card, and a
* the automatic subtree rule — the chevron is drawn on every settled card, and a
* trigger that cannot fire is a dead control.
*/
foldedIds?: ReadonlySet<string>
@@ -187,36 +193,9 @@ function childLabel(
return entry.label ?? summary?.displayTitle ?? entry.id
}
/**
* Whether the aggregate may hide this node as part of a page-level fold. The
* caller supplies `foldIdleMembers`: an idle teammate is only swept when its
* parent has enough of them ({@link FOLD_IDLE_MIN}).
*
* - a branching node or one with a run of its own — folding it hides a whole
* branch, not a finished leaf;
* - the session on screen — the "you are here" marker must stay reachable;
* - a RUNNING or PROVISIONING node — work in flight is never hidden;
* - a teammate — a roster row is a real, resumable worker, not a settled
* subagent to sweep away, so it needs the idle head count (a `failed` one
* is ordinary settled work and folds with the rest).
*
* The manual trigger ({@link TasksModelInput.foldedIds}) asks for ONE node by
* name, so it answers only to the running/current guards — a trigger that
* cannot fire is a dead control.
*/
/** Manual folds preserve the existing per-node running/current guards. */
function nodeFoldable(node: TasksAgentNode, currentSessionId: string): boolean {
return !node.current && node.id !== currentSessionId
&& node.state !== 'running'
}
/** The extra guard the PAGE-LEVEL rule adds to {@link nodeFoldable}. */
function isAutoFoldable(
node: TasksAgentNode,
runsByOrigin: Map<string, WorkflowRunView[]>,
foldIdleMembers: boolean,
): boolean {
if (!foldIdleMembers && node.team !== undefined) return false
return node.hasChildren !== true && !runsByOrigin.has(node.id)
return !node.current && node.id !== currentSessionId && node.state !== 'running'
}
/**
@@ -247,7 +226,7 @@ function tally(folded: readonly TasksAgentNode[]): FoldTally {
for (const node of folded) {
if (node.state === 'done') counts.done += 1
else if (node.state === 'idle') counts.idle += 1
else counts.error += 1
else if (node.state === 'error') counts.error += 1
}
return counts
}
@@ -367,7 +346,8 @@ export function buildTasksModel(input: TasksModelInput): TasksNode[] {
: { role: member.role, name: member.name, phase: member.phase, status: member.status, diagnostics: member.diagnostics }
}
const out: TasksNode[] = []
const out: (TasksAgentNode | TasksWorkflowNode)[] = []
const seen = new Set<string>([rootId])
/**
* Every session id the catalogs know about, anywhere in the tree. A
@@ -382,19 +362,21 @@ export function buildTasksModel(input: TasksModelInput): TasksNode[] {
if (catalog?.state !== 'ready') continue
for (const entry of catalog.entries) knownAgentIds.add(entry.id)
}
// The local children lists of `appendChildren` are built lazily per parent,
// The local children lists of `buildChildren` are built lazily per parent,
// so this global set is what makes the guard below order-independent.
/** The agent children of one parent, in catalog order (side threads
* excluded), with workflow runs appended in start order. */
const appendChildren = (parentId: string, depth: number): void => {
const buildChildren = (parentId: string, depth: number): (TasksAgentNode | TasksWorkflowNode)[] => {
const catalog = catalogs[parentId]
const entries = catalog?.state === 'ready' ? catalog.entries : []
const agentChildren: TasksAgentNode[] = []
for (const entry of entries) {
if (seen.has(entry.id)) continue
const summary = byId[entry.id]
if (summary !== undefined && isSideThreadSummary(summary)) continue
if (entry.label?.startsWith('Side: ') ?? false) continue
seen.add(entry.id)
const team = teamOf(entry.id)
// DSH 0.1.7's catalog row carries the identity only: the live channel
// reports EVERY child with an explicit `running` flag, and a row keeps
@@ -438,6 +420,7 @@ export function buildTasksModel(input: TasksModelInput): TasksNode[] {
})
}
const agentChildrenById = new Map(agentChildren.map(node => [node.id, node]))
// Workflow runs of this agent: member agents with a catalog row are
// re-parented under the run; the rest are synthesized from run data.
const runNodes: TasksWorkflowNode[] = []
@@ -446,38 +429,50 @@ export function buildTasksModel(input: TasksModelInput): TasksNode[] {
const runNode: TasksWorkflowNode = {
kind: 'workflow', id: `run:${run.runId}`, parentId, depth: depth + 1, run,
}
if (seen.has(runNode.id)) continue
seen.add(runNode.id)
runNodes.push(runNode)
const members: TasksAgentNode[] = []
for (const [phaseIndex, phase] of run.phases.entries()) {
for (const member of phase.members) {
const existing = member.childId !== ''
? agentChildren.find(candidate => candidate.id === member.childId)
? agentChildrenById.get(member.childId)
: undefined
const phaseRef = {
key: `${run.runId}:${phaseIndex}`,
index: phaseIndex,
...(phase.title === undefined ? {} : { title: phase.title }),
}
if (existing !== undefined) {
if (existing !== undefined && existing.phase === undefined) {
existing.parentId = runNode.id
existing.depth = runNode.depth + 1
existing.phase = phaseRef
if (tasksByNode.get(existing.id) !== undefined) existing.tasks = tasksByNode.get(existing.id)
members.push(existing)
} else if (member.childId !== '' && knownAgentIds.has(member.childId)) {
} else if (member.childId !== '' && (knownAgentIds.has(member.childId) || seen.has(member.childId))) {
// Its real node exists elsewhere in the tree: the run's popover
// already lists the member, so no card is duplicated here.
} else {
const childKnown = member.childId !== ''
const id = childKnown ? member.childId : `wfmember:${run.runId}:${member.seq}`
if (seen.has(id)) continue
seen.add(id)
const team = teamOf(id)
const view = childLive(live, id)
const running = byId[id]?.running ?? (view?.running === true)
const state = running ? 'running' : team !== undefined ? teamState(team.status) : memberOutcomeState(member.outcome)
members.push({
kind: 'agent',
id: childKnown ? member.childId : `wfmember:${run.runId}:${member.seq}`,
id,
parentId: runNode.id,
depth: runNode.depth + 1,
phase: phaseRef,
label: member.label,
state: memberOutcomeState(member.outcome),
activity: member.outcome === undefined ? 'running' : 'inactive',
state,
activity: state === 'running' ? 'running' : 'inactive',
...(team !== undefined ? { team } : {}),
...(view !== undefined ? { live: view } : {}),
...(childKnown && catalogs[id] !== undefined ? { hasChildren: !isKnownLeaf(catalogs, id) } : {}),
current: member.childId !== '' && member.childId === currentSessionId,
synthesized: true,
...(childKnown && metrics?.[member.childId] !== undefined
@@ -495,77 +490,13 @@ export function buildTasksModel(input: TasksModelInput): TasksNode[] {
}
const visibleAgentChildren = agentChildren.filter(child => child.parentId === parentId)
// Fold: this parent's non-executing children collapse into one aggregate
// PER GROUP — finished/failed work in one row, waiting members in another,
// so the badge can say what it holds and a reader can sweep one without
// the other. Three triggers, one precedence per member: a manual
// `foldedIds` fold always wins (the reader pointed at THAT node), the
// page-level `folded` rule decides next (sparing branching nodes and, below
// the idle head count, teammates), and `expandedGroups` only relaxes that
// rule for the one group the reader opened.
const idleMembers = visibleAgentChildren
.filter(child => child.state === 'idle' && child.team !== undefined).length
const foldIdleMembers = idleMembers >= FOLD_IDLE_MIN
const kept: TasksAgentNode[] = []
const doneFold: TasksAgentNode[] = []
const idleFold: TasksAgentNode[] = []
for (const child of visibleAgentChildren) {
const foldable = nodeFoldable(child, currentSessionId)
const auto = folded && foldable && isAutoFoldable(child, runsByOrigin, foldIdleMembers)
const manual = foldedIds?.has(child.id) === true && foldable
// The group a member belongs to decides which aggregate claims it — and
// therefore which expansion could have revealed it.
const group: TasksFoldKind = child.state === 'idle' ? 'idle' : 'done'
const expanded = expandedGroups?.has(foldGroupId(group, parentId)) === true
if (manual || (auto && !expanded)) {
if (group === 'idle') idleFold.push(child)
else doneFold.push(child)
} else {
kept.push(child)
}
}
for (const child of kept) {
out.push(child)
appendChildren(child.id, child.depth)
}
if (doneFold.length > 0) out.push(foldNode('done', parentId, depth + 1, doneFold))
if (idleFold.length > 0) out.push(foldNode('idle', parentId, depth + 1, idleFold))
const children: (TasksAgentNode | TasksWorkflowNode)[] = [...visibleAgentChildren]
for (let index = 0; index < runNodes.length; index += 1) {
const runNode = runNodes[index]
if (runNode === undefined) continue
out.push(runNode)
const members = memberNodes[index] ?? []
// The run's own members fold under the same triggers, the same two groups
// and the same precedence (manual fold, then the page-level rule, then
// the group expansion). The AUTOMATIC trigger applies the same STRUCTURAL
// guards as the parent's children — a member is often a RE-PARENTED
// catalog node (a real directory with `hasChildren`, team enrichment and
// its own run), not the synthetic leaf this loop used to assume, and
// folding one hid its whole branch (issue #784). The roster guard does
// not apply here: the member is not a roster row of this parent, and the
// idle head count is a roster-scanning rule — run members keep their own
// container's rule.
const keptMembers: TasksAgentNode[] = []
const runDone: TasksAgentNode[] = []
const runIdle: TasksAgentNode[] = []
for (const member of members) {
const foldable = nodeFoldable(member, currentSessionId)
const auto = folded && foldable && isAutoFoldable(member, runsByOrigin, true)
const manual = foldedIds?.has(member.id) === true && foldable
const group: TasksFoldKind = member.state === 'idle' ? 'idle' : 'done'
const expanded = expandedGroups?.has(foldGroupId(group, runNode.id)) === true
if (manual || (auto && !expanded)) {
if (group === 'idle') runIdle.push(member)
else runDone.push(member)
} else {
keptMembers.push(member)
}
}
out.push(...keptMembers)
if (runDone.length > 0) out.push(foldNode('done', runNode.id, runNode.depth + 1, runDone))
if (runIdle.length > 0) out.push(foldNode('idle', runNode.id, runNode.depth + 1, runIdle))
children.push(runNode, ...(memberNodes[index] ?? []))
}
return children
}
const rootSummary = byId[rootId]
@@ -592,17 +523,100 @@ export function buildTasksModel(input: TasksModelInput): TasksNode[] {
...(rootTeam !== undefined ? { team: rootTeam } : {}),
...(tasksByNode.get(rootId) !== undefined ? { tasks: tasksByNode.get(rootId) } : {}),
})
appendChildren(rootId, 0)
// Explicit stacks preserve pre-order without a call-stack limit on deep trees.
const pending = buildChildren(rootId, 0).reverse()
while (pending.length > 0) {
const node = pending.pop()!
out.push(node)
if (node.kind === 'workflow') continue
const children = buildChildren(node.id, node.depth)
for (let index = children.length - 1; index >= 0; index -= 1) pending.push(children[index]!)
}
// Last-resort guard: one node per session id, first occurrence wins. Real
// catalogs list a child under exactly one parent, so this only fires on
// pathological trees (and keeps React keys unique when it does).
const seen = new Set<string>()
return out.filter((node) => {
if (seen.has(node.id)) return false
seen.add(node.id)
return true
})
const childrenById = new Map<string, (TasksAgentNode | TasksWorkflowNode)[]>()
for (const node of out) {
if (node.parentId === undefined) continue
const children = childrenById.get(node.parentId)
if (children === undefined) childrenById.set(node.parentId, [node])
else children.push(node)
}
// Reverse pre-order means every child's facts are ready before its parent.
// Subtree ranges also let aggregates collect hidden agents once, including
// descendants that would have formed their own groups when visible.
const settled = new Map<string, boolean>()
const subtreeEnd = new Map<string, number>()
const indexById = new Map(out.map((node, index) => [node.id, index]))
for (let index = out.length - 1; index >= 0; index -= 1) {
const node = out[index]!
const children = childrenById.get(node.id) ?? []
const known = node.kind === 'workflow' || catalogs[node.id]?.state === 'ready'
|| (node.synthesized === true && node.childAddress === undefined && catalogs[node.id] === undefined)
const ownSettled = node.kind === 'workflow'
? node.run.status !== 'running'
: nodeFoldable(node, currentSessionId) && node.state !== 'idle' && known
// An opened child group keeps this branch reachable under automatic rules;
// manual folds below still override it without consulting subtree facts.
settled.set(node.id, ownSettled
&& expandedGroups?.has(foldGroupId('done', node.id)) !== true
&& expandedGroups?.has(foldGroupId('idle', node.id)) !== true
&& children.every(child => settled.get(child.id) === true))
const last = children.at(-1)
subtreeEnd.set(node.id, last === undefined ? index + 1 : subtreeEnd.get(last.id)!)
}
const projectChildren = (parent: TasksAgentNode | TasksWorkflowNode): TasksNode[] => {
const visible: TasksNode[] = []
const children = childrenById.get(parent.id) ?? []
const idleCount = children.filter(child => child.kind === 'agent' && child.state === 'idle' && child.team !== undefined).length
const foldIdle = parent.kind === 'workflow' || idleCount >= FOLD_IDLE_MIN
const groups: Record<TasksFoldKind, TasksAgentNode[]> = { done: [], idle: [] }
const workflows: TasksWorkflowNode[] = []
for (const child of children) {
if (child.kind === 'workflow') {
workflows.push(child)
continue
}
const group: TasksFoldKind = child.state === 'idle' ? 'idle' : 'done'
const descendants = childrenById.get(child.id) ?? []
const branch = descendants.length > 0 || child.hasChildren === true
const idleSafe = child.state === 'idle' && !branch && nodeFoldable(child, currentSessionId)
&& (catalogs[child.id]?.state === 'ready'
|| (child.synthesized === true && child.childAddress === undefined && catalogs[child.id] === undefined))
const auto = folded && (group === 'idle'
? input.autoFoldIdle !== false && foldIdle && idleSafe
: settled.get(child.id) === true && (branch ? input.autoFoldBranches !== false : input.autoFoldSettled !== false)
// Keep the existing roster guard for failed members below threshold.
&& (child.team === undefined || foldIdle))
const manual = foldedIds?.has(child.id) === true && nodeFoldable(child, currentSessionId)
const expanded = expandedGroups?.has(foldGroupId(group, parent.id)) === true
if (manual || (auto && !expanded)) {
const start = indexById.get(child.id)!
const end = subtreeEnd.get(child.id)!
for (let index = start; index < end; index += 1) {
const hidden = out[index]!
if (hidden.kind === 'agent') groups[group].push(hidden)
}
} else {
visible.push(child)
}
}
for (const group of ['done', 'idle'] as const) {
if (groups[group].length > 0) visible.push(foldNode(group, parent.id, parent.depth + 1, groups[group]))
}
visible.push(...workflows)
return visible
}
const projected: TasksNode[] = []
const pendingProjection: TasksNode[] = [out[0]!]
while (pendingProjection.length > 0) {
const node = pendingProjection.pop()!
projected.push(node)
if (node.kind === 'fold') continue
const children = projectChildren(node)
for (let index = children.length - 1; index >= 0; index -= 1) pendingProjection.push(children[index]!)
}
return projected
}
/** The parent→child edges of a model (derived, kept out of the build). */
+4
View File
@@ -87,6 +87,10 @@ export const PrefsSchema: z<SidebarPrefs> = z.object({
autoOpenSubagent: z.boolean().default(true),
autoOpenJobs: z.boolean().default(true),
tasksViewMode: z.union([z.const('graph'), z.const('tree')]).default('graph'),
tasksAutoFoldSettled: z.boolean().default(true),
tasksAutoFoldBranches: z.boolean().default(true),
tasksAutoFoldIdle: z.boolean().default(true),
jobsAutoCollapse: z.boolean().default(true),
mobileNoAutoOpen: z.boolean().default(true),
mobileDefaultTree: z.boolean().default(true),
agentOpenTools: z.boolean().default(false),
+15
View File
@@ -27,6 +27,17 @@ export interface SidebarPrefs {
* classic indentation tree (the in-page toggle still flips it ad hoc).
*/
tasksViewMode: 'graph' | 'tree'
/** Automatically fold settled leaf tasks (agents without child agents). */
tasksAutoFoldSettled: boolean
/** Aggregate a fully settled branch independently of the settled-leaf switch. */
tasksAutoFoldBranches: boolean
/** Aggregate idle teammates when at least three are idle. */
tasksAutoFoldIdle: boolean
/**
* Collapse the jobs drawer when the agent count reaches eight; manual
* toggling remains available.
*/
jobsAutoCollapse: boolean
/**
* MOBILE ADAPTATION (narrow viewports, `isNarrowWidth`): while the viewport
* is narrow, do not auto-activate the Tasks page for background activity —
@@ -141,6 +152,10 @@ export const SIDEBAR_PREFS_DEFAULTS: SidebarPrefs = {
autoOpenSubagent: true,
autoOpenJobs: true,
tasksViewMode: 'graph',
tasksAutoFoldSettled: true,
tasksAutoFoldBranches: true,
tasksAutoFoldIdle: true,
jobsAutoCollapse: true,
// Both mobile adaptations are ON by default: a phone is the case they exist
// for, and each one only ever changes what happens on a NARROW viewport.
mobileNoAutoOpen: true,
+8 -2
View File
@@ -162,14 +162,20 @@ describe('built-in tab registrations', () => {
expect(sidechat?.dedupeKey?.(first!.tab)).toBeUndefined()
})
it('the subagent tab declares its auto-open related settings', () => {
it('the subagent tab declares its auto-open, view, folding, and jobs settings', () => {
const { service } = setup()
const toggles = service.getTab('subagent')?.settings?.toggles ?? []
expect(toggles.map(t => t.key)).toEqual(['autoOpenSubagent', 'autoOpenJobs', 'tasksViewMode'])
expect(toggles.map(t => t.key)).toEqual(['autoOpenSubagent', 'autoOpenJobs', 'tasksViewMode',
'tasksAutoFoldSettled', 'tasksAutoFoldBranches', 'tasksAutoFoldIdle', 'jobsAutoCollapse'])
// The default-view row is a graph/tree select (values are strings).
const viewMode = toggles[2]
expect(viewMode?.type).toBe('select')
expect((viewMode?.options ?? []).map(o => o.value)).toEqual(['graph', 'tree'])
for (const toggle of toggles.slice(3)) {
expect(toggle.type ?? 'switch', toggle.key).toBe('switch')
expect(typeof toggle.title === 'function' ? toggle.title() : toggle.title, toggle.key).toBeTruthy()
expect(typeof toggle.desc === 'function' ? toggle.desc() : toggle.desc, toggle.key).toBeTruthy()
}
})
it('the editor tab declares its merged-mode (embedded file tree) and exclude-pattern settings', () => {
+131 -1
View File
@@ -69,7 +69,137 @@ test.skip(VARIANT === undefined, 'requires the dedicated Context integration pro
/** The lane's workspace (the script owns the directory). */
const WORKSPACE_PATH = process.env.DSH_E2E_WORKSPACE ?? join(tmpdir(), 'dsh-e2e-context-workspace')
let api: APIRequestContext
/** Optional scale lane; normal Context integration runs keep their fixture size. */
const SCALE_AGENTS = process.env.DSH_E2E_CONTEXT_AGENTS === undefined
? undefined : Number(process.env.DSH_E2E_CONTEXT_AGENTS)
// Measure the same expansion on both tarballs without the baseline's known pan
// click bug preventing the measurement. Normal runs retain the full regression.
const TASKS_MEASURE_ONLY = process.env.DSH_E2E_TASKS_MEASURE_ONLY === '1'
test('tasks graph: many agents paint and remain clickable after background pans', async ({ page }) => {
test.skip(SCALE_AGENTS === undefined, 'set DSH_E2E_CONTEXT_AGENTS to opt into the scale fixture')
const count = SCALE_AGENTS!
expect(Number.isSafeInteger(count) && count > 1, 'scale lane requires at least two agents').toBe(true)
test.setTimeout(180_000)
const { pageErrors, consoleErrors } = watchFrame(page)
await page.emulateMedia({ reducedMotion: 'reduce' })
await boot(page)
await mountSession(page, PARENT_SESSION_ID)
await openGuideEntry(page, 'subagent')
const owner = sessionOwner(page, PARENT_SESSION_ID)
const graph = owner.getByRole('group', { name: /^(Workflow graph|工作流图)$/ })
const switchGraph = owner.getByRole('button', { name: /^(Switch to the workflow graph|切换为工作流图)$/ })
if (await switchGraph.isVisible()) await switchGraph.click()
await expect(graph).toBeVisible({ timeout: 60_000 })
const aggregate = graph.locator('[data-graph-node]:has([data-card-kind="fold"])')
// Waiting for the full tally prevents measuring an incompletely hydrated catalog.
await expect(aggregate).toHaveCount(1, { timeout: 90_000 })
await expect(aggregate).toHaveAccessibleName(new RegExp(`(^|\\D)${count}(\\D|$)`), { timeout: 90_000 })
await expect(graph.locator('[data-graph-node]')).toHaveCount(2)
const pan = async (): Promise<void> => {
const inner = graph.locator(':scope > div[style*="transform"]')
const before = await inner.getAttribute('style')
const point = await graph.evaluate(element => {
const rect = element.getBoundingClientRect()
for (let y = rect.top + 20; y < rect.bottom - 60; y += 24) {
for (let x = rect.left + 20; x < rect.right - 40; x += 24) {
const hit = document.elementFromPoint(x, y)
if (hit !== null && element.contains(hit) && hit.closest('[data-graph-node], [data-graph-controls]') === null) {
return { x, y }
}
}
}
throw new Error('no graph background point available for a real pan')
})
await page.mouse.move(point.x, point.y)
await page.mouse.down()
await page.mouse.move(point.x + 18, point.y + 14, { steps: 6 })
await page.mouse.up()
await expect(inner).not.toHaveAttribute('style', before!)
}
const clickCard = async (card: ReturnType<Page['locator']>): Promise<void> => {
const position = await card.evaluate(element => {
const rect = element.getBoundingClientRect()
const x = rect.left + rect.width / 2
const y = rect.top + rect.height / 3
const hit = document.elementFromPoint(x, y)
if (hit === null || !element.contains(hit)) throw new Error('graph card is not hit-testable after pan')
return { x, y }
})
await page.mouse.click(position.x, position.y)
}
if (!TASKS_MEASURE_ONLY) await pan()
// Install the clock before the real pointer event. Completion is the first
// full card population followed by two animation frames, not a wall-clock gate.
await aggregate.evaluate((element, expected) => {
const canvas = element.closest('[role="group"]')!
type Measurement = { elapsedMs: number; cards: number; longTasks: { startTime: number; duration: number }[]; longTasksSupported: boolean }
const state = window as typeof window & { __tasksGraphPaint?: Promise<Measurement> }
state.__tasksGraphPaint = new Promise(resolve => {
let started = 0
let finishing = false
const longTasks: { startTime: number; duration: number }[] = []
const supported = PerformanceObserver.supportedEntryTypes.includes('longtask')
const record = (entries: PerformanceEntry[]): void => {
for (const entry of entries) if (entry.startTime >= started) longTasks.push({ startTime: entry.startTime, duration: entry.duration })
}
const observer = supported ? new PerformanceObserver(list => { record(list.getEntries()) }) : undefined
const mutation = new MutationObserver(() => {
if (started === 0 || finishing || canvas.querySelectorAll('[data-graph-node]').length !== expected) return
finishing = true
requestAnimationFrame(() => { requestAnimationFrame(() => {
const ended = performance.now()
if (observer !== undefined) record(observer.takeRecords())
observer?.disconnect()
mutation.disconnect()
resolve({ elapsedMs: ended - started, cards: canvas.querySelectorAll('[data-graph-node]').length,
longTasks: longTasks.filter(entry => entry.startTime < ended), longTasksSupported: supported })
}) })
})
element.addEventListener('pointerdown', () => {
started = performance.now()
observer?.observe({ type: 'longtask' })
mutation.observe(canvas, { childList: true, subtree: true })
}, { once: true })
})
}, count + 1)
await clickCard(aggregate)
await expect(graph.locator('[data-graph-node]')).toHaveCount(count + 1, { timeout: 60_000 })
const measurement = await page.evaluate(async () => {
const state = window as typeof window & { __tasksGraphPaint?: Promise<unknown> }
const result = await state.__tasksGraphPaint
delete state.__tasksGraphPaint
return result
})
await test.info().attach('tasks-graph-paint.json', { body: JSON.stringify({ agents: count, measurement }, null, 2), contentType: 'application/json' })
console.log(`[tasks graph] ${JSON.stringify({ agents: count, measurement })}`)
if (TASKS_MEASURE_ONLY) {
expect(pageErrors, 'uncaught page errors').toEqual([])
expect(consoleErrors, 'console errors').toEqual([])
return
}
await pan()
const childCard = graph.locator(`[data-graph-node="${CHILD_SESSION_ID}"]`)
await clickCard(childCard)
const details = page.getByRole('dialog').filter({ hasText: CHILD_LABEL })
await expect(details).toBeVisible({ timeout: 30_000 })
await page.keyboard.press('Escape')
await expect(details).toHaveCount(0)
const fold = childCard.getByRole('button', { name: /^(Fold into completed|收进已完成聚合)$/ })
await expect(fold).toBeVisible()
await fold.click()
await expect(childCard).toHaveCount(0)
await expect(graph.locator('[data-graph-node]:has([data-card-kind="fold"])')).toHaveCount(1)
await expect(graph.locator('[data-graph-node]')).toHaveCount(count + 1)
expect(pageErrors, 'uncaught page errors').toEqual([])
expect(consoleErrors, 'console errors').toEqual([])
})
let api: APIRequestContext | undefined
test.beforeAll(async () => {
api = await createHostApi()
+28 -14
View File
@@ -39,6 +39,12 @@ const PARENT_ID = 'session-e2e-context-parent'
/** The fixture child session (visible to the host's subagent catalog). */
const CHILD_ID = 'session-e2e-context-child'
/** Optional scale fixture; the default preserves the original single child. */
const CHILD_COUNT = Number(process.env.DSH_E2E_CONTEXT_AGENTS ?? 1)
if (!Number.isSafeInteger(CHILD_COUNT) || CHILD_COUNT < 1) {
throw new Error('DSH_E2E_CONTEXT_AGENTS must be a positive safe integer')
}
/** The child's descriptor label — deliberately NOT the 'Side: ' prefix, which
* the plugin's topology filters out as a side-chat thread. */
const CHILD_LABEL = 'Context fixture child'
@@ -76,26 +82,34 @@ async function seed(ctx) {
if (parent === undefined) return false
const cwd = process.env.DSH_E2E_CONTEXT_WORKSPACE ?? parent.session?.header?.cwd
const descriptor = {
version: SUBAGENT_DESCRIPTOR_VERSION,
mode: 'one-shot',
provider: 'e2e-context-fixture',
label: CHILD_LABEL,
}
const message = (id, text) => ({ id, role: 'user', source: { kind: 'user' }, content: [{ type: 'text', text }] })
const parentMarker = 'E2E_PARENT_CONTEXT_MARKER'
const childMarker = 'E2E_CHILD_CONTEXT_MARKER'
if (!parent.session.snapshotEvents().some(event => event.type === 'user/message' && event.data.id === 'fixture-parent-message')) {
parent.session.append('user/message', message('fixture-parent-message', parentMarker), { surfaceOp: 'append' })
}
const seedEvents = [
{ type: 'subagent/descriptor', seq: 0, time: Date.now(), data: descriptor },
{ type: 'user/message', seq: 1, time: Date.now(), data: message('fixture-child-message', childMarker), surfaceOp: 'append' },
]
if (agents.get(CHILD_ID) === undefined) {
for (let index = 0; index < CHILD_COUNT; index += 1) {
const childId = index === 0 ? CHILD_ID : `${CHILD_ID}-${index}`
if (agents.get(childId) !== undefined) continue
const label = index === 0 ? CHILD_LABEL : `${CHILD_LABEL} ${index + 1}`
const descriptor = {
version: SUBAGENT_DESCRIPTOR_VERSION,
mode: 'one-shot',
provider: 'e2e-context-fixture',
label,
}
const seedEvents = [
{ type: 'subagent/descriptor', seq: 0, time: Date.now(), data: descriptor },
{
type: 'user/message', seq: 1, time: Date.now(),
data: message(index === 0 ? 'fixture-child-message' : `fixture-child-message-${index}`,
index === 0 ? childMarker : `${childMarker}_${index}`),
surfaceOp: 'append',
},
]
const handle = await agents.create({
sessionId: CHILD_ID,
sessionId: childId,
meta: {
...(typeof cwd === 'string' && cwd !== '' ? { cwd } : {}),
parentSession: PARENT_ID,
@@ -117,9 +131,9 @@ async function seed(ctx) {
childId: header.id,
childCreatedAt: header.createdAt,
mode: 'one-shot',
label: CHILD_LABEL,
label,
})
log(`seeded child session ${CHILD_ID} under ${PARENT_ID}`)
log(`seeded child session ${childId} under ${PARENT_ID}`)
}
const jobs = ctx.get('jobs')
+16
View File
@@ -50,6 +50,22 @@ describe('dsh-better-sidebar plugin export shape', () => {
expect(legacy.listLimit).toBe(1000)
})
it('keeps automatic task folding and jobs collapse boolean, default-on, and volatile', async () => {
const { PrefsSchema, Config } = await import('../src/config.ts')
const resolve = PrefsSchema as unknown as (input: Record<string, unknown>) => Record<string, unknown>
const keys = ['tasksAutoFoldSettled', 'tasksAutoFoldBranches', 'tasksAutoFoldIdle', 'jobsAutoCollapse'] as const
for (const key of keys) {
expect(resolve({})[key], key).toBe(true)
expect(resolve({ [key]: false })[key], key).toBe(false)
expect(resolve({ [key]: true })[key], key).toBe(true)
for (const malformed of ['false', 0, [], {}]) {
expect(() => resolve({ [key]: malformed }), key).toThrow()
}
expect(Config.dict?.[key]?.meta.volatile, key).toBe(true)
}
expect(Config.dict?.listLimit?.meta.volatile).not.toBe(true)
})
it('registers the side card preferences schema with the documented defaults', async () => {
const { PrefsSchema, SIDEBAR_PREFS_NS, SIDEBAR_PREFS_DEFAULTS } = await import('../src/config.ts')
expect(SIDEBAR_PREFS_NS).toBe('dsh-better-sidebar')
+23
View File
@@ -35,6 +35,10 @@ describe('side card preferences', () => {
autoOpenSubagent: false,
autoOpenJobs: true,
tasksViewMode: 'graph',
tasksAutoFoldSettled: true,
tasksAutoFoldBranches: true,
tasksAutoFoldIdle: true,
jobsAutoCollapse: true,
mobileNoAutoOpen: true,
mobileDefaultTree: true,
agentOpenTools: true,
@@ -56,6 +60,10 @@ describe('side card preferences', () => {
autoOpenSubagent: true,
autoOpenJobs: true,
tasksViewMode: 'graph',
tasksAutoFoldSettled: true,
tasksAutoFoldBranches: true,
tasksAutoFoldIdle: true,
jobsAutoCollapse: true,
mobileNoAutoOpen: true,
mobileDefaultTree: true,
agentOpenTools: false,
@@ -77,6 +85,10 @@ describe('side card preferences', () => {
autoOpenSubagent: true,
autoOpenJobs: true,
tasksViewMode: 'graph',
tasksAutoFoldSettled: true,
tasksAutoFoldBranches: true,
tasksAutoFoldIdle: true,
jobsAutoCollapse: true,
mobileNoAutoOpen: true,
mobileDefaultTree: true,
agentOpenTools: false,
@@ -106,6 +118,17 @@ describe('side card preferences', () => {
.toBe(false)
})
it('defaults automatic task folding and jobs collapse to on and preserves explicit booleans', async () => {
for (const key of ['tasksAutoFoldSettled', 'tasksAutoFoldBranches', 'tasksAutoFoldIdle', 'jobsAutoCollapse'] as const) {
expect(SIDEBAR_PREFS_DEFAULTS[key], key).toBe(true)
for (const malformed of [undefined, null, 'false', 0, [], {}]) {
expect((await loadPrefs(wire({ [key]: malformed })))[key], key).toBe(true)
}
expect((await loadPrefs(wire({ [key]: false })))[key], key).toBe(false)
expect((await loadPrefs(wire({ [key]: true })))[key], key).toBe(true)
}
})
it('defaults both mobile adaptations to on; only an explicit false disarms one', async () => {
// Absent or malformed → ON: a phone is exactly the case these exist for,
// and each one only changes what happens on a NARROW viewport.
+3
View File
@@ -262,6 +262,9 @@ describe('SubagentView topology (projectionsBySession)', () => {
},
})
const { container, unmount } = await renderPage(store)
await act(async () => {
(container.querySelector('button[aria-label="展开已完成的节点"]') as HTMLButtonElement).click()
})
expect(container.textContent).toContain('Worker')
expect(container.textContent).toContain('Grandchild')
expect(container.textContent).toContain('可续接')
+97 -1
View File
@@ -4,11 +4,13 @@
* reservation that stops a wrapped band from landing on a sibling's
* children), the PER-SHAPE card height (the mode chip's badge row and the
* shared-task row a card renders are reserved, so a card never renders outside
* its box), and the width-aware solver.
* its box), exact coordinates and order for nested bands, large sibling sets,
* a 6000-node chain, and width-aware solver candidate reuse within one call.
*/
import { describe, expect, it } from 'vitest'
import {
GRAPH_AGENT_NODE_H,
GRAPH_GAP_X,
GRAPH_GAP_Y,
GRAPH_NODE_H,
GRAPH_NODE_W,
@@ -169,7 +171,101 @@ describe('layout: card heights', () => {
})
})
describe('layout: scale and traversal', () => {
it('preserves exact coordinates and depth-first order for nested bands and an orphan', () => {
// Deliberately not pre-order: child dimensions must be resolved from edges.
const nodes = [
agent('a1', 'a'), agent('root'), agent('a', 'root'), agent('b', 'root'),
agent('c', 'root'), agent('a2', 'a'), agent('a3', 'a'), agent('b1', 'b'),
agent('orphan', 'missing'),
]
const layout = layoutTasksGraph(nodes, { maxBandCols: 2 })
const stride = rowStrideFor(nodes)
expect([...layout.boxes.values()]).toEqual([
['root', 234, 0], ['a', 125, 1], ['a1', 16, 2], ['a2', 234, 2],
['a3', 125, 3], ['b', 452, 1], ['b1', 452, 2], ['c', 234, 4],
['orphan', 670, 0],
].map(([id, x, row]) => ({
id, x, y: GRAPH_PAD + Number(row) * stride, w: GRAPH_NODE_W, h: GRAPH_AGENT_NODE_H,
})))
expect(layout.width).toBe(876)
expect(layout.height).toBe(2 * GRAPH_PAD + 4 * stride + GRAPH_AGENT_NODE_H)
})
it('lays out 2000 siblings in ordered, non-overlapping bands inside the extent', () => {
const nodes = [agent('root'), ...Array.from({ length: 2000 }, (_, i) => agent(`c${i}`, 'root'))]
const layout = layoutTasksGraph(nodes, { maxBandCols: 4 })
const stride = rowStrideFor(nodes)
expect(layout.boxes.size).toBe(nodes.length)
for (let i = 0; i < 2000; i += 1) {
expect(layout.boxes.get(`c${i}`)).toEqual({
id: `c${i}`, x: GRAPH_PAD + (i % 4) * (GRAPH_NODE_W + GRAPH_GAP_X),
y: GRAPH_PAD + (1 + Math.floor(i / 4)) * stride,
w: GRAPH_NODE_W, h: GRAPH_AGENT_NODE_H,
})
}
expect(layout.width).toBe(2 * GRAPH_PAD + 4 * GRAPH_NODE_W + 3 * GRAPH_GAP_X)
expect(layout.height).toBe(2 * GRAPH_PAD + 500 * stride + GRAPH_AGENT_NODE_H)
})
it('places every node in a 6000-node chain without recursive stack growth', () => {
const nodes = Array.from({ length: 6000 }, (_, i) => agent(`n${i}`, i === 0 ? undefined : `n${i - 1}`))
const stride = rowStrideFor(nodes)
for (const layout of [layoutTasksGraph(nodes), layoutTasksGraphForWidth(nodes, 360)]) {
expect(layout.boxes.size).toBe(nodes.length)
for (let i = 0; i < nodes.length; i += 1) {
expect(layout.boxes.get(`n${i}`)).toEqual({
id: `n${i}`, x: GRAPH_PAD, y: GRAPH_PAD + i * stride,
w: GRAPH_NODE_W, h: GRAPH_AGENT_NODE_H,
})
}
expect(layout.width).toBe(2 * GRAPH_PAD + GRAPH_NODE_W)
expect(layout.height).toBe(2 * GRAPH_PAD + (nodes.length - 1) * stride + GRAPH_AGENT_NODE_H)
}
})
})
describe('bandColsFor / layoutTasksGraphForWidth', () => {
it('reuses the two-column candidate in the tolerant pass, but refreshes on the next call', () => {
let reads = 0
let text = ''
const root = agent('root')
Object.defineProperty(root, 'live', { get: () => {
reads += 1
return { running: true, text }
} })
const nodes = [root, ...Array.from({ length: 6 }, (_, i) => agent(`c${i}`, 'root'))]
const first = layoutTasksGraphForWidth(nodes, 360)
// One layout reads the root height twice: stride measurement and placement.
// 440px exceeds the strict budget, but fits its tolerant second pass.
expect(first.width).toBe(440)
expect(reads).toBe(2)
text = 'x'
const second = layoutTasksGraphForWidth(nodes, 360)
expect(reads).toBe(4)
expect(second.boxes.get('root')!.h).toBe(first.boxes.get('root')!.h + 15)
expect(second.boxes).not.toBe(first.boxes)
})
it('evaluates each column count once when every multi-column candidate overflows', () => {
let reads = 0
const root = agent('root')
Object.defineProperty(root, 'live', { get: () => { reads += 1; return undefined } })
const nodes = [root]
let level = [root]
for (let depth = 0; depth < 3; depth += 1) {
const next = level.flatMap(parent => Array.from({ length: 4 }, (_, i) => agent(`${parent.id}-${i}`, parent.id)))
nodes.push(...next)
level = next
}
const layout = layoutTasksGraphForWidth(nodes, 720)
// Four candidates (4, 3, 2, 1), each measuring and placing the root once.
expect(reads).toBe(8)
expect(layout.width).toBe(2 * GRAPH_PAD + GRAPH_NODE_W)
expect(layout.boxes.size).toBe(nodes.length)
expect(layout).toEqual(layoutTasksGraph(nodes, { maxBandCols: 1 }))
})
it('derives the column count from the container width', () => {
// The budget is measured at the READABILITY FLOOR, not at 1:1: the fit may
// scale the canvas down to 0.78 and stay readable, so a 360px panel keeps
+251 -4
View File
@@ -1,7 +1,7 @@
/**
* Unit tests for the unified Tasks view model (buildTasksModel / tasksEdges):
* catalog walking, workflow run attachment + member re-parenting, team
* enrichment, and the per-parent settled-leaf fold.
* enrichment, and per-parent settled subtree / idle folds.
*/
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { attachLocale } from '../src/client/locales.ts'
@@ -198,7 +198,7 @@ describe('buildTasksModel', () => {
expect(model.map(node => node.id)).toEqual(['root', 'mate'])
})
it('folds settled leaves per parent and keeps running/teammate/current rows', () => {
it('folds settled leaves per parent and keeps running/idle/unknown branches', () => {
const model = buildTasksModel(input({
catalogs: {
root: catalog([
@@ -210,7 +210,8 @@ describe('buildTasksModel', () => {
'done-2': catalog([]),
'live': catalog([]),
'mate': catalog([]),
// `parent` has a child of its own, so it keeps its whole branch.
// Its descendant catalog is unknown: keep the branch reachable. A fully
// known settled branch now folds under the independent branch rule.
parent: catalog([child('grandchild')]),
},
byId: {
@@ -420,7 +421,7 @@ describe('buildTasksModel', () => {
}],
})
const base = input({
catalogs: { root: catalog([child('m1')]), m1: catalog([]) },
catalogs: { root: catalog([child('m1')]), m1: catalog([]), m2: catalog([]) },
byId: { root: summary('root'), m1: summary('m1') },
runs: [audit],
})
@@ -448,6 +449,252 @@ describe('buildTasksModel', () => {
})
})
describe('buildTasksModel: settled branches', () => {
const branch = (): TasksModelInput => input({
catalogs: { root: catalog([child('a')]), a: catalog([child('b')]), b: catalog([]) },
})
it('builds and folds a deep chain without exhausting the call stack', () => {
const catalogs: Record<string, SubagentCatalogView> = {}
const size = 12000
for (let index = 0; index < size; index += 1) {
catalogs[index === 0 ? 'root' : `n${index}`] = catalog([child(`n${index + 1}`)])
}
catalogs[`n${size}`] = catalog([])
const base = input({ catalogs })
const opened = buildTasksModel({ ...base, folded: false })
expect(opened).toHaveLength(12001)
expect(opened.at(-1)).toMatchObject({ id: 'n12000', depth: 12000 })
expect(buildTasksModel(base)).toMatchObject([
{ id: 'root' }, { id: 'fold:root', count: 12000 },
])
expect(buildTasksModel({ ...base, expandedGroups: new Set(['fold:n11999']) }))
.toHaveLength(12001)
})
it('aggregates all hidden agents and restores each level when groups expand', () => {
const base = branch()
expect(buildTasksModel(base)).toMatchObject([
{ id: 'root' }, { id: 'fold:root', count: 2, doneCount: 2, memberIds: ['a', 'b'] },
])
expect(buildTasksModel({ ...base, expandedGroups: new Set(['fold:root']) }).map(node => node.id))
.toEqual(['root', 'a', 'fold:a'])
expect(buildTasksModel({ ...base, expandedGroups: new Set(['fold:root', 'fold:a']) }).map(node => node.id))
.toEqual(['root', 'a', 'b'])
})
it('keeps an expanded descendant group visible after its running ancestor settles', () => {
const base = branch()
expect(buildTasksModel({ ...base, live: running('a') }).map(node => node.id))
.toEqual(['root', 'a', 'fold:a'])
const opened = { ...base, expandedGroups: new Set(['fold:a']) }
expect(buildTasksModel({ ...opened, live: running('a') }).map(node => node.id))
.toEqual(['root', 'a', 'b'])
expect(buildTasksModel(opened).map(node => node.id)).toEqual(['root', 'a', 'b'])
})
it('keeps every settled ancestor of an expanded group visible', () => {
const base = input({
catalogs: {
root: catalog([child('a'), child('sibling')]), a: catalog([child('b')]),
b: catalog([child('c')]), c: catalog([]), sibling: catalog([]),
},
expandedGroups: new Set(['fold:b']),
})
expect(buildTasksModel(base).map(node => node.id))
.toEqual(['root', 'a', 'b', 'c', 'fold:root'])
expect(buildTasksModel(base).find(node => node.kind === 'fold'))
.toMatchObject({ memberIds: ['sibling'] })
})
it('lets an explicitly revealed descendant fold back without losing its ancestor', () => {
const base = { ...branch(), expandedGroups: new Set(['fold:a']), foldedIds: new Set(['b']) }
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'a', 'fold:a'])
expect(buildTasksModel(base).find(node => node.kind === 'fold'))
.toMatchObject({ memberIds: ['b'] })
})
it.each([true, false])('lets a manual ancestor fold override a descendant expansion (auto %s)', (folded) => {
const model = buildTasksModel({
...branch(), folded, expandedGroups: new Set(['fold:a']), foldedIds: new Set(['a']),
})
expect(model.map(node => node.id)).toEqual(['root', 'fold:root'])
expect(model.at(-1)).toMatchObject({ memberIds: ['a', 'b'], count: 2 })
})
it.each(['running', 'current', 'unknown', 'error', 'idle', 'provisioning'])(
'keeps a branch reachable with a %s descendant', (guard) => {
const base = branch()
if (guard === 'running') base.live = running('b')
if (guard === 'current') base.currentSessionId = 'b'
if (guard === 'unknown') base.catalogs = { ...base.catalogs, b: undefined }
if (guard === 'error') base.catalogs = { ...base.catalogs, b: { entries: [], state: 'error', error: { message: 'unavailable' } } }
if (guard === 'idle') base.teamMembers = [member({ id: 'b', status: 'idle' })]
if (guard === 'provisioning') base.teamMembers = [member({ id: 'b', phase: 'provisioning', status: 'provisioning' })]
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'a', 'b'])
},
)
it('releases an automatic branch fold as soon as a descendant runs', () => {
const base = branch()
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'fold:root'])
expect(buildTasksModel({ ...base, live: running('b') }).map(node => node.id)).toEqual(['root', 'a', 'b'])
})
it('controls settled leaves, settled branches and idle members independently', () => {
const base = branch()
expect(buildTasksModel({ ...base, autoFoldBranches: false }).map(node => node.id))
.toEqual(['root', 'a', 'fold:a'])
expect(buildTasksModel({ ...base, autoFoldSettled: false }).map(node => node.id))
.toEqual(['root', 'fold:root'])
expect(buildTasksModel({ ...base, folded: false }).map(node => node.id)).toEqual(['root', 'a', 'b'])
const mates = ['m1', 'm2', 'm3']
const idle = input({
catalogs: { root: catalog(mates.map(id => child(id))), ...Object.fromEntries(mates.map(id => [id, catalog([])])) },
teamMembers: mates.map(id => member({ id, status: 'idle' })),
autoFoldSettled: false, autoFoldBranches: false,
})
expect(buildTasksModel(idle).map(node => node.id)).toEqual(['root', 'fold:root:idle'])
expect(buildTasksModel({ ...idle, autoFoldIdle: false }).map(node => node.id)).toEqual(['root', ...mates])
})
it('keeps idle branches visible even when the roster reaches the idle threshold', () => {
const mates = ['m1', 'm2', 'm3']
const base = input({
catalogs: {
root: catalog(mates.map(id => child(id))), m1: catalog([child('b')]),
m2: catalog([]), m3: catalog([]), b: catalog([]),
},
teamMembers: mates.map(id => member({ id, status: 'idle' })),
})
expect(buildTasksModel(base).map(node => node.id))
.toEqual(['root', 'm1', 'fold:m1', 'fold:root:idle'])
})
it.each(['done', 'idle'] as const)(
'keeps synthesized workflow sessions visible while their catalog is unknown (%s)', (state) => {
const base = input({
catalogs: { root: catalog([]) },
runs: [run({ phases: [{ members: [{ seq: 1, label: 'm', childId: 'm', outcome: 'completed' }] }] })],
teamMembers: state === 'idle' ? [member({ id: 'm', status: 'idle' })] : [],
})
const model = buildTasksModel(base)
expect(model.map(node => node.id)).toEqual(['root', 'run:run-1', 'm'])
expect(model.at(-1)).toMatchObject({
synthesized: true, state, childAddress: { childSessionId: 'm' },
})
const aggregateId = state === 'idle' ? 'fold:run:run-1:idle' : 'fold:run:run-1'
expect(buildTasksModel({ ...base, catalogs: { ...base.catalogs, m: catalog([]) } })
.map(node => node.id)).toEqual(['root', 'run:run-1', aggregateId])
expect(buildTasksModel({ ...base, folded: false, foldedIds: new Set(['m']) })
.map(node => node.id)).toEqual(['root', 'run:run-1', aggregateId])
},
)
it.each(['done', 'idle'] as const)('still aggregates a pure workflow placeholder without a session (%s)', (state) => {
const base = input({
catalogs: { root: catalog([]) },
runs: [run({ phases: [{ members: [{ seq: 1, label: 'placeholder', childId: '', outcome: 'completed' }] }] })],
teamMembers: state === 'idle' ? [member({ id: 'wfmember:run-1:1', status: 'idle' })] : [],
})
const model = buildTasksModel(base)
expect(model.map(node => node.id)).toEqual([
'root', 'run:run-1', state === 'idle' ? 'fold:run:run-1:idle' : 'fold:run:run-1',
])
expect(model.at(-1)).toMatchObject({ count: 1, memberIds: ['wfmember:run-1:1'] })
const opened = buildTasksModel({ ...base, folded: false })
expect(opened.at(-1)).toMatchObject({ id: 'wfmember:run-1:1', synthesized: true, state })
expect(agents(opened).at(-1)?.childAddress).toBeUndefined()
})
it('keeps settled ancestors of a workflow member with an unknown real session reachable', () => {
const base = input({
catalogs: { root: catalog([child('a')]), a: catalog([]) },
runs: [run({ originSessionId: 'a', status: 'completed', phases: [{ members: [
{ seq: 1, label: 'm', childId: 'm', outcome: 'completed' },
] }] })],
})
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'a', 'run:run-1', 'm'])
expect(buildTasksModel({ ...base, catalogs: { ...base.catalogs, m: catalog([]) } }).at(-1))
.toMatchObject({ id: 'fold:root', count: 2, memberIds: ['a', 'm'] })
})
it('keeps ancestors reachable through an expanded workflow group', () => {
const base = input({
catalogs: { root: catalog([child('a')]), a: catalog([]), m: catalog([]) },
runs: [run({ originSessionId: 'a', status: 'completed', phases: [{ members: [
{ seq: 1, label: 'm', childId: 'm', outcome: 'completed' },
] }] })],
expandedGroups: new Set(['fold:run:run-1']),
})
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'a', 'run:run-1', 'm'])
expect(buildTasksModel({ ...base, foldedIds: new Set(['a']) }).at(-1))
.toMatchObject({ id: 'fold:root', count: 2, memberIds: ['a', 'm'] })
})
it('walks descendants of retained and synthesized workflow members', () => {
const base = input({
catalogs: { root: catalog([child('m')]), m: catalog([child('b')]), b: catalog([]) },
runs: [run({ phases: [{ members: [{ seq: 1, label: 'm', childId: 'm', outcome: 'completed' }] }] })],
live: running('b'),
})
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'run:run-1', 'm', 'b'])
const synth = { ...base, catalogs: { ...base.catalogs, root: catalog([]) } }
expect(buildTasksModel(synth).map(node => node.id)).toEqual(['root', 'run:run-1', 'm', 'b'])
})
it('preserves workflow member subtrees, guards and hidden agent tallies', () => {
const base = input({
catalogs: { root: catalog([child('m')]), m: catalog([child('b')]), b: catalog([]) },
teamMembers: [member({ id: 'b', phase: 'failed', status: 'failed' })],
runs: [run({ status: 'completed', phases: [{ members: [
{ seq: 1, label: 'm', childId: 'm', outcome: 'completed' },
{ seq: 2, label: 'duplicate', childId: 'm', outcome: 'completed' },
] }] })],
})
expect(buildTasksModel(base)).toMatchObject([
{ id: 'root' }, { id: 'run:run-1' },
{ id: 'fold:run:run-1', count: 2, doneCount: 1, errorCount: 1, memberIds: ['m', 'b'] },
])
const opened = buildTasksModel({ ...base, folded: false })
expect(opened.map(node => node.id)).toEqual(['root', 'run:run-1', 'm', 'b'])
expect(agents(opened).find(node => node.id === 'b')).toMatchObject({ parentId: 'm', depth: 3 })
expect(tasksEdges(opened).map(edge => [edge.from, edge.to])).toEqual([
['root', 'run:run-1'], ['run:run-1', 'm'], ['m', 'b'],
])
expect(buildTasksModel({ ...base, currentSessionId: 'b' }).map(node => node.id))
.toEqual(['root', 'run:run-1', 'm', 'b'])
expect(buildTasksModel({ ...base, catalogs: { ...base.catalogs, b: undefined } }).map(node => node.id))
.toEqual(['root', 'run:run-1', 'm', 'b'])
expect(buildTasksModel({ ...base, live: running('b') }).map(node => node.id))
.toEqual(['root', 'run:run-1', 'm', 'b'])
})
it('reports all hidden descendants so expansion can release their manual folds', () => {
const base = branch()
const manuallyFolded = new Set(['a', 'b'])
const folded = buildTasksModel({ ...base, foldedIds: manuallyFolded, expandedGroups: new Set(['fold:root']) })
const aggregate = folded.find(node => node.kind === 'fold')!
expect(aggregate.memberIds).toEqual(['a', 'b'])
for (const id of aggregate.memberIds) manuallyFolded.delete(id)
expect(buildTasksModel({ ...base, foldedIds: manuallyFolded, expandedGroups: new Set(['fold:root', 'fold:a']) }).map(node => node.id))
.toEqual(['root', 'a', 'b'])
})
it('requires associated workflows to settle and counts agents only', () => {
const base = branch()
base.catalogs = { ...base.catalogs, m: catalog([]) }
base.runs = [run({ originSessionId: 'a', phases: [{ members: [{ seq: 1, label: 'm', childId: 'm', outcome: 'completed' }] }] })]
expect(buildTasksModel(base).map(node => node.id)).toEqual(['root', 'a', 'fold:a', 'run:run-1', 'fold:run:run-1'])
const settled = { ...base, runs: base.runs.map(item => ({ ...item, status: 'completed' as const })) }
expect(buildTasksModel(settled)).toMatchObject([
{ id: 'root' }, { id: 'fold:root', count: 3, memberIds: ['a', 'b', 'm'] },
])
expect(buildTasksModel({ ...settled, folded: false }).map(node => node.id))
.toEqual(['root', 'a', 'b', 'run:run-1', 'm'])
})
})
describe('tasksEdges', () => {
it('classifies team/workflow/agent edges', () => {
const audit = run({
+75 -10
View File
@@ -355,6 +355,52 @@ describe('Tasks page interactions', () => {
unmount()
})
it.each(['graph', 'tree'] as const)('follows automatic fold preferences in %s and keeps manual actions above them', async (mode) => {
const sidebar = createSidebarStore()
sidebar.setPrefs({ ...sidebar.getPrefs(), tasksViewMode: mode, mobileDefaultTree: false,
tasksAutoFoldSettled: false, tasksAutoFoldBranches: false, tasksAutoFoldIdle: false,
})
const { container, unmount } = renderRoot(createElement(SubagentView, {
sessionId: 'root', active: true, ctx: makeCtx(makeStore(snapshotWithChildren(2))), store: sidebar,
}))
const node = (id: string): Element | null => container.querySelector(`[data-graph-node="${id}"], [data-tree-node="${id}"]`)
expect(node('child-0')).not.toBeNull()
expect(node('fold:root')).toBeNull()
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), tasksAutoFoldSettled: true }) })
expect(node('fold:root')).not.toBeNull()
await act(async () => { (node('fold:root') as HTMLElement).click() })
expect(node('child-0')).not.toBeNull()
// A subsequent preference update cannot close the group the reader opened.
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), tasksAutoFoldSettled: false }) })
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), tasksAutoFoldSettled: true }) })
expect(node('child-0')).not.toBeNull()
await act(async () => {
(container.querySelector('[data-graph-controls] button:nth-child(2)') as HTMLButtonElement).click()
})
// The global manual expand remains above all later automatic settings.
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), tasksAutoFoldBranches: true, tasksAutoFoldIdle: true }) })
expect(node('child-0')).not.toBeNull()
unmount()
})
it('disables drawer auto-collapse live without overwriting a manual drawer choice', async () => {
const sidebar = createSidebarStore()
const { container, unmount } = renderRoot(createElement(SubagentView, {
sessionId: 'root', active: true, ctx: makeCtx(makeStore(snapshotWithChildren(8))), store: sidebar,
}))
await flushJobs()
const bar = container.querySelector('button[aria-expanded]') as HTMLButtonElement
expect(bar.getAttribute('aria-expanded')).toBe('false')
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), jobsAutoCollapse: false }) })
expect(bar.getAttribute('aria-expanded')).toBe('true')
expect(container.textContent).toContain('sleep 300')
await act(async () => { bar.click() })
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), jobsAutoCollapse: true }) })
await act(async () => { sidebar.setPrefs({ ...sidebar.getPrefs(), jobsAutoCollapse: false }) })
expect(bar.getAttribute('aria-expanded')).toBe('false')
unmount()
})
it('opens in the TREE by default on a narrow viewport when the mobile switch is on', async () => {
// jsdom's window is the plugin's mobile bracket here (767 < 768).
Object.defineProperty(window, 'innerWidth', { configurable: true, value: 420 })
@@ -502,6 +548,32 @@ function teamTask(over: Partial<SidebarTeamTaskView> = {}): SidebarTeamTaskView
}
describe('Tasks page graph interactions and team board', () => {
it('expands an aggregate and opens its agent after separate background pans', async () => {
const store = makeStore(snapshotWithChildren(2))
const { container, unmount } = renderRoot(
createElement(SubagentView, { sessionId: 'root', active: true, ctx: makeCtx(store) }),
)
const canvas = container.querySelector('[role="group"]') as HTMLElement
const pan = (): void => {
canvas.dispatchEvent(new MouseEvent('pointerdown', { bubbles: true, clientX: 5, clientY: 5 }))
window.dispatchEvent(new MouseEvent('pointermove', { bubbles: true, clientX: 80, clientY: 70 }))
window.dispatchEvent(new MouseEvent('pointerup', { bubbles: true }))
}
const tap = (element: HTMLElement): void => {
element.dispatchEvent(new MouseEvent('pointerdown', { bubbles: true, clientX: 10, clientY: 10 }))
window.dispatchEvent(new MouseEvent('pointerup', { bubbles: true }))
element.click()
}
await act(async () => { pan() })
await act(async () => { tap(container.querySelector('[data-graph-node="fold:root"]') as HTMLElement) })
const child = container.querySelector('[data-graph-node="child-0"]') as HTMLElement
expect(child).not.toBeNull()
await act(async () => { pan() })
await act(async () => { tap(child) })
expect(document.querySelector('[role="dialog"]')).not.toBeNull()
unmount()
})
it('activates a graph node after a background pointerdown (no click theft)', async () => {
const navigation: NavigationSpy = { opened: [] }
const store = makeStore(snapshotWithChildren(1))
@@ -1122,7 +1194,7 @@ describe('Tasks page: the shared task window', () => {
unmount()
})
it('never auto-folds a RE-PARENTED run member that is a real branch (issue #784)', async () => {
it('never auto-folds a RE-PARENTED run member with a running descendant (issue #784)', async () => {
// A run member is usually a real catalog node re-parented under the run —
// not the synthetic leaf the old rule assumed — so the page-level fold used
// to take its whole subtree with it.
@@ -1153,7 +1225,7 @@ describe('Tasks page: the shared task window', () => {
},
m1c: { values: { subagentCatalog: [] }, state: 'ready', error: null },
}
snapshot.byId['m1c'] = { id: 'm1c', displayTitle: 'm1c', origin: 'subagent', parentId: 'm1', running: false }
snapshot.byId['m1c'] = { id: 'm1c', displayTitle: 'm1c', origin: 'subagent', parentId: 'm1', running: true }
const store = makeStore(snapshot)
const { container, unmount } = renderRoot(
createElement(SubagentView, { sessionId: 'root', active: true, ctx: makeCtx(store) }),
@@ -1627,17 +1699,10 @@ describe('Tasks page: the tree disclosure', () => {
function snapshotWithGrandchild(): SidebarSessionList {
const list = snapshotWithChildren(2)
const projections = list.projectionsBySession as Record<string, SidebarProjectionSnapshot>
const rootEntries = projections.root!.values.subagentCatalog as SidebarSubagentCatalogEntry[]
const grandchild: SidebarSubagentCatalogEntry = {
id: 'grand-0', createdAt: 9, mode: 'one-shot', label: '孙代理 0',
}
// `subagentCatalog` is a frozen tuple in the host's shape, so the grandchild
// rides a FRESH array rather than a push into the fixture's.
projections.root = {
values: { subagentCatalog: [...rootEntries, grandchild] },
state: 'ready',
error: null,
}
// Each child belongs to one parent's catalog; grand-0 is only under child-0.
list.byId['grand-0'] = {
id: 'grand-0', displayTitle: 'grand-0', origin: 'subagent', parentId: 'child-0', running: false,
}