Skip to content

feat(mobile): allow ten images per message - #837

Merged
huichen merged 2 commits into
mainfrom
feat/image-limit
Sep 25, 2026
Merged

huichen merged 2 commits into
mainfrom
feat/image-limit

Conversation

@huichen

@huichen huichen commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

The phone's album (and every other attachment source) could contribute at most 4 images per message. This raises the per-message image cap to 10 — the attachment cap — so a message can be filled with photos, which is what the album grid's multi-select was already asking for.

The cap is enforced in two places that must agree, so both changed:

  • mobile/src/remote/files.ts MAX_IMAGES: 4 -> 10. The image rule now runs before the attachment rule, so an image-heavy batch reports the specific limit ("at most 10 images") rather than the generic one — with the two caps equal, the image message would otherwise be unreachable.
  • desktop/src-tauri/src/remote_host/files.rs MAX_IMAGES: 4 -> 10: claim_uploads validates a remote (phone) send, so leaving it at 4 would reject what the phone now allows.

Desktop-side selection keeps its own, smaller composer rule (4 images for the vision token budget) — unchanged, and its docs still describe that.

Validation

  • Mobile: tsc --noEmit, eslint clean, 128 suites / 2036 tests pass. New case "a message can be filled with ten images" (ten accepted, the OS picker is asked for ten); the quota cases now read in terms of MAX_IMAGES instead of a hard-coded 4.
  • Desktop backend: cargo test --release remote_host::files — 35 passed; the upload-rules test now checks ten images accepted and eleven rejected.
  • Docs: mobile transfer rules (docs/internals/desktop/PRODUCT.md, PRODUCT.zh-CN.md) and the mobile attachment line (docs/internals/mobile/README.md, README.zh-CN.md).

Not verified on a device: the phone needs a rebuilt APK for the new limit.

The phone's album could contribute at most four images. Raise the per-message
image cap to ten — the attachment cap — so a message can be filled with photos.

One rule, enforced where a remote send is validated:

- mobile/src/remote/files.ts MAX_IMAGES 4 -> 10. The image rule is checked
  before the attachment rule so an image-heavy batch reports the specific limit
  ("at most 10 images") instead of the generic one.
- desktop backend remote_host::files MAX_IMAGES 4 -> 10: claim_uploads rejects a
  phone send that carries more, so the two must agree or the phone's own limit
  would be unreachable.
- Desktop-side selection keeps its own, smaller composer rule (4 images, vision
  token budget); that is unchanged.

Docs updated for the mobile transfer rules (PRODUCT.md / PRODUCT.zh-CN.md) and
the mobile attachment line (README.md / README.zh-CN.md). Tests: mobile gains
"a message can be filled with ten images" (ten still accepted, the picker asks
for ten) and the quota cases are expressed in terms of MAX_IMAGES; the backend
test now checks ten accepted / eleven rejected.
@huichen
huichen enabled auto-merge (squash) September 25, 2026 13:48
@huichen
huichen merged commit 456c5ea into main Sep 25, 2026
12 checks passed
@huichen
huichen deleted the feat/image-limit branch September 25, 2026 13:59
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