Skip to content

fix(compose): let To/Cc/Bcc rows wrap and grow with long recipient lists - #148

Open
alfirus wants to merge 1 commit into
flectar:mainfrom
alfirus:fix/compose-recipients-wrap-141
Open

alfirus wants to merge 1 commit into
flectar:mainfrom
alfirus:fix/compose-recipients-wrap-141

Conversation

@alfirus

@alfirus alfirus commented Oct 27, 2026

Copy link
Copy Markdown

Summary

Fixes #141: To/Cc/Bcc were fixed-height (40px) single-line fields, so once the recipient list exceeded the field width it could neither expand to another line nor be reviewed before sending. Recipient rows now wrap and grow (up to five lines, then clip), and the send path accepts newline-separated addresses, so wrapped/pasted lists parse instead of failing or — worse — passing validation as one glued address.

Change

  • ui/components/composer-controls.slint — RecipientRow is now multi-line (single-line: false, wrap: word-wrap). Row height tracks an invisible wrapping twin (field-mirror, same origin/font/wrapping, 4px narrower so it never wraps less), min(132px, max(40px, …)), clip: true. Single-line rows render exactly 40px as before.
  • ui/components/composer-fields.slint — Cc/Bcc rows stack below the To row's actual height (Cc/Bcc are now always-instantiated with visible instead of if, so their heights are always readable); the contact-suggestion popup anchors under the To row (to-row.height - 3px, identical 37px for single-line rows).
  • src/mail.rs — parse_recipients also splits on \n (one-address-per-line pastes); parse_address rejects surviving control characters (\r, \n) so multiline input can never smuggle a header break into an address.
  • src/compose_controller.rs — compose_recipient_query / complete_compose_recipient treat \n as a separator; completion after a newline-separated prefix normalizes to , instead of gluing onto the previous line.
  • Tests added in both Rust files (separator splitting, control-char rejection, query/completion with newlines).

User-visible effects

Long To/Cc/Bcc lists wrap visibly and stay keyboard-navigable (arrows/Home/End across wrapped lines); Return still inserts a soft break inside the field, which now parses correctly at send. No change for short lists.

Tests

  • New unit tests (see above); existing compose/mail suites cover the touched functions.
  • Could not run the Rust gate or render the UI locally: this contribution was prepared on a host without the Rust toolchain (no cargo/rustc, no display), against byte-verified copies of main (all four base blobs hash-matched before patching). Relying on CI (cargo fmt --check, clippy, cargo test, slint-viewer --check) as the gate — please tell me if the row heights need adjustment after a visual check, and I will iterate.
  • Follow-up noticed while here (out of scope): Cc/Bcc rows have no edited/suggestions-open wiring, so contact autocomplete only ever fires for To. Happy to file or fix separately.

Notes

Recipient rows are fixed 40px single-line fields, so a list longer
than the field width can neither expand nor be reviewed before sending.
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.

Impossible to extend & navigate the "to" field when too many recipients (same with cc / bcc)

1 participant