From 9616790b6cc6623aa4663f550e920cf6989664c7 Mon Sep 17 00:00:00 2001 From: Yichen Jiang Date: Thu, 20 Aug 2026 15:27:58 +0800 Subject: [PATCH 01/10] feat(web): answer ask_user_question over multiple lines A question that carried options collected its free-text answer in a single-line input: a long sentence scrolled sideways inside one line and Shift+Enter was inert, so an answer with structure could not be typed. The optionless question already used a textarea, but a fixed 64-140px box that never followed the draft. Both shapes now answer into one AnswerField: a `textarea rows=1` sharing a grid cell with a hidden mirror that renders the draft plus a trailing newline and so owns the height. Soft wraps are invisible to a '\n' count, so the mirror is what grows the box; growth stops at eight lines and the textarea scrolls from there, keeping the choices the answer belongs to in view. Enter still continues and submits, Shift+Enter breaks the line, and the IME guard is unchanged. --- ...-multiline-question-answer-field.i18n.yaml | 6 ++ ...6-08-20-multiline-question-answer-field.md | 43 ++++++++++ ...8-20-multiline-question-answer-field.zh.md | 43 ++++++++++ apps/web/tests/question-composer.e2e.ts | 32 +++++++- .../client/ui-user-questions/README.i18n.yaml | 4 +- packages/client/ui-user-questions/README.md | 2 +- .../client/ui-user-questions/README.zh.md | 2 +- .../src/client/QuestionComposer.module.css | 75 +++++++++++------- .../src/client/QuestionComposer.tsx | 78 +++++++++++++++---- .../user-questions-composer.client.spec.tsx | 37 +++++++++ 10 files changed, 278 insertions(+), 44 deletions(-) create mode 100644 .agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.i18n.yaml create mode 100644 .agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.md create mode 100644 .agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.zh.md diff --git a/.agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.i18n.yaml b/.agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.i18n.yaml new file mode 100644 index 0000000000..2040f0c481 --- /dev/null +++ b/.agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.i18n.yaml @@ -0,0 +1,6 @@ +# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each +# side as of the last confirmed-consistent state. Both languages carry equal authority; +# after editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write .agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.md +2026-08-20-multiline-question-answer-field.md: dbe146f1cd56b0f757784283269ba5061c425366 +2026-08-20-multiline-question-answer-field.zh.md: 7adb5bb37bf4393a5be21f1dc56b2be46fbfe9cb diff --git a/.agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.md b/.agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.md new file mode 100644 index 0000000000..dbe146f1cd --- /dev/null +++ b/.agents/notes/implemented/feature/2026-08-20-multiline-question-answer-field.md @@ -0,0 +1,43 @@ +# Agent Note: Multi-line answers in the question composer + +Status: implemented + +English | [中文](2026-08-20-multiline-question-answer-field.zh.md) + +## Problem + +`ask_user_question` offers a free-text answer beside the model's own options. On a question that carried options, that answer was a single-line ``: a long sentence scrolled sideways inside one 24px line, Shift+Enter did nothing, and an answer with structure — two requirements, a short list, a paragraph — could not be typed at all. The optionless question already used a textarea, but a fixed 64–140px box that neither followed the draft nor opened wider. + +The chat composer next to it grows with the draft and takes Shift+Enter as a newline. A user who has just typed a multi-line prompt there meets a field that silently flattens the same answer. + +## Decision + +Both question shapes answer into one `AnswerField`: a `