Skip to content

Restyle chat bar with Ask UI, approvals, and markdown - #12

Merged
MRL-00 merged 4 commits into
mainfrom
update-chat-bar-ui
Jul 23, 2026
Merged

MRL-00 merged 4 commits into
mainfrom
update-chat-bar-ui

Conversation

@MRL-00

@MRL-00 MRL-00 commented Jul 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Replaces the chat composer with a Codex-style Ask bar: model/thinking picker, Auto/Ask approval, photo/camera attach, mic dictation, and stop-while-running.
  • Companion server gains richer /models, image prompts, bundled pi-mobile-approval Ask mode with pending UI, and quieter turn activity copy.
  • Chat scroll pins each sent turn to the top (with a jump-to-bottom control), and assistant markdown now renders headings, lists, code, and tables properly.

Test plan

  • Send a message and confirm it pins to the top; short replies stay put; jump-to-bottom works
  • Switch models/thinking, attach a photo, and try mic dictation on device
  • Use Ask approval mode and confirm/deny a tool prompt
  • Verify markdown tables, headings, and code blocks render cleanly

Made with Cursor

Summary by CodeRabbit

  • New Features
    • Added model selection with searchable catalogs and configurable thinking levels.
    • Added photo attachments, camera capture, and speech-to-text dictation.
    • Added Markdown rendering for formatted responses, including code, lists, quotes, and tables.
    • Added phone-based approval prompts for tool actions.
    • Added approval extension installation and status checks.
    • Improved chat scrolling, optimistic message updates, and confirmation handling.
  • Bug Fixes
    • Improved compatibility with legacy model catalogs and stabilized active-turn display.
  • Documentation
    • Updated feature descriptions and approval behavior guidance.

…own.

Bring the chat bar in line with a Codex-style Ask UI, wire model/thinking and tool approval from the phone, and fix scroll/markdown so replies stay readable on device.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@MRL-00, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bd5d8952-abfb-47bd-8184-476385aecb50

📥 Commits

Reviewing files that changed from the base of the PR and between 896905d and ec0ee2f.

📒 Files selected for processing (7)
  • PiMobile/APIClient.swift
  • PiMobile/MarkdownText.swift
  • PiMobile/Models.swift
  • PiMobile/SpeechDictation.swift
  • PiMobile/Views/ChatView.swift
  • server/install.sh
  • server/server.ts
📝 Walkthrough

Walkthrough

The PR adds richer model and prompt contracts, phone-based approval handling, image and dictation input, Markdown rendering, revised chat scrolling and optimistic updates, approval-extension installation, and related privacy and README updates across the iOS client and companion server.

Changes

Chat platform capabilities

