Reader: collapse multiple attachments into an expandable accordion ("See x more attachments") #134

Closed
opened 2026-07-02 14:42:07 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-02 14:42:07 +00:00 (Migrated from github.com)

When a message has multiple attachments, the reader's Attachments composable (app/src/main/kotlin/org/libremail/ui/reader/ReaderScreen.kt, ~line 203) renders every attachment via attachments.forEach { AttachmentRow(...) }, so they stack vertically and push the rest of the message content downward without bound.

Desired behavior

  • 1 attachment: render it as today (single AttachmentRow, no accordion).
  • More than 1 attachment: show the FIRST attachment row, then a collapsed accordion/drawer control below it — a down-arrow (chevron) with the text "See x more attachments", where x = (total attachments − 1). Tapping it expands to reveal the remaining rows; tapping again collapses. On expand, rotate the chevron (down→up) and/or update the label (e.g. "See fewer attachments" / "Hide").
  • Pluralization: x == 1 → "See 1 more attachment" (singular); x > 1 → "See {x} more attachments". Put the strings in strings.xml with a plural (plurals) resource.

Scope / notes

  • The message VIEW (reader) only: ui/reader/ReaderScreen.kt Attachments / AttachmentRow. Compose-screen attachments are a separate surface and NOT in scope here.
  • Material 3; animate the expand/collapse to match the codebase; keep it accessible (chevron contentDescription; the toggle exposes its expanded state to semantics).
  • Each AttachmentRow's download/open behavior is unchanged.
When a message has multiple attachments, the reader's `Attachments` composable (`app/src/main/kotlin/org/libremail/ui/reader/ReaderScreen.kt`, ~line 203) renders every attachment via `attachments.forEach { AttachmentRow(...) }`, so they stack vertically and push the rest of the message content downward without bound. ## Desired behavior - **1 attachment:** render it as today (single `AttachmentRow`, no accordion). - **More than 1 attachment:** show the FIRST attachment row, then a collapsed accordion/drawer control below it — a down-arrow (chevron) with the text **"See x more attachments"**, where **x = (total attachments − 1)**. Tapping it expands to reveal the remaining rows; tapping again collapses. On expand, rotate the chevron (down→up) and/or update the label (e.g. "See fewer attachments" / "Hide"). - **Pluralization:** x == 1 → "See 1 more attachment" (singular); x > 1 → "See {x} more attachments". Put the strings in `strings.xml` with a plural (`plurals`) resource. ## Scope / notes - The message VIEW (reader) only: `ui/reader/ReaderScreen.kt` `Attachments` / `AttachmentRow`. Compose-screen attachments are a separate surface and NOT in scope here. - Material 3; animate the expand/collapse to match the codebase; keep it accessible (chevron `contentDescription`; the toggle exposes its expanded state to semantics). - Each `AttachmentRow`'s download/open behavior is unchanged.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#134