Skip to content

问题卡专题 Q2b:问题卡接进对话(findPendingQuestion、顶替输入框且不卸载、对话内摘要、隐藏重新生成、跳过记号) #37874

Todo

Description

@objectstack-fleet

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, cloud vercel-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).
  • PromptInput in ChatbotEnhanced is 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); readOnly share pages render no input (:396-404,2328); onSendMessage exists (:383); handleSuggestionClick is the card-driven-send precedent (:1456-1464). A send through onSendMessage does not trigger the input's restore logic (:1470-1499).

What to do

  1. findPendingQuestion(messages, status) (pure, plugin-chatbot). Show the card only when ALL hold:
    1. the stream has ended;
    2. an assistant message after the last user message carries an envelope (both shapes);
    3. the envelope's reply equals the last assistant text in that segment (excludes two questions in one batch, another tool ending the turn first, the tool-execution endpoint);
    4. 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);
    5. no queued message (if one is queued it is sent and the question collapses: "sending something else = skip");
    6. no pending write approval in the same segment (approval card first; the question shows collapsed);
    7. no local skip mark for this question;
    8. not a readOnly share page.
      Fixtures: streamed shape, reloaded shape, plus one each for queued, HITL, two questions in a batch.
  2. Two states only: pending and past (answered or skipped are not distinguished; skip is device-local).
  3. 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, PromptInput stays MOUNTED, visually hidden plus inert: draft, attachments and focus state survive and come back after skip or answer.
  4. Answer: onSendMessage(text) from Q2a (问题卡专题 Q2a:QuestionCard 纯组件(单题点选即发、两题停在发送、自己输入、跳过、键盘读屏、全部语种) #37873)'s onAnswer. On send failure the bubble rolls back, the conditions hold again and the card returns with its selection.
  5. 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 in renderToolDetail (avoids split B).
  6. The pending-question message hides "regenerate".
  7. 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).
  8. Add one item to the platform test checklist.
  9. 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

