Repository navigation
feat(plugin-chatbot): QuestionCard, the card an AI clarifying question is answered on - #37932
Conversation
…WIP) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwzqCncZ2kfbohG53j
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwzqCncZ2kfbohG53j
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwzqCncZ2kfbohG53j
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwzqCncZ2kfbohG53j
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwzqCncZ2kfbohG53j
…kable div Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwzqCncZ2kfbohG53j
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1 ACCEPT at Face. Head. Reviewed in full at Card #37873, item by item (read in
Clause-② (widening). The published surface grows by Deviations judged.
Sentences read. Nits (do not block).
Body. The "Local runs at 417e56e" block names an older head and the old snippet; the thread patches it on this head (prose only, no record moves). |
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T12:50Z · zone
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Requested by Tesla · project thread
Fixes #37873
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
QuestionCardin@object-ui/plugin-chatbot(exported withQuestionCardProps,QuestionCardQuestion,QuestionCardOption): a pure component, questions in,onAnswer(text)/onSkip()out. Nothing renders it yet; wiring it in the composer's place is 问题卡专题 Q2b:问题卡接进对话(findPendingQuestion、顶替输入框且不卸载、对话内摘要、隐藏重新生成、跳过记号) #37874 (Q2b).header: answerline per question for two (question text when no header). The separator is thechatbot.questionCard.answerLinestring, so zh-Hans/zh-Hant/ja write a full-width colon and fr its space-before-colon.descriptionas a grey second line andrecommendedas a "Recommended" tag.announceputs "A question is waiting for your answer" into a polite live region the host triggers.max-h-[60vh], the body scrolls inside, the button row stays fixed;classNameoverrides.key.chatbot.questionCard.*strings in all 11 locale packs (ar,de,en,es,fr,ja,ko,pt-BR,ru,zh-Hans,zh-Hantgenerated fromzh-Hans); the card setsdirfrom the session language, so Arabic is right-to-left.content/docs/frontend/plugins/plugin-chatbot.mdxgain a "Question card" section; changeset@object-ui/plugin-chatbot+@object-ui/i18npatch.Read first:
ui/packages/plugin-chatbot/src/QuestionCard.tsx—pick/advance/compose(the stop-on-send rule and the answer text) andonKeyDown.ui/packages/plugin-chatbot/src/__tests__/QuestionCard.test.tsx— the behaviour pins.ui/packages/i18n/src/__tests__/untranslated-identity-4376.test.ts— one allowlist row for the format string.Tests
QuestionCard.test.tsx(21, provider-less): single-click send, description and tag, typed answer and blank refusal, skip, re-render keeps the choice for a retry, two-question flow with summary and Back, Next disabled until answered, typed text on both questions, no focus move on mount, digits / Ctrl+Enter / Cmd+Enter, IME Enter ignored, ↑/↓ wrap, focus kept on page change, roving tab stop, radiogroup name, live region, defaults map equals theenpack.QuestionCard.i18n.test.tsx(3, with provider): zh-Hans strings and the full-width-colon answer,arisdir="rtl"and translated,enisltr.Acceptance notes
questions(the envelope'squestionsarray shape:header?,question,options[{label, description?, recommended?}]) rather than a Q1 type, because 问题卡专题 Q1:spec 问题信封(AskQuestionEnvelope、兼容旧 asked_which、parseAskQuestionEnvelope) #37872 (Q1) has not landed. The prop types are structurally the Q1 envelope's question shape, so Q2b can passenvelope.questionsas is. carrier: 问题卡专题 Q2b:问题卡接进对话(findPendingQuestion、顶替输入框且不卸载、对话内摘要、隐藏重新生成、跳过记号) #37874.answerLine({{header}}: {{answer}}), so the separator follows each language instead of a hard-coded colon. Its identity withenin ko/ru/ar is allowlisted as a format string, the same waydetail.fieldChangeLabelis.aiAsks("AI asks:") is drawn as the card's eyebrow line so the key has a reader here; Q2b may reuse it for the collapsed summary.ui/packages/plugin-chatbot/**and locale packs:ui/packages/i18n/src/__tests__/untranslated-identity-4376.test.ts(one allowlist row),content/docs/frontend/plugins/plugin-chatbot.mdx(docs, ui AGENTS ✨ Set up Copilot instructions #2),.changeset/37873-question-card.md.Verification
Two-minute check:
pnpm --dir ui exec vitest run packages/plugin-chatbot/src/__tests__/QuestionCard.test.tsx packages/plugin-chatbot/src/__tests__/QuestionCard.i18n.test.tsx— expect 24 passed.Local runs at 417e56e (two CI fixes since; CI green at 9179aac: 52 success, 10 skipped, 0 failed)
After 417e56e:
a052f497makes the README/docs snippet self-contained (it wraps the card in a smallPendingQuestioncomponent, so check:doc-snippets reads no free names);9179aacdmakes the free-text row alabelwrapping its input instead of a clickablediv(clickableNonControlCensus-13461). The census and the 24 QuestionCard tests pass locally at 9179aac.pnpm exec vitest run packages/plugin-chatbot/ packages/app-shell/src/__tests__/product-neutral-renderer.ratchet.test.ts packages/app-shell/src/__tests__/defaults-maps-mirror-en-pack.test.tsx(fromui/, under the verify lock): Test Files 73 passed, Tests 734 passed.packages/i18n/src/__tests__/: all green after regenerating zh-Hant and the allowlist row (the two reds before werezh-hant-generatedanduntranslated-identity-4376).pnpm --filter @object-ui/plugin-chatbot run type-check,pnpm --filter @object-ui/i18n run type-check: exit 0.eslint on the changed plugin-chatbot files: 0 errors (the warnings are the existing
react-refreshones inindex.tsx).Derived gates, exit 0 each: check:nul-bytes, check:gitlink-declared, check:cross-package-test-inputs, check:test-source-alias, check:undeclared-dep-imports, check:published-files, check:role-word, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration, check:closed-ceremony-text, check-sdui-manifest, check:type-check-coverage, check:type-check-debt, ui check:i18n-keys, ui check:i18n-drift. The rest of the derived list and the full farm are CI's.
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code