From 055b7adca98b4fd2eede6f9f6f81bb0b26b14590 Mon Sep 17 00:00:00 2001 From: Jesse_Chen Date: Sun, 6 Sep 2026 13:08:43 +0800 Subject: [PATCH] fix(web): keep composer enabled while generating and treat stop as neutral (BUG-551, BUG-552) Enter now queues one follow-up instead of dropping it, and a rectification stop leaves the streamed reply with a grey notice instead of an error alert. Co-authored-by: Cursor --- CHANGELOG.md | 4 + docs/BUG_HISTORY.md | 33 +++++ ...S-composer-live-input-and-stop-20260906.md | 39 ++++++ .../composer-live-input-and-stop-20260906.md | 50 +++++++ frontend/DESIGN.md | 14 +- frontend/docs/VOICE.md | 2 + frontend/src/app/globals.css | 8 ++ frontend/src/app/page.tsx | 15 +-- frontend/src/components/chat-composer.tsx | 76 ++++++----- frontend/src/components/chat-message-row.tsx | 3 + .../components/rectification-agentic-chat.tsx | 122 +++++++++++++---- frontend/src/hooks/use-consultation-run.ts | 43 ++++++ frontend/src/hooks/use-queued-message.ts | 28 ++++ frontend/src/lib/queued-draft.ts | 17 +++ .../src/lib/rectification-surface-state.ts | 4 + frontend/tests/chat-composer-queue.test.ts | 125 ++++++++++++++++++ .../tests/rectification-agentic-entry.test.ts | 17 ++- .../rectification-surface-contract.test.ts | 8 +- 18 files changed, 534 insertions(+), 74 deletions(-) create mode 100644 docs/tasks/PROGRESS-composer-live-input-and-stop-20260906.md create mode 100644 docs/testing/composer-live-input-and-stop-20260906.md create mode 100644 frontend/src/hooks/use-queued-message.ts create mode 100644 frontend/src/lib/queued-draft.ts create mode 100644 frontend/tests/chat-composer-queue.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 97f40101..d1e45179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 印度占星 Skill 更新日志 +## 2026-09-06 — 生成中仍可打字,停止不再像报错 + +回答生成时输入框不再变灰,回车会排成一条待发送,当前回答正常结束后自动发出,停止或失败则放回输入框。生时校正里点停止会留下已生成的内容,并用灰字说明已停止、不扣点,不再出现红色告警。Skill 版本未变。 + ## 2026-09-06 — 短暂连不上数据库时不再说「服务尚未配置」 部署刚切换、数据库暂时连不上时,页面会提示服务暂时不可用、请稍后重试,而不会再说成环境没配好。真的缺少数据库环境变量时,原来的「服务尚未配置」还在。Skill 版本未变。 diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index fb4aeacc..42227cb1 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -8517,3 +8517,36 @@ - 复发自:BUG-546(计划层继续采集,决策层已经可采用) - 修复版本:`ca4e2408` +## BUG-551 | 生成中禁用输入框,焦点丢失,回车消息被丢弃 + +- 状态:resolved +- 首次发现:2026-09-06 +- 最近更新:2026-09-06 +- 影响面:`ChatComposer`、主咨询 `page.tsx`、`use-consultation-run.ts`、生时校正 `rectification-agentic-chat.tsx` +- 用户现象:发出消息后输入框变灰,不能继续打字;回答结束后必须再点一次输入框。生成中按回车,消息被丢掉。 +- 触发条件:任一对话面正在生成回答时打字或按回车。 +- 根因:两个对话面把 `isLoading` / `busy` 写进 `