Repository navigation
Description
epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf
Filing gate: ④ topic child. Source: topic #37871 (Jack 2026-11-27: 「用户体验相关的非常关键,要启动」 06:56Z; card 「按 v2 立卡,顶替输入框」 08:05Z; 「交给 objectstack #3」 08:06Z). Business reason: carried by the parent.
Parent: #37871 (decisions D1–D6, relations, topic acceptance). Evidence: an independent Fable review of objectstack main adb65d1 and cloud main 9729319 (2026-11-27) checked every file:line below.
Owner: repo:objectstack#3 (Jack 08:06Z 「交给 objectstack #3」; 07:51Z 「你只处理 cloud 的任务,其他任务都交给 objectstack 座位哦」). Reserved under topic #37871 (pm:epic), not pm:queue: other seats leave it.
Grading: area:ux · Task · p1 · size M.
Blocked-by: Q1 (#37872), Q2a (#37873) (numbers in the parent's audit comment); #37799 (split A adds chat/types.ts; main-file line numbers all change). Soft order with #37729 (split B) and #37861 (entry C5): whoever lands later rebases.
Dedupe: searched findPendingQuestion, composer gate: none.
维护者速读
- 是什么:把问题卡接进对话:识别信封、判断何时出卡、卡片顶替输入框(输入框不卸载,草稿不丢)、对话里显示收起的「AI 问:…」、待答问题不显示"重新生成"、跳过记号。发版后在 brightrule 上真机冒烟。
Background (verified)
- Tool parts reach the console in the stream (
tool-input-available/tool-output-available, cloudvercel-stream-encoder.ts:89-102) and on reload (objectql-conversation-service.ts:770-801); the approval card is detected the same way (mapMessages.ts:490,513-520). - Two shapes: streamed, a tool-ended turn is ONE assistant message (tool parts + text); reloaded it is TWO (one with tool parts, one text) (
app-shell/src/hooks/useChatConversation.ts:544-612). - Retry replays only the text, without tool frames (cloud
ai-service.ts:3674-3679). PromptInputinChatbotEnhancedis uncontrolled; code reads and writes the textarea (ChatbotEnhanced.tsx:1443-1452,1492-1499); Enter during a turn queues, sent when the turn ends (:1359-1361,1420-1440);readOnlyshare pages render no input (:396-404,2328);onSendMessageexists (:383);handleSuggestionClickis the card-driven-send precedent (:1456-1464). A send throughonSendMessagedoes not trigger the input's restore logic (:1470-1499).
What to do
findPendingQuestion(messages, status)(pure,plugin-chatbot). Show the card only when ALL hold:- the stream has ended;
- an assistant message after the last user message carries an envelope (both shapes);
- the envelope's
replyequals the last assistant text in that segment (excludes two questions in one batch, another tool ending the turn first, the tool-execution endpoint); - no user message after it (a HITL continuation
[HITL id]also counts as "moved on": the card collapses, but the summary does not treat it as the answer); - no queued message (if one is queued it is sent and the question collapses: "sending something else = skip");
- no pending write approval in the same segment (approval card first; the question shows collapsed);
- no local skip mark for this question;
- not a
readOnlyshare page.
Fixtures: streamed shape, reloaded shape, plus one each for queued, HITL, two questions in a batch.
- Two states only: pending and past (answered or skipped are not distinguished; skip is device-local).
- Composer gate: a generic container around
PromptInput; whoever holds it renders (the question card now, the approval card later, 专题:Agent 对话界面改进(参考 Twenty:拆分组件、暂停式工具与审批卡、反问选项卡、反馈与重试)(拆分进行中,其余暂不派发) #37690 seg 3 item 4). While open,PromptInputstays MOUNTED, visually hidden plusinert: draft, attachments and focus state survive and come back after skip or answer. - Answer:
onSendMessage(text)from Q2a (问题卡专题 Q2a:QuestionCard 纯组件(单题点选即发、两题停在发送、自己输入、跳过、键盘读屏、全部语种) #37873)'sonAnswer. On send failure the bubble rolls back, the conditions hold again and the card returns with its selection. - In-thread message: when the envelope matches, draw from the envelope (pending: question and preface only; past: question plus expandable options); do not parse the bullets out of
reply; copy still copies the full reply. Draw in the message layer, NOT inrenderToolDetail(avoids split B). - The pending-question message hides "regenerate".
- Skip marks: localStorage key
objectstack:ai-chat-question-skip:<conversation id>, value = list of skipped question tool-call ids; reads and writes in try/catch; add the prefix to the sign-out cleanup (useChatConversation.ts:283-296). - Add one item to the platform test checklist.
- After the release that carries this: smoke on brightrule (an ambiguous question shows the card; one click gets the number). brightrule is outside the fleet board; ask the maintainer who runs it there.
Acceptance
- Topic acceptance 1–6 and 9 on 专题:AI 问题卡(AI 需要澄清时输入框位置换成可点的问题卡;问题结束回合、回答是下一条消息;第二段扩到模糊请求) #37871; with entry C5 (入口专题 C5:记录焦点状态机重写,标签进输入框行首,去掉钉住与「改为问」,从会话 metadata 读回 #37861) landed: the answer still sends
context.focus, and the chip stays after the card closes.
Activity