When users Update and/or Download metrics, an intricate sequence of events transpires among various back-end processes and interface elements. This ticket describes the functionality and behavior of the interface elements that control and reflect the status of the back-end processes.
NOTE: This ticket relies on terms and concepts defined in T213136, which summarizes and codifies the Updating and Downloading processes. Please make sure you have read T213136 before proceeding with this ticket.
==The elements of the Update/Download UX
This ticket defines the management of five simple UI elements, all located at the upper-right of the Edit Summary and Edit List pages:
- the Download Reports Button/Menu (defined in T206576)
- the Animated 'Working' Indicator (also T206576)
- the Update button
- the On-Page Message/Timestamp
- the View Edit List button (Edit Summary page only)
Also defined here are some page behaviors relating to the Update/Download process (such as when the on-page metrics do or don't update.)
|**The Animated 'Working' Indicator, Download Button and On-Page Message (in the "Updating" state)** |
|{F27855938 width=400}|
= The three states of the Update/Download UX
For the purpose of describing this system, it's useful to think of it as having three possible states: Available, Updating, and Fetching. (These states are abstractions that may or may not match actual implementation strategy.) The sections below specify how each of the five elements named above behave and appear in each of the three States.
===='Available' state
In this state, Update and Download are available. This is the default state.
- **Update button ** is available; clicking will initiate update.
- **The working indicator** is not visible; no work is progressing.
- **On-page message:** shows the timestamp in the following format "Last updated 2018-10-29 18:49 (Africa/Accra)" [this is the existing format]
- **Download menu:** is available.
- **View Edit List button** is available/clickable
===='Updating' state
When the user initiates update by clicking the button or downloading a report (when there no update has occurred within the Caching Period), the Update state commences.
- **The 'Working" indicator** appears and animates, (as per T206576)
- **Update button: ** is unavailable (it's actually replaced by the indicator)
- **On-page message:** Please wait, currently crunching the numbers.... [Note: this is the existing message]
- **Download menu:** is unavailable
- **View Edit List button** is unavailable
===='Fetching' state
Fetching is the process of gathering data without gathering new page IDs (the IDs come from a prior update).
- **During Fetch—UX is as above** During Fetch, all front-end, UX elements appear and behave exactly as they do during Updating.
- **After Fetch—the timestamp (depending...)** The only visible UX difference between a Fetch and an Update occurs after the Fetch completes: strictly speaking, Fetch does not cause the timestamp to refresh. HOWEVER, Fetch often occurs in combination with an Update, rendering this difference invisible to users in such cases. The below section, "After Update/Fetch completes" defines when the timestamp does and doesn't update.
=After Update/Fetch completes
The sequence of events that occurs after Updating and/or Fetching varies slightly depending on what initiated the processes. There are three possibilities.
===#1. Update with NO Fetch
Caused by clicking the Update button on the Event Summary page. When the Update completes, the following things happen:
- **The page refreshes **and onscreen metrics update to show new values.
- **The On-Page Message** shows __a new timestamp__ corresponding to the completion time of the Update.
- **The Update button, Download menu and View Edit List button** return to their available states.
===#2. Update WITH Fetch
Caused by requesting Download of most reports—unless the data is fresh and still in the cache—or by clicking Update on the Edit List page. When the Update/Fetch process completes, the following things happen:
- **Everything is the same as #1** All UX elements behave and display as above, plus
- **The requested data is provided** the system either shows the Popup Selector (as in T206576), so the user can select a format for the report, or the Edit List page displays a new Edit List.
===#3. Fetch with NO update
Happens when the user downloads a report after a recent Update, when page ID data is fresh and in the cache. When the Fetch process completes, the following things happen:
- **The page does not refresh** on-page data remains as it was
- **On-page message** returns to the timestamp, which remains that of the __last update__ (i.e., the timestamp does not update).
- **The Update button, Download menu and View Edit List button ** return to their available states.
- **The requested data is provided** the system shows the Popup Selector (as in T206576), so the user can select a format for the report.
=Getting the files
When the user makes her selection, behavior is the same as for the existing Grant Metrics reports. Which is to say
- **Get Wikitext:** pops open a new tab that presents the wikitext of the table (e.g., T205502, T210898, T206692)
- **Download CSV** commences download of the comma-delimited file (e.g., T206058, T205561, T210775)