Skip to content

One composer for threads and bot chats, with a paperclip for photos, camera and files - #41

Merged
TheAnimatrix merged 3 commits into
mainfrom
composer-row
Dec 1, 2026
Merged

TheAnimatrix merged 3 commits into
mainfrom
composer-row

Conversation

@TheAnimatrix

@TheAnimatrix TheAnimatrix commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

On a phone, the composer had a picture button and send. Desktop's has emoji, a paperclip, a mic and a round send that turns into a purple stop square. This PR is the first part: one composer component, the paperclip and desktop's stop. Emoji and dictation are their own PRs and go in the composer's trailing slot.

What it does

  • MessageComposer in the UI library (android/ui, ios/MousseUI). It is the rounded field, with slots:
    • top: attachments waiting to go; a quoted reply can go here later;
    • leading: the paperclip;
    • trailing: steer for now; emoji and the mic later;
    • action: send or stop;
    • bottom: /, Model, Effort and Access.
  • ThreadComposer uses it for threads and bot chats alike.
  • The paperclip replaces the picture button. It opens a sheet with Photos, Camera and Files. Targets are 48dp/44pt.
  • Camera:
    • Android uses the phone's camera app through a FileProvider. It asks for the camera once; the pairing scanner already declares that permission.
    • iOS uses the system camera.
  • Files works now that desktop takes documents from paired devices (feat(remote-threads): a paired device can send documents with a thread message and read them back mousse#2505):
    • A thread takes files when its computer lists threadFiles in net.info and offers orchestrator.send version 11. The phone holds it to 10 files and 18 MB together, whatever the computer claims.
    • A bot chat takes any file, 10 of them and 25 MB together, as desktop's bot chat does.
    • Otherwise the row stays and says "Your computer doesn’t accept files from phones yet."
    • A picked file is refused on the phone by count, type, size and emptiness before it is added. The computer checks it again.
    • In a bot chat, pictures and files share the 10, as on desktop.
    • When the computer can't be asked, the row says why: this phone isn't allowed, the computer can't be reached, or it needs an update.
    • Picked copies are deleted when the chat closes without sending. Android also sweeps day-old copies at start-up.
  • Stop: while a turn runs and nothing is typed, the round button shows the accent square. Once there are words it queues, and Steer sits beside it as before.

Core

  • MobileComposer.file_policy() reads what the chat takes. file_refusal(...) is the shared check both phones use.
  • MobileFilePolicy carries pictures (the limit counts pictures too, for bots) and failure (a fixed CallFailureKind when the computer couldn't be asked).
  • send_message(text, photos, files, skill) replaces send_with_skill.
  • A thread's files go up as one staged value files, [{name, data}] with plain base64, beside images. A bot's go with its pictures as sent files.
  • pending.json gains files and file_count. Both default when missing, so a pending message from an older build still reads. A retry sends the same files.
  • MobileOutgoing.files lets the bubble say "File" or "2 files".

Checks

  • Rust: four new tests, for the policy and its bounds, the refusals, the staged files value, and bot files.
    • Each has a must-fail control: break the rule and its test fails (6/6, then 4/4 for the review fixes: empty file, bot pictures, refused-phone note, shared count).
  • Android unit test: the start-up sweep deletes day-old picked copies and nothing else, with a must-fail control.
    • Run on macOS: the outbox tests sync directories, which Windows can't.
  • Android emulator, demo mode, light and dark:
    • the sheet;
    • a PDF picked in the system file picker shows as a chip with its name and size, and sends with words;
    • Stop in a running thread;
    • the refusal note on a computer that takes no files.
  • iOS simulator:
    • the gallery section (components/composer);
    • the sheet with and without files;
    • Stop;
    • light and dark.
    • The simulator has no camera, so that row says so.
  • UI loop: components-composer, attach, attach-refused, composer-stop.
  • Not tried:
    • a real phone;
    • a live desktop (the demo fakes the computer's answers);
    • the camera on a real device;
    • a large file upload.
Android iOS
Attach sheet on Android Attach sheet on iOS, computer without files
A file waiting on Android Stop while a turn runs on iOS

Review: one fresh reviewer. 6 shoulds fixed (iOS camera dropped attachments, bot chats' shared limit, empty files, Android picked copies never cleaned, failure kinds, iOS camera prompt), 4 notes: 2 fixed as small wording, 2 below and in #42. Re-check of the fix by a second fresh reviewer: all 6 fixed, no new breakage.

Notes

  • A few file names pass the phone's check but desktop refuses them: .env (desktop strips the leading dot), names of 201–255 characters (desktop cuts at 200), and emoji-heavy names (desktop counts UTF-16 units). The refusal is final and the draft stays.
  • The iOS Files path (picker, copy, send) was not run end to end; the simulator checks were the sheet, Stop and the refusal note. On Android a camera photo has no size check when taken, so a very large one fails only at send.
  • From the re-check: the send-time refusal for a photo the computer can't read (such as HEIC) now says "That isn’t a picture. Attach it with Files.", which is wrong for that photo (the old text was wrong too); and whether the iOS file importer also fires the composer's onDisappear on a real iPhone wasn't checked.

No issue

…es, refuse empty files, keep picks through the iOS camera, clean Android's picked copies, name why files can't be checked
@TheAnimatrix
TheAnimatrix merged commit 6e9b187 into main Dec 1, 2026
3 checks passed
@TheAnimatrix
TheAnimatrix deleted the composer-row 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