When sending a "warning" message to a user from the Patrolling workflow, we will now have a concept of "saved" templates, which are simply messages that you would like to re-use for future warnings or communications.
We will need to build a simple CRUD interface for managing your list of saved templates.
Some architectural notes:
- Everything is stored locally.
- The actual workflow of sending a "warning" to a user should re-use the existing Talk activity, but should add an entry point for "saving" this reply to your list of saved templates, and/or "managing" the entire list of saved templates.
Design: Figma
Description from the main ticket
40. Empty state | 41. List of templates | 42. Compose new message | 43. Message | 44. Save changes? | 45. Adding title to message | 46. New message saved | 47. Edit message from list | 48. Select to delete message | 49. Message deleted |
Manage templates
- Empty state
- Manage templates is accessed through tapping on the custom 'Manage templates’ icon at the top of the ‘Warn’ page.
- It is a place where all saved messages are stored. From here you can create, edit, move or delete new/existing messages.
- Title: ‘Manage templates’
- Icon: ‘Add’ icon (to add new messages to the list).
- When there are no messages saved you will see an empty state:
- Copy: ‘You do not have any warning messages saved.’
- List of templates
- When messages are present they will have a drag handle on the left side of the message so patrollers are able to drag them to a different position within the list.
- Compose new message
- Tapping on the ‘Add’ icon in the top right corner opens a new page where patroller can compose a new message. This is similar to ‘Composing the first warning message’ process.
- Page title: ‘New message’
- Button: Save
- Copy top of page: ‘Compose a warning message.’
- Next: Text input for ‘Subject’ line
- Next: Text input for ‘Compose message’
- Next: Licensing text
- The keyboard for this page is that same as for the one when editing articles that has the additional formatting toolbar over the keyboard.
- Message
- If a patroller composes a message and then decides to go back to the ‘Manage templates’ they will see a modal (see #21):
- Title: ‘Are you sure you want to exit?’
- The copy of the modal is: ‘The subject and message text will not be saved.’
- Buttons: ‘No’; ‘Yes’
- Save changes?
- ‘Subject line’ and ‘Compose message’ must be filled in order save message (same as when composing a message on talk pages)
- If ‘Compose message’ is filled but ‘Subject’ isn’t the patroller may tap on the active ‘Save’ button but will get a warning underneath the text input saying ‘The subject cannot be empty’ and won’t be able to proceed to saving until the ‘Subject’ is filled (see #23)
- If ‘Subject’ is filled but the message isn’t the ‘Save’ button stays inactive (see #24).
- After filling out the ‘Subject’ and ‘Compose message’ the patroller can tap on ‘Save’, this triggers a ‘Save changes’ modal.
- Copy: ‘Add title and save message.’
- Text input field: ‘Message title’
- Buttons: ‘Cancel’; ‘Save’
- Adding title to message
- Patroller must add title to save message, otherwise the ‘Save’ button will stay inactive.
- New message saved
- Saving the message will take the patroller back to the ‘Manage templates’ page (where the message will be present in the list) and trigger a snackbar:
- Copy: ‘Message has been saved.’
47. Edit message from list
- Tapping on the edit icon beside any message would trigger a modal that has pre-filled sections for each of the text input fields:
- Title; ‘Edit message’
- Text input field: ‘Message title’
- Text input field: ‘Subject’
- Text input field: ‘Compose message’
- Buttons: ‘Delete’; ‘Save’
- Tapping ‘Save’ closes modal and takes patroller to ‘Manage templates’ page and triggers a snackbar:
- Copy: ‘Message has been saved’
- Select to delete message
- Tapping delete closes modal and takes patroller to ‘Manage templates’ page and triggers a snackbar.
- Message deleted
- Snackbar copy after someone successfully deletes a message: ‘Message has been deleted’
APK: https://github.com/wikimedia/apps-android-wikipedia/pull/4126