feat(message): move message actions from dropdown to top-bar icons #110

Merged
JMR-dev merged 2 commits from feat-message-options-top-bar into main 2026-07-02 03:39:22 +00:00
JMR-dev commented 2026-07-02 03:13:27 +00:00 (Migrated from github.com)

Summary

The mailbox's multi-select contextual action bar (SelectionTopBar, MailboxScreen.kt) showed only Close and Delete directly and buried everything else behind one MoreVert dropdown. Per the ticket, the common actions are now direct top-bar icon buttons, in line with the reader app bar's existing icons-not-menus pattern:

  • Archive — direct IconButton, hidden while viewing the account's archive folder (folderRole != ARCHIVE, unchanged). material-icons-core ships no archive glyph, so it uses Icons.Filled.Done, leaning on the widely known "done with it = archive it" mail idiom (Google Inbox's sweep); a code comment records the reasoning.
  • Spam — direct IconButton (Icons.Filled.Warning), hidden while viewing the spam folder (unchanged), still confirmation-gated by the existing dialog.
  • Delete — stays a direct icon, kept in its familiar spot right next to the overflow.
  • Overflow keeps only the long tail: Move (no usable glyph in material-icons-core — the ticket explicitly allows it to stay text-labeled in a smaller overflow; still gated on canMove), Select all, and Reply / Reply All / Forward for single selections (count == 1, unchanged).

Every promoted icon carries a contentDescription (reusing the existing action_* strings) for TalkBack and test targeting.

Narrow widths: worst case is four 48dp actions plus the Close navigation icon = 288dp, which still fits a 320dp-wide bar; the "N selected" title just truncates earlier. On the common 360dp+ widths the title renders fully.

Acceptance criteria mapping

  • Common actions (Archive, Spam where applicable) are direct icon buttons, not hidden in a dropdown → promoted IconButtons above
  • Existing conditional visibility (folder role, canMove, single-selection-only) preserved → same guards, now around icons/overflow items; covered by tests
  • No awkward overflow on narrow widths → four-icon worst case fits 320dp (title truncation only)

Tests (Compose UI, androidTest)

  • archiveIcon_isDirect_andArchivesTheSelection — taps the Archive icon (no overflow trip) and asserts the repository archives both selected ids
  • spamIcon_isDirect_andConfirmsBeforeReporting — Spam icon → confirm dialog → repository reportSpam
  • archiveIcon_hides_whileViewingTheArchiveFolder — role-folder visibility for the promoted icon (Spam/Delete still shown)
  • overflow_hidesReplyActions_forMultiSelection updated to key on Select all (still in the overflow) instead of the now-promoted Archive

Closes #87

🤖 Generated with Claude Code

## Summary The mailbox's multi-select contextual action bar (`SelectionTopBar`, `MailboxScreen.kt`) showed only Close and Delete directly and buried everything else behind one `MoreVert` dropdown. Per the ticket, the common actions are now direct top-bar icon buttons, in line with the reader app bar's existing icons-not-menus pattern: - **Archive** — direct `IconButton`, hidden while viewing the account's archive folder (`folderRole != ARCHIVE`, unchanged). material-icons-core ships no archive glyph, so it uses `Icons.Filled.Done`, leaning on the widely known "done with it = archive it" mail idiom (Google Inbox's sweep); a code comment records the reasoning. - **Spam** — direct `IconButton` (`Icons.Filled.Warning`), hidden while viewing the spam folder (unchanged), still confirmation-gated by the existing dialog. - **Delete** — stays a direct icon, kept in its familiar spot right next to the overflow. - **Overflow keeps only the long tail:** Move (no usable glyph in material-icons-core — the ticket explicitly allows it to stay text-labeled in a smaller overflow; still gated on `canMove`), Select all, and Reply / Reply All / Forward for single selections (`count == 1`, unchanged). Every promoted icon carries a `contentDescription` (reusing the existing `action_*` strings) for TalkBack and test targeting. **Narrow widths:** worst case is four 48dp actions plus the Close navigation icon = 288dp, which still fits a 320dp-wide bar; the "N selected" title just truncates earlier. On the common 360dp+ widths the title renders fully. ## Acceptance criteria mapping - Common actions (Archive, Spam where applicable) are direct icon buttons, not hidden in a dropdown → promoted `IconButton`s above - Existing conditional visibility (folder role, canMove, single-selection-only) preserved → same guards, now around icons/overflow items; covered by tests - No awkward overflow on narrow widths → four-icon worst case fits 320dp (title truncation only) ## Tests (Compose UI, androidTest) - `archiveIcon_isDirect_andArchivesTheSelection` — taps the Archive icon (no overflow trip) and asserts the repository archives both selected ids - `spamIcon_isDirect_andConfirmsBeforeReporting` — Spam icon → confirm dialog → repository `reportSpam` - `archiveIcon_hides_whileViewingTheArchiveFolder` — role-folder visibility for the promoted icon (Spam/Delete still shown) - `overflow_hidesReplyActions_forMultiSelection` updated to key on Select all (still in the overflow) instead of the now-promoted Archive Closes #87 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.