Repository navigation
feat(mobile): draw choice cards and keep their answer in the draft - #1613
Merged
Merged
Conversation
A `futureos-choice` fence now becomes the phone's real card (design `docs/design/choice-cards.zh-CN.md` §5.7, §11 step 6) instead of the readable list step 1 left behind, and the answer a row produces is draft content the composer already counts rather than a chip drawn beside it. - `ChoiceCard` (new): full-width card, one 44pt row per option with its own line on what picking it changes, `role=radio`/`aria-checked` (`checkbox` for multi), a single selected cue (accent fill + ring-and-dot, no outline — §5.7.1) and the "answer is above the input" footnote once something is picked. - Only the thread's **last** card answers: `TimelineCard` hands the answer surface to the last settled reply's last prose block, `MarkdownText` marks the document's last card, and every other card stays readable but inert (§2). - `ComposerDock`: a chip row above the field (question, muted · answer, pencil, ×) and `ChoiceSheet`, the bottom sheet the pencil opens — 44pt rows, a pick written straight back, the draft's words untouched. - `canSend` and `hasDraft` count the answer, so one option and nothing else is sendable (§5.4, requirement d); `useComposerSubmission` refuses an empty draft with an answer in the same way and sends `[问题 → 答案]` before the reader's own words (§7), clearing the answer once the session took it. - The answer lives in `useComposerDraft` and is persisted with the draft, like `refs`: restoring the words without the answer would hand back half a draft.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The phone now draws the agent's
futureos-choicefence as a real card and keeps the answer it produces in the composer draft, instead of leaving a readable list behind and drawing a separate chip. Desktop already landed this in #1612; this is the mobile half, at designdocs/design/choice-cards.zh-CN.md§5.7 / §11 step 6.ChoiceCard(new): full-width card, one 44pt row per option with a line on what picking it changes,radio/checkboxrole witharia-checked, a single selected cue and the "answer is above the input" footnote once picked.TimelineCardhands the answer surface to the last settled reply's last prose block andMarkdownTextmarks the document's last card; every other card stays readable but inert.ComposerDockgains a chip row above the field (question, answer, pencil, clear) andChoiceSheet, the bottom sheet the pencil opens.canSend/hasDraftcount the answer, so one option and no words is sendable;useComposerSubmissionsends the question and answer before the reader's own words and drops the answer once the session took it.refs: restoring the words without the answer would hand back half a draft.Commits
feat(mobile): draw choice cards and keep their answer in the draftVerification
Run in a detached worktree at
07efa35d2, node 22, mobile packages only (the change touchesmobile/plus the screenshot scenario file; no Rust crate, no shared package):npx tsc --noEmit→ cleannpx eslinton all 25 changed TypeScript files → cleannpx jeston the 10 changed suites → 194 passednpx jestfull mobile suite → 170 suites, 3224 tests passednode -eparse ofscripts/screenshots/scenarios.d/choice-cards.json→ okUser-visible changes
[question → answer]before the reader's own words). Before: the fence was shown as a static list and there was no way to answer it from the draft. Revert:07efa35d2.