Add message multi-select for bulk copy, forward and delete#6918
Add message multi-select for bulk copy, forward and delete#6918manfrommedan wants to merge 1 commit into
Conversation
|
Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible:
|
c3fdea1 to
6351e84
Compare
Adds an optional message multi-selection mode behind a new Labs flag (MessageMultiSelect, off by default). Long-press a message to start selecting and drag up or down to sweep a whole range; the list auto-scrolls at the edges. A "Select" action in the message menu also enters the mode, which is the entry point for media (long-press there opens the menu rather than entering selection directly). While selecting, a top bar shows the count and offers bulk copy, forward and delete (capped at 30 messages). Delete is always shown but disabled when the selection contains a message the user cannot redact (or when the user has no redact rights at all); it only redacts the events they are permitted to. Bulk redact runs through the active timeline so it works in threaded and focused timelines. Each selectable row is a single Checkbox-role toggle for TalkBack. Count strings use plurals. Selection state survives configuration changes and process death via a Saver. Forwarding is generalised to accept a list of events; single-event callers wrap their id in a singleton list, so existing behaviour is unchanged. English strings are added to a temporary.xml for the core team to import into Localazy.
6351e84 to
5ff59c1
Compare
|
Small follow-up: while testing this on a device I found a bug in the selection handling and folded the fix into this PR. Repro: enter selection on a media message, scroll it slightly so it leaves the screen and comes back, cancel the selection, then tap the message. It would toggle selection again instead of opening the viewer. It was intermittent, and scrolling far enough that the row gets disposed and recreated made it go away. Cause: the tap/long-press handlers read I did not add a unit test for it: the handler logic in isolation is correct, and the bug only appears from |
Content
Adds an opt-in multi-select mode to the timeline, behind a new Labs flag
(Multi-select messages, off by default).
auto-scrolls near the edges.
media, where a long-press already opens the menu.
Delete. The selection is capped at 30 and survives rotation and process death.
Delete only appears when you have redaction rights and only redacts the messages
you are allowed to. Bulk redact and forward run through the active timeline, so
they work in threads and focused timelines too. With the flag off, nothing
changes.
Motivation and context
Relates to #6737. Selecting messages one at a time through the action sheet is
slow and breaks the reading flow; this keeps the timeline stable and lets you
act on many or non-adjacent messages at once.
Screenshots / GIFs
@PreviewsDayNightpreviews cover the selection top bar, the selectionindicator and a timeline in selection mode, so the screenshot tests pick them
up in light and dark.
Tests
Unit tests cover enter/toggle/clear, the 30 cap, bulk copy and forward ordering,
bulk delete (success and partial failure), the "Select" menu intercept, the
selectable-content filter, the drag-select registry, and the forward presenter
with multiple events.
Tested devices
Checklist
developbranch.Note for the reviewer: the new English strings are in
features/messages/impl/src/main/res/values/temporary.xml. Please import theminto Localazy and I will rebase onto the generated keys.