From abed10e13d29ba0cfc59dd0dfbd9724998e46673 Mon Sep 17 00:00:00 2001 From: amosblomqvist Date: Wed, 9 Sep 2026 02:16:03 +0300 Subject: [PATCH] =?UTF-8?q?Other=20renders=20as=20an=20option=20row=20in?= =?UTF-8?q?=20history;=20=E2=8C=98/Ctrl+Enter=20submits=20thinking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The learner's own typed Other answer now renders INSIDE the options container in the answered card, styled exactly like its selected siblings (border-primary bg-accent) — it is an option, not a loose quote floating outside the list. Quotes keep the learner's words. - The thinking field submits with ⌘↵ on macOS, Ctrl↵ elsewhere (metaKey || ctrlKey — the Gmail convention, same handler on every platform). Plain Enter stays a newline: the field is for dumping. A quiet "⌘/Ctrl + ↵ submits" hint sits next to Submit for discoverability (text mode keeps Enter-to-submit, no hint). --- components/answered-card.tsx | 16 +++++++++++++--- components/question-dock.tsx | 17 +++++++++++++++-- tests/render-cards.test.tsx | 27 +++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/components/answered-card.tsx b/components/answered-card.tsx index cae329d..d444290 100644 --- a/components/answered-card.tsx +++ b/components/answered-card.tsx @@ -41,9 +41,9 @@ export function AnsweredCard({ answer }: { answer: QuestionAnswerData }) { {answer.questionText} - {answer.options && answer.options.length > 0 && ( + {((answer.options?.length ?? 0) > 0 || answer.other) && (
- {answer.options.map((opt) => { + {answer.options?.map((opt) => { const sel = selectedIdx.has(opt.index); const key = isQuiz && correctIdx.has(opt.index); return ( @@ -70,10 +70,20 @@ export function AnsweredCard({ answer }: { answer: QuestionAnswerData }) {
); })} + {/* The learner's own typed option is an OPTION — same container, + same selected styling as its siblings, not a loose quote + floating outside the list. Quotes keep the learner's words. */} + {answer.other && ( +
+ “{answer.other}” +
+ )} )} - {answer.other &&
“{answer.other}”
} {answer.text &&
“{answer.text}”
} {answer.dontKnow && isQuiz &&
Answered “I don't know”.
} diff --git a/components/question-dock.tsx b/components/question-dock.tsx index c084fd5..f758d32 100644 --- a/components/question-dock.tsx +++ b/components/question-dock.tsx @@ -412,6 +412,14 @@ function QuestionDockForm({