Keep checked options and the Other answer together on multi-select questions - #4372
Keep checked options and the Other answer together on multi-select questions#4372ThePharmer wants to merge 1 commit into
Conversation
|
| Filename | Overview |
|---|---|
| packages/app/src/components/question-form-card.tsx | Preserves both input sources for multi-select questions and synchronizes single-select state with the visible editing surface. |
| packages/app/src/components/question-form-card-core.ts | Builds multi-select answers from selected labels plus trimmed custom text while retaining single-select replacement semantics. |
| packages/app/src/components/question-form-card.browser.test.tsx | Covers both interaction orders and single-select replacement through the production component and input in real Chromium. |
| packages/app/src/components/question-form-card-core.test.ts | Adds focused answer-builder coverage for combined multi-select and replacing single-select answers. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User edits a question] --> B{Multi-select?}
B -->|Yes| C[Preserve checked options and Other text]
C --> D[Submit labels followed by trimmed Other text]
B -->|No| E{Latest input}
E -->|Other text| F[Clear selected option]
E -->|Preset option| G[Clear Other state and visible input]
F --> H[Submit Other text]
G --> I[Submit selected label]
Reviews (2): Last reviewed commit: "fix(app): keep checked options and the O..." | Re-trigger Greptile
…-select questions On a multi-select question card, typing into Other cleared the checked options, and checking an option after typing deleted the Other text from state while the field kept showing it, so submit silently dropped it. Multi-select now keeps both and submits the checked labels followed by the trimmed Other text, comma-joined, matching Claude Code's own AskUserQuestion UI. Single-select keeps the replace behavior and clears the field through replaceText so the screen matches the state. Closes getpaseo#4370
5e30a34 to
1f33b1a
Compare
|
Two fixes pushed in response to the review:
|
Linked issue
Closes #4370
Type of change
Reasoning
On a multi-select question card, the Other field and the checked options cannot coexist. Check first and then type, and the boxes clear. Type first and then check, and the card silently drops the typed text on submit: since #3517 the field owns its text and never replays state, so the screen keeps showing a sentence the state has already forgotten. The agent receives the labels alone. Claude Code's own AskUserQuestion UI keeps both and submits
"Apple, durian", and the Agent SDK docs describe exactly that shape, so a Paseo user answering from their phone gets a worse answer than they would at the terminal.This PR makes multi-select keep both inputs and submit the checked labels followed by the trimmed Other text, joined with
", ". Single-select keeps the replace behavior, which also matches Claude Code, but when it clears the Other text it now callsreplaceText("")on the field so the screen and the state agree.Goals
answersstaysRecord<string, string>.Non-goals
setTextAnswerandtoggleOptionthere.QA
Reproduced before the fix (Paseo 0.7.2, Claude Code 2.1.258, web UI and Android app): on a multi-select AskUserQuestion, typed a sentence into Other, checked four options, submitted. The agent received the four labels joined with commas and nothing else. Checking first and typing afterwards visibly cleared the boxes. Recording is attached to #4370.
Tests.
packages/app/src/components/question-form-card-core.test.tsgains two cases for the answer builder (multi-select combines, single-select replaces). Newpackages/app/src/components/question-form-card.browser.test.tsxmounts the real card in headless Chromium through the Vitest browser project, with the real webEditingTextInputand no mocks, and drives both orders through clicks and input events, asserting the answers the card submits and what the field shows. Onmainwithout the source change, four of the ten tests fail:With the change, all ten pass.
oxlintandoxfmtare clean on the four touched files. Typecheck, lint, and format results for the whole repo are from CI.Platforms tested for the bug: web UI in a browser and the Android app. The fix is in the shared card and has no platform branches. Not re-tested on device after the fix; the browser tests cover the same interaction sequence against the real web input.
Checklist
npm run typecheckpasses (CI)npm run lintpasses (CI)npm run formatpasses (CI)