Files
Jyotisha/docs/tasks/PROGRESS-composer-live-input-and-stop-20260906.md
T

54 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PROGRESS · 生成中输入框可打字、排队发送、停止中性态(2026-09-06)
工作树:`.worktrees/composer-live-input-and-stop-20260906`
分支:`codex/composer-live-input-and-stop-20260906`
基线:任务书写 `origin/staging` @ `b8ea3112`;开工时 `origin/staging` 已到 `d2a209d3`(后续任务书文档),以当时远端为准。修复提交:`055b7adc`
`page.tsx` 收尾 2040 行(上限 2041)。未改服务端、未改 `.gitea/workflows/**`、未 bump Skill。
| 任务 | 状态 | BUG |
| --- | --- | --- |
| 5.1 输入框不再禁用 + 排队发送 | 完成 | BUG-551 |
| 5.2 停止 = 中性状态 | 完成 | BUG-552 |
| 5.3 BUG_HISTORY / CHANGELOG / DESIGN / VOICE | 完成 | — |
## 实现要点
- 共用 `queued-draft.ts` + `useQueuedMessage`。主咨询在 `useConsultationRun` 里结算排队;校正在 `busy` 下降后按 `lastRunOutcome` 发送或放回。
- `ChatComposer` 增加可选 `queued` 卡片;textarea 只接受结构性 `inputDisabled`
- 校正 `AbortError`:气泡 `stopped`,灰字 `RECTIFICATION_STOPPED_NOTICE`,不再 `setError`。选择题 / 采用 fetch 挂 `runAbort`
- 发送键在有排队时禁用。停止后不抢焦点;撤回才聚焦。
## 既有断言改动
| 文件 | 原值 | 新值 | 原因 |
| --- | --- | --- | --- |
| `rectification-surface-contract` | `if (raw.trim()) setError(RECTIFICATION_STOPPED_NOTICE)` | 气泡 `stopped` + `stoppedNotice`,无 setError | 停止不能穿报错衣服(BUG-552) |
| `rectification-agentic-entry` | `caught.name === "AbortError"` | `isAbortError(caught)` | 选择题与采用共用中止判定 |
| `chat-notice-and-scroll-contract` | 未改断言正文 | `JumpToLatestButton` 仍保持原多行 JSX | 曾误压成一行导致 `sourceBetween` 找不到 |
## 测试
| 命令 | 结果 |
| --- | --- |
| `npx tsx --test tests/chat-composer-queue.test.ts tests/composer-*.test.ts tests/chat-notice-and-scroll-contract.test.ts tests/rectification-surface-contract.test.ts tests/rectification-agentic-entry.test.ts tests/agent-voice-copy-contract.test.ts` | 81 项 pass 81 fail 0 |
| `./node_modules/.bin/tsc --noEmit` | 0 错 |
| 改动文件 eslint `--quiet` | 0 error |
| `tests/class-name-definition-contract.test.ts` | 3/3 |
| `page.tsx` | 2040 行 |
| `npm run build -- --webpack` | 编译通过;随后在既有 `dossierResponse` 路由导出类型上失败,与本次无关 |
## 验收(Claude2026-09-06,对照 `TASK-composer-live-input-and-stop-20260906.md`
共用门禁(`origin/staging` @ `e2f4b55c`,含五单全部提交):`tsc --noEmit` 0 错;`npm run lint` 0 error / 79 warning(全部既有);`npx tsx --test tests/*.test.ts` 2770 项 / pass 2729 / fail 29 / skipped 12——29 条失败全为环境缺口(25 条 Docker / rsync / pyyaml 缺失的库测与部署套件;2 条 `--experimental-test-module-mocks` 子进程在本机 Node 20 下解析不到 `@/` 别名,CI 为 Node 222 条 `beam-avatar` / `chat-composer-queue` 渲染用例因验收工作树里一个多余的 `node_modules/node_modules` 软链造成双份 React,删链后单独重跑通过);默认 `npm run build`Turbopack)退出 0、`/``○ Static`、产物无 `/membership` 页;首屏 JS gzip-9(预渲染 `index.html` 引用脚本去重求和,与 09-02 口径一致)`d2a209d3` 519,437 B → `e2f4b55c` 522,617 B**+3,180 B / +0.61%**,五单合计在 ±2% 内。执行方进度里「`next build --webpack` 停在 `dossierResponse` 导出类型」一事:`dc6598d7` 已去掉该 `export`,本次默认构建不再出现。
| 项 | 结论 | 依据 |
| --- | --- | --- |
| 5.1 输入框不再随生成禁用;生成中回车进排队卡,结束后自动发出 / 失败放回 | 通过 | `lib/queued-draft.ts::queuedDraftSettleAction`completed / succeeded → 发送,其余 → 放回);`page.tsx` `inputDisabled` 只剩结构性条件,`submitBlocked``Boolean(queuedDraft)``useConsultationRun` 开跑时 `setReplyOutcome(null)`,结算 effect 不会用上一轮结果误发 |
| 5.2 校正面停止改中性态、选择题 / 采用等待中停止有效 | 通过 | `stopped: true` 气泡、`isAbortError`、choice / adopt fetch 挂 `runAbort``AbortController``rectification-agentic-entry` 新增 abort 用例 |
| 5.3 `page.tsx` 不增行 | 通过 | 2041 → 2040(本单)→ 1976BUG-554 后) |
| 5.4 测试 / DESIGN / VOICE / BUG-551、552 | 通过 | `chat-composer-queue.test.ts` 4 条本机通过(删双份 React 软链后) |
| 备注(不阻塞) | — | `useConsultationRun` 现在内部含 `useQueuedMessage` + `useEffect`,偏离 AGENTS §6「参数式 hook 内部 0 个 React hook」;任务书 §5 允许「或按仓库既定模式」,本次不追;下次改该 hook 时留意 |
**结论:通过**。修复 SHA `055b7adc`。真实环境走查见 `docs/testing/composer-live-input-and-stop-20260906.md`