Skip to content

Emoji and the mic in the phone composer - #45

Merged
TheAnimatrix merged 4 commits into
mainfrom
composer-wire-pr
Dec 1, 2026
Merged

TheAnimatrix merged 4 commits into
mainfrom
composer-wire-pr

Conversation

@TheAnimatrix

@TheAnimatrix TheAnimatrix commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

This finishes the phone's composer row. Desktop's has emoji, a paperclip, a mic and a round send that turns into a purple stop square, and now the phone does too. The parts came in #38 (dictation), #39 (emoji picker) and #41 (one composer, paperclip and stop); this PR puts emoji and the mic into MessageComposer's trailing slot, for threads and bot chats alike.

Emoji

  • The emoji button opens the panel in the keyboard's place, at the keyboard's height, so the composer doesn't jump. The button turns into a keyboard to go back.
  • Tapping the message field brings the keyboard back and closes the panel.
  • Search shows a short panel above the keyboard. The back arrow, or Android's back key, returns to the full panel.
  • A pick goes in at the caret on Android, and at the end on iOS (SwiftUI's field doesn't say where its caret is). Backspace takes off one whole emoji, flag or family.
  • Recent is read when the panel opens, so it doesn't move under the finger while picking. Android loads the emoji list off the main thread before it shows the panel.
  • Without a known keyboard height the panel is 280dp (180dp in landscape), and never more than half the screen.

Mic

  • It is the phone's own dictation, not Mousse's: Android's SpeechRecognizer and iOS's SFSpeechRecognizer, on the device where they can. No audio goes through Mousse.
  • The microphone (and on iOS, speech recognition) is asked for on the first tap only. A refusal or a missing recognizer shows a short note, with Settings when a permission is off.
  • While it listens, the words stream into the field (at the caret on Android, at the end on iOS). The field waits, and the time, the wave, Cancel and Done take the controls' place. Done keeps the words for editing; Cancel puts the field back as it was.
  • Send, Stop and Steer wait while it listens.
  • The source is the DictationSource contract from Dictation parts for the phone composer #38, so a later paired-computer source replaces the OS one without touching the composer.

Checks

  • Android unit tests: withHeard, withTyped, withBackspace and characterStart (a family, a flag, a skin tone, a variation selector, a keycap, a tag flag, an accent).
    • Where an emoji starts is our own small rule, not BreakIterator: the platform's breaks depend on its Unicode version (CI's Java split a joined family, and older phones do too).
    • Must-fail control: with backspace going back one code point instead of one character, the test fails; restored, it passes.
  • The emoji search → message field fix (review R1) was checked on the emulator both ways: with the fix the panel closes; without it, the toggle still reads "Keyboard" with the panel open behind the keyboard.
  • Android emulator (API 36, demo mode), dark and light:
    • the panel opening without the composer moving;
    • three picks and a backspace;
    • search with the keyboard;
    • the back key returning the full panel at the keyboard's height;
    • a tap on the field bringing the keyboard back;
    • dictation streaming at the caret, then Done;
    • Stop while running;
    • landscape;
    • double font size.
  • iOS simulator, the same walk.
    • The simulator draws every emoji as a "?" box (Safari there does the same), so the iOS pictures prove layout and behaviour, not glyphs.
  • UI loop: composer-emoji and composer-listening.
  • Not tried:
    • real phones;
    • real speech (the demo uses a fake recognizer);
    • emoji glyphs on a real iPhone;
    • large text on iOS;
    • TalkBack and VoiceOver.
Android iOS
Emoji panel on Android after picks Emoji panel, picks, search and back on iOS
Emoji search above the keyboard on Android Typing, listening, dictated and Stop on iOS
Listening on Android Stop while a turn runs on Android

Emoji panel in landscape on Android

Review: one fresh reviewer. 2 shoulds fixed (Android panel left open behind the keyboard when focus moved from emoji search to the message; iOS dictation kept alive by a retain cycle, so the mic ran on after leaving), 5 notes in #46. Re-check of the fix by a second fresh reviewer: both fixed; its one new note (a full-screen picture dropped the words being heard) is fixed by finishing instead of cancelling.

Notes

  • The composer jumps a little when the panel hands over to the keyboard, and when search goes back to the full panel.
  • With the bot panel open over a bot chat, Android's back key closes the hidden emoji panel first.
  • On a 360dp phone with Steer showing, the text gets narrow (very narrow at 2x font).
  • The / list isn't blocked while dictating, and Android emoji picks don't close an open list.
  • iOS builds its emoji list on the main thread the first time the panel opens.

All five are in #46. Also, on iOS, the full-screen picture viewer deletes picked attachments (from #41); added to #42.

No issue

@TheAnimatrix
TheAnimatrix merged commit 7139e07 into main Dec 1, 2026
3 checks passed
@TheAnimatrix
TheAnimatrix deleted the composer-wire-pr branch December 1, 2026 02:37
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