Repository navigation
Add a decision option with one confirm, wrapped and auto-selected - #541
Conversation
|
Review: Changes needed Checked in Chromium against a fake-GitHub server (Decisions tab at 1440×900 and phone at 390×844, plus two users at once). Both of Maggie's asks work. Long URLs and long words wrap in the field and in the added row. There's no
Minor:
Design contract: #540 overlap: a trial merge of |
The add field was a single-line input sized to its content, so a long option widened the row and the card scrolled sideways to follow the caret. It is now a wrapping textarea, and the sidecar card clips rather than hides overflow so focus can never scroll it. The leading plus tile becomes the confirm check once there is text. Enter or the check adds the option; after the server acknowledges it with its id, the view selects it for the adder, moves focus to the new row and announces it, so Save is ready at once. A collaborator's single choice in the shared draft is left alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The deck's own status line is found by role; a live region without the status role announces the added option without competing with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Maggie approved renewing these hashes. card.tsx only swaps the overflow-hidden literal for overflow-clip; question-view.tsx adds refs and static classes. The reviewed dynamic class compositions are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ds on leaving A just-added option replaces a single choice only while the shared draft still holds this person's last pick for that question, not whenever they touched the card. The confirm check's focus ring sits outside its filled tile so it stays visible. Leaving the question while an add is pending abandons its selection again, except when the add filled the list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ator-choice fix The commit only changes selection logic and refs; the reviewed Related and Callout class compositions moved but are unchanged. Approved by Maggie. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
88e1298 to
63dcea6
Compare
Fixes the two "Add an option" problems on decision cards (inline deck and Decisions tab share
QuestionView).What changed
1. Long options wrap instead of scrolling the card sideways. The field was a single-line
<input>withfield-sizing: content, so long text widened the row and the card (overflow: hidden, which still allows programmatic scroll) scrolled left to follow the caret, clipping the question and options. Now:<textarea rows=1>that grows downwards (field-sizing: content, with a small height fallback for browsers without it). Pasted line breaks become spaces, because option labels are one line in the document.SidecarCardusesoverflow: clip, so focus or caret reveal can never scroll a card horizontally.overflow-wrap: anywhereso a long URL can't push the row wide either.2. One confirm adds the option and chooses it. The leading
+tile becomes a brand-coloured check button as soon as there is text, with a cross-fade (opacity/scale/blur; opacity only under reduced motion). It stays a quiet+while empty or when the text duplicates an option. Enter does the same; Escape cancels. Shift+Enter does not add a newline, because labels are single-line.After the server acknowledges
question:option(the reply already returnedoption; the controller now passes its id through), the view:onLocalChange+onChange), so the save bar counts it and Save is enabled immediately;+ Add an optionrow;:focus-visible;Server contract is unchanged. Selection happens only after the acknowledgement (persistence before publication). There is no optimistic option, and the idempotency
keystill comes from the controller. Other writers' drafts: in a single-choice question, a collaborator's existing answer in the shared draft is not replaced. The option is still added for everyone, and the announcement says "Added ". Your own earlier answer is replaced only while the shared draft still matches it. For a multiple-choice question, the new option is added to the set and nothing is unchecked. Escape or removing the question card while the request is pending abandons the selection. Reaching the 10-option limit (which unmounts the field) still selects.Screenshots
Before (inline deck, 1440px): the long text scrolls the whole card left; after Enter the option is added unselected, the focused trigger looks like an empty field, and Save stays disabled.
After: the field wraps, the check confirms, the option is selected, the add row is quiet and Save is ready. Also shown: the Decisions tab with a mouse confirm (no ring), a collaborator's view, and phone at 390px with no horizontal page overflow.
Tests
packages/question):chooseAdded(single choice, own vs collaborator, multiple),optionText, option rows carry ids, and the controller returns the acknowledged option id.inline-decision-deck.e2e.ts): a long option wraps (field taller than 1.5 lines, no ancestorscrollLeft, heading still in view), and one confirm results in a checked option, a collapsed field and an enabled Save.sidecar-option-contracts(a collaborator's choice is kept, the adder's own choice moves, focus goes to the new option, and the refresh test now expects the adder's latest choice),sidecar.e2e(a multiple-choice add is checked and Save is enabled),sidecar-option-async(a delayed ack selects and focuses), andconversation-plan-ui(adding now overrides a chat suggestion in one step). I also updated the source-native terminal-origin fixture.bun run ci,bun run types,bun run build, and all 153 question tests pass. All 16 option contract/delayed-reply browser cases passed; two context-teardown timeouts passed on a warm single-worker rerun with the original timeouts unchanged.Design-contract review
The reviewed owner hashes are renewed.
RelatedandCalloutretain their class expressions and data flow;SidecarCardonly changesoverflow-hiddentooverflow-clip. The pending-add guard follows the question view’s lifetime and current question, so removing the composer at the 10-option limit still selects the final option.The deck pager is untouched.
🤖 Generated with Claude Code
Review follow-up
The check tile has a visible keyboard focus ring. Adding PostgreSQL preserves the collaborator’s newer SQLite choice.