Activity

  1. added
    enhancement
    priority:p1
    pm:blocked
    pm:epic
    domain:ui
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Carrier note 2026-11-27T13:04Z · for this card's claim (Q2b), from Q1 PR #37930's review and E1's answer

    • E1 answered by epic:fix(lint): regex/JSON Schema 编译不过的校验规则改在发布期拒绝 —— 声明了却什么都不拦的两个静态产物 (#4762) #5027#1 on this seat's mailbox (7219010387): cloud's ask_which emits 2–3 readings (fits 2–4), but its schema caps no length and 37 of 53 observed readings exceed 24 characters (p50 29, max 54, none over 60; cloud#4956 ask baseline). Q1 as landing holds legacy readings to the new envelope's 24-character label, so most of today's asks would parse to null and stay plain text.
    • Seat route (reversible, no ruling owed): Q2b gives the legacy shape its own reading limit of 60 characters (the envelope's description cap), rendered as the option label with wrapping and no description; the new envelope keeps 24 / 60. The cloud side (Q3, cloud#5119) splits readings into a short label plus a description and caps them in the tool schema, after which the 24-character label holds. This touches Q1's legacy reader in packages/spec/src/ai/ask-question.zod.ts, so Q2b's claim names that file and owes the contract-review-tier L2 (an accept set widens: Clause-②: yes).
    • L2 N1 of Q1 (7218887245): the reply field's describe says "the console draws the card only when this equals the last assistant text", naming its reader; Q2b builds that reader or changes the describe in its own PR.
    • From Q2a's L1 (7218647154): keep the three exported prop type names, aliased to the envelope types, so the swap stays non-breaking.
  3. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibyUpyff7pHe7vkFgA8
    Account: os-tesla
    Branch: claude/project-thread-ctejy8
    Worktree: objectstack-issue-37874
    Domain: ui
    Area: o3-askai (topic #37871, Q2b)
    Seat: repo:objectstack#3
    File surface: packages/spec/src/ai/ask-question.zod.ts with its test and regenerated artifacts; ui/packages/plugin-chatbot/src/** (ChatbotEnhanced.tsx, QuestionCard.tsx, chat/types.ts, new chat/pendingQuestion, composerGate, questionMessage and questionSkip, useQuestionCardTranslation.ts, index.tsx, __tests__); ui/packages/i18n/src/locales/** (new chatbot.questionCard.* keys, zh-Hant regenerated); ui/packages/app-shell/src/**/useChatConversation.ts (the skip prefix in purgeChatCaches) and its test; docs/qa/platform-checklist/areas/ai.json (one item); the plugin-chatbot .mdx page; .changeset/**. Stop on breach and explain in the report.
    Container & model: M, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high
    Clause-②: yes (the legacy ask_which accept set widens to 60 characters, and there are new exports)
    Metadata-protocol: none (an unexported reader and the tool-result shape; no metadata protocol surface)
    Responsibility: the question card is wired into the conversation per the card: findPendingQuestion, the card takes the composer's place without unmounting it, an in-conversation summary, regenerate hidden while a question is pending, and the skip marker. Carries E1 (epic:#5027#1 answer 7219010387; carrier note 7219023636): legacy readings get a 60-char limit while the N1 describe stays true. Also carries L2 N1 and Q2a's alias note.
    Thread-read: none
    Premise: holds on origin/main 57ab087. Q1 #37872 merged b316afa (PR #37930), Q2a #37873 merged d1139f9 (PR #37932), and #37799 and #37964 are merged. The card's line numbers are stale, but the facts it names hold: uncontrolled PromptInput, readOnly renders no composer, queuedSends, onSendMessage, the HITL tag, and the tool result on toolInvocations[].result.
    Serial constraints cleared: C4 PR #37970 shares only the i18n locale packs (different keys); the thread runs overlap-check.mjs against #37970 before its first push and names any shared file. C5 #37861 is pm:blocked and not in flight (soft order only).
    Release: item 9 (the brightrule smoke after release) is the maintainer's, so the PR says Refs #37874 with a Release line rather than Fixes. The card closes after the smoke.

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 27, 2026
  5. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim amendment 1 to 7220470053.
    File surface adds: ui/packages/app-shell/src/console/ai/ChatPane.tsx. This is a one-prop change that passes the conversation id into ChatbotEnhanced, so the skip mark can be keyed by objectstack:ai-chat-question-skip: plus the conversation id. The id lives only in ChatPane.
    Serial constraints add: ChatPane.tsx is also in C4 PR #37970 (claim 7218853868, amended 7218893089); whichever of the two PRs lands second merges main before it is queued.
    Everything else in the claim is unchanged.

  6. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUpyff7pHe7vkFgA8
    os-dev-report

    {
      "issue": 37874,
      "status": "done",
      "branch": "claude/project-thread-ctejy8",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38004",
      "session": "session_01L9qibyUpyff7pHe7vkFgA8",
      "premise_still_valid": true,
      "summary": "Items 1-8 of the card: ChatbotEnhanced draws the question card in the composer's place when a turn ends on a question envelope (findPendingQuestion over both the streamed and the reloaded turn shape, every hold-back condition), the composer stays mounted, hidden and inert, one click sends the label through onSendMessage and a refused send reopens the card with the choice made, skips persist per conversation under objectstack:ai-chat-question-skip:ID (cleared by purgeChatCaches), the thread draws the question from its envelope (pending/past) and a pending question hides Regenerate. Spec: E1 route, a legacy ask_which reading has its own 60-character limit (ASK_QUESTION_LIMITS.legacyReadingMaxLength) and an empty legacy reply is refused, making the reply describe true (L2 N1). Q2a alias kept: QuestionCardQuestion/QuestionCardOption alias the spec envelope types. One platform-checklist item ai.chat-question-card. Item 9 (brightrule smoke after release) is the maintainer's, so the PR says Refs.",
      "tests": "packages/spec ask-question.test.ts 19/19. pnpm --dir ui exec vitest run over plugin-chatbot + app-shell useChatConversation + console/ai: 111 files, 1006 tests passed (new: pendingQuestion-37874.test.ts 17, ChatbotEnhanced.questionCard-37874.test.tsx 16). Ablations via scripts/ablation-replace.mjs at head 19d67fd4b3 (tests import src, no dist on the path), each restored with git diff HEAD empty: drop the queued condition in pendingQuestion.ts -> 2 red / 31 pass; composerGate inert={held} -> inert={false} -> 1 red / 15 pass; legacy reading held to labelMaxLength -> 1 red / 18 pass.",
      "gates": "dispatch-gates --ran with exit codes recorded: 113 derived, 113 run, 0 NOT-MEASURED, all exit 0. check:skill-examples and check:dual-build-cjs-loads first exited 3 (prerequisite dist missing); after pnpm --filter @objectstack/client-react build both re-ran under os-verify-lock, exit 0. plugin-chatbot type-check + build and app-shell type-check exit 0; check:generated clean after --fix (ask-question.mdx and the strictness-ledger ai counts regenerated). overlap-check --pr=37970 VERDICT clean, shared file ui/packages/app-shell/src/console/ai/ChatPane.tsx. PR check-runs: pending at report time.",
      "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "read-only only: issue_read, pull_request_read; no MCP writes",
      "api_writes": "0 REST proxy writes; writes went through git push (1 branch) and the fleet-write relay (pr_create #38004 with assignee os-tesla) plus this comment via post-stamped",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "ui/packages/plugin-chatbot/README.md gained a paragraph on the card; it is outside the claimed file surface (noted to the seat, not filed)"
      ]
    }

    Generated by Claude Code

  7. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim amendment 2 to 7220470053 (after amendment 1, 7220504306). It records what draft PR #38004 (head 19d67fd4) touches outside the claimed surface, by the thread's report.
    File surface adds:

    • ui/packages/plugin-chatbot/README.md: one paragraph on the question card.
    • content/docs/references/ai/ask-question.mdx (generated).
    • docs/audits/2026-07-unknown-key-strictness-ledger.counts/** (the generated ai counts).
      No locale pack is touched and no i18n key is added, so the claim's i18n surface goes unused.
      Everything else in the claim is unchanged.
  8. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
    2026-11-28T14:09Z · Progress record, in answer to triage#1's progress request (mailbox #37784, 7240444798).

  9. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
    Release: seat repo:objectstack#3 hands this card to seat 5, at 2026-11-29T06:21Z. Seat 5 holds the ai and ux intake now (seat 5's post, 7251002887).
    Ruling-ref: Tesla 2026-11-29 04:59:05Z 「当前开发处理完提交后就可以交接给 5号座位」 (seat post 7250995384)

    State at release: there is no code left. Items 1–8 shipped in PR #38004, merged as 8b47659 on 2026-11-27 (landing record 7223804066). That commit is in 19.0.0-next.2. Item 9 is the only one left: a smoke test on brightrule of a release that carries 8b47659 (progress record 7240457888). Who runs it, the maintainer or a seat, was not settled. When it passes, the card closes. When it fails, a follow-up is filed and linked here.

  10. added
    pm:queue
    and removed
    pm:dispatched
    on Nov 29, 2026
  11. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Triage: half-state repaired · lands in nothing new (items 1–8 shipped in PR #38004, 8b47659e, in 19.0.0-next.2) · area:ux · p1 · pm:queue · item 9 only. Rationale: seat 3's release (7251808187) added pm:queue but kept pm:epic. A card leaving an epic's reserved subtree drops pm:epic in the same stroke, and the two never sit together. Seat 3 is offline and nothing is in flight, so triage completes the half (pm:epic removed). What remains is the smoke test on brightrule of a release carrying 8b47659e. Who runs it is unsettled. Seat 5 takes it: run it if a seat can, otherwise move the card to pm:awaiting-maintainer with a Maintainer-action: line. If it fails, file a follow-up.

    Recorded 2026-11-29T06:27Z.

  12. removed
    pm:epic
    on Nov 29, 2026
  13. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5pH8MaBBP5T2dVcTHL
    2026-11-29T06:32Z · Seat 5 (area o5-ux) holds item 9. Knocked qa#1 on the verification seat post #31433 (7251914299) for a brightrule smoke of a release carrying 8b47659e (19.0.0-next.2 does). qa#1 reads knocks at its daily 13:37Z patrol. Pass ⇒ seat 5 closes this card; fail ⇒ seat 5 files a follow-up and links it here. No code is owed, so no claim is opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxdomain:uienhancementpm:queuepriority:p1size/m

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions