Skip to content

Act on messages on the phone: select, reply, copy, share, read aloud, select text - #55

Merged
TheAnimatrix merged 2 commits into
mainfrom
feat/message-actions
Dec 1, 2026
Merged

TheAnimatrix merged 2 commits into
mainfrom
feat/message-actions

Conversation

@TheAnimatrix

Copy link
Copy Markdown
Collaborator

Long-press a message in a thread or a bot chat to act on it, like a chat app: the top bar turns into a selection bar, and you can reply, copy, read aloud, share or select text. Reactions come in the next PR.

What changes

  • Selection. Long-press a message to select it (highlighted). The top bar becomes SelectionBar (UI library, on Android and iOS): close and "N selected" on the left, then Reply, Copy, Read aloud and Share, with Select text under ⋯. Tap other messages to add or remove them. Close or Back ends it. Home's long-press selection uses the same bar. There are no icons on every bubble.
  • Copy and Share. Copy joins the selected messages in order. A row the phone shortened copies its full text through the existing full-text route. Share opens the system share sheet with the same text.
  • Reply. Swipe a message to the right (the reply arrow shows, with a haptic tick) or tap Reply. A ReplyPreviewBar with a close button shows in the composer's top slot. The reply goes out the way desktop sends it:
    • Bot chats: bots.chat.send with replyTo: <message id>. It is kept with the queued message, so a retry after a restart answers the same message. The chat shows desktop's replyTo quote above the message; tap it to jump to the original.
    • Threads: the send route has no reply field, so the quote goes into the text as a Markdown quote paragraph, exactly as desktop's expandQuoteTokens writes it. The transcript turns those paragraphs back into quote rows, as desktop's splitSentQuotes does; tap one to jump to the message it came from.
    • The swipe ignores drags that start on a code block or table that scrolls sideways. Only a rightward drag counts, so swipe-left for the bot panel still works.
  • Select text. Opens that one message for native text selection (system handles, across paragraphs and code). The menu has Copy, Reply with quote (quotes only the picked words) and Select all.
  • Read aloud. Uses the phone's own voice (Android TextToSpeech, iOS AVSpeechSynthesizer), not Mousse's. It reads the message as desktop's markdownToSpeechText prepares it: no Markdown, links read by their label, addresses read as "link", and code read as "Code block omitted." A SpeechBar above the composer shows which message is playing, with pause/resume and stop. Starting another message stops the first. It keeps going about 30 s in the background.
  • Core (core/src/message_text.rs). Speech text, reply quote text, quote lines, sent-quote splitting, finding the quoted message, and copy joining. Both apps use the same code. Each test has a must-fail control. MobileBotMessage.reply_to and send_message(reply_to:) were added.
  • Icons. reply, share, speaker, star, text-select, play and pause were added to the shared catalogue.
  • Demo walk. <computer>/thread|bot/<id>/actions/<select|select2|reply|quote|text|speak>, the components/messages gallery section, and the plan.mjs entries, including a swipe recording.

Desktop actions a phone could add next (no desktop change needed)

Thread: Undo/Redo (routed.actions.undoLatest / redo), Edit and resend (routed.actions.list → actions.fork → orchestrator.send with conversationBranchId), Fork from here (routed.runs.get → routed.thread.fork), Retry/Continue (orchestrator.send again). Bot: Retry (bots.chat.send again with the same replyTo). These are left for a later PR. Desktop has no pin, star or delete on single messages.

Checks

  • Rust: message_text tests and the new send test. On Linux CI; locally, the send tests that save a queued message fail on Windows only, as before.
  • Android: the demo walk on an emulator: selection bar with one and with several messages, reply bar, a quote in the transcript, Select text with its menu, the Read aloud bar. Recordings of swipe-to-reply and select-and-reply.
  • iOS: CI build only (no Mac run).
  • Not tested on real phones.

@TheAnimatrix
TheAnimatrix merged commit 79b3d9c into main Dec 1, 2026
3 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