Skip to content

React to a bot's messages on the phone - #56

Merged
TheAnimatrix merged 4 commits into
mainfrom
feat/bot-reactions
Dec 1, 2026
Merged

TheAnimatrix merged 4 commits into
mainfrom
feat/bot-reactions

Conversation

@TheAnimatrix

Copy link
Copy Markdown
Collaborator

React to a bot's messages from the phone, as desktop does: long-press a bot message, pick an emoji, and a chip appears under the message. Second slice of message actions (#55).

What changes

  • Quick reactions. With exactly one bot message selected, desktop's quick row floats above it: 👍 ❤️ 😂 😮 😢 🙏, plus "+" for desktop's 40-emoji grid. Your current reaction is lit. Picking the same one again removes it, as desktop's toggled does. A pick closes the selection.
  • Chip. Your reaction shows as a small chip under the message. Tap it to remove it. It is dimmed while the change is still on its way.
  • Desktop's rules. One owner reaction per bot message, and only on the bot's messages. The call is bots.chat.react {botId, messageId, emoji|null} on mousse.botrpc. The reaction comes back live as the message's reaction field on the bot stream, so a change made on desktop shows on the phone, and a change made on the phone shows on desktop.
  • Shown only when the computer takes it. The phone shows reactions only when the chat can send and net.info lists bots.chat.react ≥ 1. A computer without it shows no reaction controls.
  • Offline queue, sent at most once (AGENTS.md rule 5).
    • There is one small file per computer and bot in the outbox folder, so Forget removes it. It holds at most 32 entries and 8 KiB, and keeps the latest wish per message, each with its own request ID.
    • An entry is marked sent on disk before it goes, with idem bots.chat.react:<id>, and that ID is never sent again.
    • Unsent wishes go out when the chat connects, including after a restart.
    • Results:
      • A reply settles the wish.
      • A refusal drops it and shows the computer's reason.
      • If the reply is lost, the wish stays dimmed until the stream brings that message's row.
  • Core (core/src/bot_reactions.rs): parsing, the capability gate, the toggle, and the outbox. There are 10 tests, each with a must-fail control.
  • Android and iOS:
    • QuickReactions, ReactionGrid and ReactionChips are in both UI libraries.
    • BotsScreen and BotsView are hooked up.
    • Demo route: <computer>/bot/<id>/actions/react.
    • plan.mjs has message-reactions and message-reaction-chips.

Protocol note

bots.chat.react takes no clientRequestId. It sets a value, so the idem header plus never resending a request ID is what keeps the write to one send.

Checks

  • Rust core tests on Linux CI.
  • Android: on an emulator, the quick row with the current reaction lit, the grid, picking 🔥 replacing 👍, and tapping the chip to remove it.
  • iOS: a full demo simulator build on the Mac. Not run there.
  • On iOS the quick row sits at the top of the selected message instead of floating over it, because List rows don't draw overlays reliably on iOS 15.
  • Not tested on real phones.

@TheAnimatrix
TheAnimatrix merged commit 31b2b32 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