Layer / File(s) Summary
Model and prompt contracts
PiMobile/Models.swift, PiMobile/APIClient.swift
Model metadata supports thinking and image capabilities, while client requests support structured send bodies, images, UI responses, and approval-extension operations.
Server turn and approval orchestration
server/server.ts, server/pi-mobile-approval/*
The server discovers model capabilities, launches configured turns, tracks pending approval UI, handles UI responses, and exposes approval-extension endpoints.
Chat composer and turn presentation
PiMobile/Views/ChatView.swift, PiMobile/Views/ModelPickerSheet.swift, PiMobile/CameraPicker.swift, Config/Info.plist
The chat UI adds model/thinking selection, image attachments, approval dialogs, optimistic messages, pinned scrolling, and Markdown message rendering.
Dictation and Markdown support
PiMobile/SpeechDictation.swift, PiMobile/MarkdownText.swift
Speech recognition manages audio and transcript state, while MarkdownText parses and renders headings, lists, code, quotes, rules, tables, and inline formatting.
Installation and documentation
server/install.sh, README.md
Installation prefers local server and approval-extension files, and documentation describes the new model, approval, photo, and dictation features.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ChatView
  participant APIClient
  participant Server
  participant PiRPC
  User->>ChatView: choose model, attach image, or send text
  ChatView->>APIClient: send structured prompt
  APIClient->>Server: POST /sessions/:id/send
  Server->>PiRPC: start configured Pi turn
  PiRPC-->>Server: messages, activity, or approval request
  Server-->>ChatView: status with messages and pending_ui
  ChatView->>APIClient: submit approval response
  APIClient->>Server: POST /sessions/:id/ui-response
  Server->>PiRPC: write approval response
Loading

Possibly related PRs

  • MRL-00/pi-mobile#5 — Both changes update the model-picker data flow and server/client model catalog contract.
  • MRL-00/pi-mobile#9 — Both changes modify ChatView.swift send behavior when the session ID is unavailable.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 4.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title captures the main UI and markdown focus of the PR, and it is clearly related to the broader Ask/approval chat changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-chat-bar-ui

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.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR expands the mobile chat experience and companion server. The main changes are:

  • Adds a new Ask-style composer with model, thinking, approval, attachment, camera, and dictation controls.
  • Adds image prompts and phone-based tool approvals to the companion server.
  • Pins active turns and reconciles optimistic messages with server messages.
  • Renders assistant responses with headings, lists, code blocks, quotes, and tables.
  • Adds approval-extension installation and status handling.

Confidence Score: 5/5

This looks safe to merge.

  • Ask mode now fails closed when its approval extension is unavailable.
  • Spawn and prompt-write failures clear the active turn state.
  • Image-only and repeated-text turns now use optimistic rows and baseline message IDs for pin reconciliation.
  • No blocking issue remains in the updated fixes.

Important Files Changed

Filename Overview
server/server.ts Adds richer model data, image prompts, approval handling, extension installation, and failure cleanup for active turns.
PiMobile/Views/ChatView.swift Replaces the composer, adds media and dictation controls, manages approvals, and implements active-turn pinning.
PiMobile/MarkdownText.swift Adds block-based rendering for common Markdown structures.
PiMobile/APIClient.swift Adds encoded request models for richer prompts, approval responses, and extension management.

Reviews (4): Last reviewed commit: "Fix image-only turn pinning and scroll t..." | Re-trigger Greptile

Comment thread server/server.ts Outdated
Comment thread server/server.ts Outdated
Comment thread PiMobile/Views/ChatView.swift Outdated
Comment thread PiMobile/Views/ChatView.swift Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
PiMobile/Views/ChatView.swift (1)

455-506: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Attached images are lost when send() fails.

pendingImages is cleared at Line 459 before the request, but neither the missing-session guard (485-491) nor the catch (501-507) restores it — only draft is restored. On any send failure the user's attachments silently disappear. Capture the images and restore them alongside draft on both failure paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@PiMobile/Views/ChatView.swift` around lines 455 - 506, Preserve the attached
images before clearing pendingImages in the send flow, then restore that
captured collection alongside draft when session creation fails in the guard and
when api.send throws in the catch. Update the failure cleanup around the
existing sid guard and catch without changing successful-send behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@PiMobile/SpeechDictation.swift`:
- Around line 136-149: Update the final-result handling in the recognition
callback so the latest transcript is committed to draft before calling stop(),
or ensure ChatView’s listening guard accepts final-result finalization. Preserve
the existing transcript composition and stop behavior while preventing the final
refined dictation text from being dropped.

In `@server/install.sh`:
- Around line 33-36: Update the remote-download branch of the install script to
fetch the bundled pi-mobile-approval directory alongside server.ts into LOG_DIR,
preserving the expected pi-mobile-approval path used by sendMessage and the
approval-extension install endpoint; if the directory cannot be downloaded or
installed, fail before launching the LaunchAgent.

---

Outside diff comments:
In `@PiMobile/Views/ChatView.swift`:
- Around line 455-506: Preserve the attached images before clearing
pendingImages in the send flow, then restore that captured collection alongside
draft when session creation fails in the guard and when api.send throws in the
catch. Update the failure cleanup around the existing sid guard and catch
without changing successful-send behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ed5e5e47-dbc4-4f31-9ab6-933766eb0583

📥 Commits

Reviewing files that changed from the base of the PR and between 9489c18 and 896905d.

📒 Files selected for processing (13)
  • Config/Info.plist
  • PiMobile/APIClient.swift
  • PiMobile/CameraPicker.swift
  • PiMobile/MarkdownText.swift
  • PiMobile/Models.swift
  • PiMobile/SpeechDictation.swift
  • PiMobile/Views/ChatView.swift
  • PiMobile/Views/ModelPickerSheet.swift
  • README.md
  • server/install.sh
  • server/pi-mobile-approval/extension.ts
  • server/pi-mobile-approval/package.json
  • server/server.ts

Comment thread PiMobile/SpeechDictation.swift
Comment thread server/install.sh
Ask mode now refuses to start without the approval extension, failed Pi spawns no longer leave a stuck running turn, optimistic/image pins ignore older same-text messages, polling clears stale approval UI, table cells keep escaped/code pipes, and remote install ships the approval package.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread PiMobile/Views/ChatView.swift Outdated
MRL-00 and others added 2 commits July 23, 2026 16:13
Image-only sends now get a Photo placeholder on client and server so the active turn can pin, and opening a session always lands on the most recent messages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MRL-00
MRL-00 merged commit 4c802da into main Jul 23, 2026
2 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 31, 2026
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