Skip to content

fix(mobile): answer multi-question asks like desktop and clear Claude's wait on phone answers - #33968

Merged
AmoabaKelvin merged 6 commits into
mainfrom
mobile-chat-ask-cards
Oct 27, 2026
Merged

AmoabaKelvin merged 6 commits into
mainfrom
mobile-chat-ask-cards

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​179 $\color{#cf222e}{\Huge{\mathbf{−}}}$​510 $\color{#cf222e}{\Huge{\mathbf{−}}}$​331
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​465 $\color{#cf222e}{\Huge{\mathbf{−}}}$​463 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2

ELI5

When an agent asks several questions at once, the phone now behaves like desktop. You can skip a question, step back to change an earlier answer, and the host notices when a phone keystroke answers Claude's question.

What Changed

  • Multi-question asks (native-chat Improve terminal font rendering, per-pane zoom, and UI zoom #7). Before: the phone kept Submit disabled until every question was answered, had no Skip, and kept multi-select picks in tap order. Now: like desktop, it sends whatever is answered, labels the button "Skip" when the current question is empty, cancels when everything is skipped, and keeps picks in option order. The pick, confirm, label, typed-text and accepts-empty rules moved to src/shared/native-chat-ask-card-rules.ts, which desktop's NativeChatQuestionCard uses too.
  • Structured multi-question prompts (Lint long files (and add TS skills) #23). Before: the phone showed one question at a time ("n of N") with its own token codec, and a single-select tap locked that answer. Now: grouped structured questions use the same stepped card as terminal asks (MobileNativeChatStructuredAsk), so an earlier answer can be changed before Submit. The question-to-card mapping in both directions moved from desktop's NativeChatStructuredQuestionCard to src/shared/structured-agent-question-card.ts. The mobile codec and its draft state are deleted. Answers name the prompt they were rendered for, so they can't land on a replacement prompt.
  • Host status after a phone answer (Break up large files into well-organized modules #29). Before: answering a Claude question from the phone left the host on "waiting for input" until Claude's next hook. Now: after an accepted terminal.send, the host checks the write with the shared isQuestionAnsweredSubmitInput rule against the pane's hook row from before the write. It then calls the existing agentHookServer.inferQuestionAnswered, the same inference desktop's typed-input path uses (terminal-send-question-answered.ts). Sends from desktop clients are skipped because desktop already infers in its renderer.

Why

Desktop logic wins in the mobile/desktop parity audit. On the phone, a user who answered only some questions had no way out except Cancel. One shared rule set keeps both cards in step.

Linked Issue

Part of the mobile/desktop parity audit

Visual Proof

No device captures for this fleet. The change adopts desktop's existing behavior: the Skip, back-step and sorted-toggle rules in NativeChatQuestionCard.tsx, the journal mapping in NativeChatStructuredQuestionCard.tsx, and the typed-answer inference from pty-connection/interrupt-input-intent.ts.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Focused root tests: NativeChatQuestionCard, NativeChatStructuredQuestionCard, use-structured-agent-session-question-answers, terminal-send*. Focused mobile tests: MobileNativeChatAsk, use-mobile-structured-prompt-responses, prompt-cancel, structured session, MobileNativeChatQuestion. The new host test fails when the inference call is removed. Tests that only pinned the deleted mobile codec are removed.

AI Disclosure

Review

Codex review, 3 rounds. Round 1: option rows now announce as checkboxes or radios; fixed. Round 2: answers could land on a replacement prompt; fixed by passing the rendered prompt identity. Round 3 findings were rejected because desktop behaves the same (Skip with partial structured answers; a one-digit free-text answer clearing the wait one step early) or because they were outside this PR's scope (flat Codex/Pi structured questions).

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Mobile behavior removed (desktop wins):

  • The rule that every question must be answered, and the disabled Submit button that went with it.
  • One-question-at-a-time grouped structured prompts and their "(n of N)" heading.
  • Answered grouped steps surviving a tab switch. They now live in the card, like terminal asks.

Known gap in #29: like desktop's typed-input path, the host check covers only single-question single-select answers. Multi-question and multi-select answers sent from the phone still wait for Claude's next hook. Closing that would need a new wire field.

Desktop: no behavior change; its question cards import the shared rules.

Compatibility: no wire change. Old hosts still get packed answers through legacyAgentSessionSelectedOptionId. The host check works with any phone version. An old host keeps today's behavior. Runtime code stays Electron-free. Folder workspaces, SSH and all host OSes are unaffected.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bfd23c2-a78c-4a47-93c0-df8fcd82ac5b
Commits

Reviewing files that changed from the base of the PR and between 3347d47 and 339f54b.

Files selected for processing: 24
  • mobile/src/session/MobileNativeChatView.tsx
  • mobile/src/session/mobile-native-chat-controller-contract.ts
  • mobile/src/session/mobile-structured-agent-prompts-grouped.test.ts
  • mobile/src/session/mobile-structured-agent-prompts.ts
  • mobile/src/session/mobile-structured-agent-session-contract.ts
  • mobile/src/session/mobile-structured-grouped-question.test.ts
  • mobile/src/session/mobile-structured-grouped-question.ts
  • mobile/src/session/native-chat/input/MobileNativeChatAsk.test.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatAsk.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatAskOptionRow.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx
  • mobile/src/session/native-chat/input/MobileNativeChatStructuredAsk.tsx
  • mobile/src/session/native-chat/input/mobile-native-chat-question.ts
  • mobile/src/session/use-mobile-structured-agent-session-prompt-cancel.test.tsx
  • mobile/src/session/use-mobile-structured-agent-session.ts
  • mobile/src/session/use-mobile-structured-prompt-responses.test.tsx
  • mobile/src/session/use-mobile-structured-prompt-responses.ts
  • src/main/runtime/rpc/methods/terminal/terminal-send-method.ts
  • src/main/runtime/rpc/methods/terminal/terminal-send-question-answered.ts
  • src/main/runtime/rpc/terminal-send-question-answered.test.ts
  • src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredQuestionCard.tsx
  • src/shared/native-chat-ask-card-rules.ts
  • src/shared/structured-agent-question-card.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-chat-ask-cards branch 3 times, most recently from 519adb7 to 419b2a4 Compare October 27, 2026 03:00
…wers it

Claude sends no hook after AskUserQuestion is answered; desktop infers it, phone answers left the pane waiting.
…back-stepping

Mobile required every answer and locked grouped structured questions once tapped; the card rules and structured mapping now live in shared code.
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-chat-ask-cards branch from 419b2a4 to 339f54b Compare October 27, 2026 03:31
@AmoabaKelvin
AmoabaKelvin merged commit 75bcd32 into main Oct 27, 2026
43 checks passed
nwparker pushed a commit that referenced this pull request Oct 27, 2026
… refusal helper (#34256)

#33968 pushed terminal-send-method.ts to 301 counted lines against the 300-line rule, failing Lint on main and every PR that merges it. Eight refusal branches spelled out the same zero-byte result; one helper builds it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant