Skip to content

fix(mobile): build chat approval and question cards with desktop's rules - #33967

Merged
AmoabaKelvin merged 5 commits into
mainfrom
mobile-chat-prompt-cards
Oct 27, 2026
Merged

AmoabaKelvin merged 5 commits into
mainfrom
mobile-chat-prompt-cards

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​232 $\color{#cf222e}{\Huge{\mathbf{−}}}$​659 $\color{#cf222e}{\Huge{\mathbf{−}}}$​427
Prod 31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​389 $\color{#cf222e}{\Huge{\mathbf{−}}}$​669 $\color{#cf222e}{\Huge{\mathbf{−}}}$​280

ELI5

When an agent in a terminal chat asks for permission or asks a question, the phone used to guess the card from the agent's last message. Now it reads the same approval and question data desktop reads, using desktop's own code.

What Changed

The phone now builds prompt cards with desktop's rules from src/shared, and the mobile copies are deleted.

  • Prose-guessed cards (native-chat Linux support #1). Before: the phone scanned the agent's last message for words like "permission", "allow", "confirm" or numbered lists, and that guess beat the real approval. A numbered list in tool output could become a button that sends 2 ("Yes, and don't ask again" in Claude). Now: the phone shows only the approval envelope (OMP plan review included), the status ask and unresolved transcript asks, like desktop. parseInteractivePrompt and the card decision moved to src/shared/native-chat-interactive-prompt.ts (resolveNativeChatInteractivePromptCard).
  • Approval vs transcript question (Fix MaxListenersExceededWarning with singleton PTY dispatcher #6). Before: an open transcript question hid a live approval on the phone. Now: the approval wins, as on desktop.
  • Agent-state gate (x #22). Before: the phone showed approval cards and status asks only while the agent was waiting or blocked. Now: no state gate, like desktop.
  • Approval copy (Fix PR status display: deduplicate concurrent requests and simplify cache logic #38). "Allow {tool}?", Allow/Deny and the plan-review title are one shared English table; desktop translates it. The five approval keys are added to the runtime English catalog.
  • Dismiss keys (Add 'Add repo' option to repo filter dropdown #39). Desktop's dismiss key and match rule moved to src/shared/native-chat-prompt-dismiss-key.ts. Approvals are keyed on title, detail and wait start; a status-backed question in a new wait shows again. Each side keeps its own dismissal store.
  • "Other" free text (Fix terminal padding with small inset #30). Before: the phone flattened newlines and wrote control bytes raw. Now: it uses the shared buildNativeChatPasteBytes, like desktop.
  • Old-host answer packing (agent-sessions Add repo-added notifications #19). Before: on hosts without answers support the phone packed answers against an empty body, so an allowed empty answer was dropped and whitespace trimmed. Now: it passes the real prompt body, like desktop.
  • Structured approval projection and pending-prompt filter (agent-sessions Add right sidebar with file explorer, source control, and Monaco editor #21, prompts part). The phone uses the shared chatApprovalFromJournal. Desktop's pendingStructuredSessionPrompts moved into src/shared/structured-agent-session-message-projection.ts, replacing two mobile copies.

Why

Desktop logic wins in the mobile/desktop parity audit. The phone's prose guess could send the wrong key into Claude's permission dialog. One shared parser removes that risk and keeps the two apps from drifting again.

Linked Issue

Part of the mobile/desktop parity audit

Visual Proof

No device captures for this fleet. The change adopts desktop's existing behavior: parseInteractivePrompt and the approval-first card decision in use-native-chat-interactive-prompt-card.ts.

Testing

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

Focused tests: the moved shared prompt tests, desktop prompt-card tests, and mobile src/session tests. Desktop parser tests moved to src/shared/native-chat-interactive-prompt.test.ts. Mobile tests that only pinned the prose heuristics are deleted. A regression test covers an ask answer staying valid across the status-to-transcript handoff.

AI Disclosure

Review

Codex review, 3 rounds. Round 1 found an answered card staying up if the host cleared the status ask before the answer settled; fixed. Round 2 found the runtime English catalog missing the approval keys; fixed. Round 3 found nothing.

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):

  • No cards built from the agent's last message: numbered or bulleted questions, "Permission requested" with options taken from prose, y/n fallbacks. Agents with no approval envelope no longer get these cards on the phone, same as desktop. This is intended.
  • No waiting/blocked gate on approval cards and status asks.
  • The terminal question card and its answer path are gone. Structured chats keep their own question cards.

Desktop: no behavior change; approval copy now comes from the shared table.

Compatibility: no wire change. Works with old and new hosts and phones. Folder workspaces, SSH hosts and all host OSes are unaffected because this is phone-side card parsing.

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 13 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: 7e28fca9-795f-4992-96df-56344173214b
Commits

Reviewing files that changed from the base of the PR and between e792353 and 28380c2.

Files selected for processing: 44
  • mobile/src/session/MobileNativeChatView.prompt-presentation.test.ts
  • mobile/src/session/__mocks__/mobile-prompt-controller.ts
  • mobile/src/session/mobile-native-chat-controller-contract.ts
  • mobile/src/session/mobile-prompt-controller.test.ts
  • mobile/src/session/mobile-structured-actionable-prompt.ts
  • mobile/src/session/mobile-structured-agent-prompts.ts
  • mobile/src/session/mobile-structured-agent-session-cancel.ts
  • mobile/src/session/native-chat/input/MobileNativeChatPromptCard.tsx
  • mobile/src/session/native-chat/input/mobile-native-chat-permission.test.ts
  • mobile/src/session/native-chat/input/mobile-native-chat-permission.ts
  • mobile/src/session/native-chat/input/mobile-native-chat-prompt-dismissals.ts
  • mobile/src/session/native-chat/input/mobile-native-chat-question.test.ts
  • mobile/src/session/native-chat/input/mobile-native-chat-question.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.test.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-answer-send.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.test.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-ask-dismiss.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-cards.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-dismiss.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-prompt-presentation.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.test.ts
  • mobile/src/session/native-chat/input/use-mobile-native-chat-prompts.ts
  • mobile/src/session/native-chat/mobile-native-chat-send.ts
  • mobile/src/session/use-mobile-native-chat-controller.test.ts
  • mobile/src/session/use-mobile-native-chat-controller.ts
  • mobile/src/session/use-mobile-native-chat-message-send.test.ts
  • mobile/src/session/use-mobile-native-chat-message-send.ts
  • mobile/src/session/use-mobile-structured-prompt-responses.test.tsx
  • mobile/src/session/use-mobile-structured-prompt-responses.ts
  • src/renderer/src/components/native-chat/native-chat-dismiss-key.ts
  • src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts
  • src/renderer/src/components/native-chat/native-chat-interactive-prompt.ts
  • src/renderer/src/components/native-chat/structured-agent-session-message-projection.ts
  • src/renderer/src/components/native-chat/structured-agent-session-prompt-response.ts
  • src/renderer/src/components/native-chat/structured-conversation-command-send.ts
  • src/renderer/src/components/native-chat/use-native-chat-interactive-prompt-card.ts
  • src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.ts
  • src/renderer/src/components/native-chat/use-structured-agent-session.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/shared/native-chat-interactive-prompt.test.ts
  • src/shared/native-chat-interactive-prompt.ts
  • src/shared/native-chat-prompt-dismiss-key.test.ts
  • src/shared/native-chat-prompt-dismiss-key.ts
  • src/shared/structured-agent-session-message-projection.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-prompt-cards branch 2 times, most recently from c03a895 to fc5f59e Compare October 27, 2026 02:18
Mobile guessed permission and question cards from assistant prose; the
guess could outrank the real approval and send the wrong key.
Its fallbacks now come from the shared copy table, which i18next cannot rebuild from the call site.
@AmoabaKelvin
AmoabaKelvin force-pushed the mobile-chat-prompt-cards branch from fc5f59e to 28380c2 Compare October 27, 2026 03:00
@AmoabaKelvin
AmoabaKelvin merged commit 76349e8 into main Oct 27, 2026
42 of 43 checks passed
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