Background
As the designs for Edit History are being built there are some technical tasks that can be created without designs, this task serves as one of them.
The Task
Implement the ability for users to select two revisions and be sent to a diff screen (the infrastructure for the diff screen already exists via native Watchlists).
User Story
As a Wikipedia Android app user I want to select two revisions listed in Edit History so that I can easily compare two distinct revisions without leaving the app.
Design (Figma)
01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 |
01) Tapping ‘Compare’ at the top right
- Displays a radio button next to each card in the revision history
- Indents text in the card
02) Selecting revisions to compare
- Changes the styles of the card
- The first item that users select turns yellow (and is displayed first in the footer)
- The second item that users select turns blue (and is displayed second in the footer)
03) When users try to select more than two items, a snackbar appears that informs users that they can only select two items.
04) This is the revision comparison screen, it consists of:
- ‘From’ and ‘To’ dates of the selected revision edits
- The username (truncated on 1 line)
- The edit summary
- A diff view that collapses the lines before and after it
- The current comparison can be shared via overflow menu at the top right (Share)
- Please sync with engineers from iOS to achieve the same output
- Link to this revision comparison
05) Tapping a username shows a menu to select that asks users if they want to visit the user’s profile page or talk page.
06) On scroll
- On scroll, the ‘From’ and ‘To’ dates become sticky at the top
- Also, the ‘Compare revisions’ title moves to the app bar
07) The lines before and after the main diff can be expanded by tapping the chevron icon
- The chevron icon points to the bottom when an item is expanded
- The diff above also features the treatment of blank lines
08) Example of a more complex diff (Link to this revision). It features:
- Unedited lines
- Removals
- Moved paragraphs
Link to APK
https://github.com/wikimedia/apps-android-wikipedia/actions/runs/1994433968