Page MenuHomePhabricator

Save drafts automatically
Closed, ResolvedPublic



As users translate, drafts should be saved automatically.


As a user, I can see how the in-progress translation gets saved automatically, so that my work does not get lost.

Acceptance Criteria

  1. As the user edits a translation it gets saved automatically:
    1. Saving should happen after completing a paragraph.
    2. If there is unsaved content, saving should happen on “leaving the page” events (e.g., the user clicking on “all translations” link)
    3. Clicking on “Publish translation” will save the translation (in addition to publishing it, of course)
  2. A text indicator will show “Saved X min. ago” or “saving...” (if the translation is being saved)
    1. When hovering the indicator, a tooltip will indicate “Translation drafts are saved automatically”
  3. There will no longer be an explicit “Save as draft” button. Only the “Publish translation” one as it used to be

Design notes

Note the “saved 2 minutes ago”:

Event Timeline

Arrbee created this task.Nov 28 2014, 5:52 AM
Arrbee raised the priority of this task from to Medium.
Arrbee updated the task description. (Show Details)
Arrbee changed Security from none to None.
Arrbee moved this task from Backlog to Sprint Backlog on the Language-Team board.Nov 28 2014, 9:06 AM

There will soon be a core facility for this: T75241

There is a genera; problem with “Saved X min. ago" labesl. To keep that statement true at any point of time, you need a ticking clock in UX. You see saved 4 second ago, you wait for 10 seconds,- now you should see Saved 14 seconds ago. Updating this at regular intervals is not trivial.

Google drive for example, does not show this timestamp

They just say: "All changes saved in Drive" and avoids this "clock display".

So @Pginer-WMF, please clarify what is the time intervals for updating this message and what is the cut of relative time to show nothing/actual time.

We also have a problem of constructing the relative time from moment.js and concatenating with "Saving " to create grammatically correct sentence - This is a problem only if we donot restrict the relative time stamp to say "minutes" alone.

I have the following proposal:

Always use minutes as time unit. No "seconds" or "hours". At every 1 minute update the label. And at every x minute autosave. x is always less than 60 and I think 10 mins autosave is reasonable - in case no autosave triggering event happened.

We can also optimize the save api call by checking if anything really changed or not in the translation.

santhosh claimed this task.Dec 2 2014, 7:03 AM
santhosh moved this task from Backlog to In Progress on the LE-Sprint-79 board.

Change 176896 had a related patch set uploaded (by Santhosh):
Save the draft translations automatically


santhosh moved this task from In Progress to In Review on the LE-Sprint-79 board.Dec 2 2014, 7:47 AM

Screenshot of the indicator from the above patch

@santhosh your approach sounds good to me.
The problem with "all changes saved" is that we are not planning to save as the user types (Google docs moves from "all changes saved" to "saving" as the user types a single character). In our case we plan to have a bigger latency to avoid excessive load so we cannot say either "all changes saved" or "saving" while the user is editing a paragraph we have not triggered saving for.

I think that using only minutes should be enough. Here are some additional considerations:

  • Don't use "0 minutes ago", use "Saved just now" instead.
  • If it takes more than 5 or 10 minutes, trigger auto-save. If there are changes the user would be happy to don't lose 10 minutes editing what may be a complex paragraph to translate. If there are no changes we can update the indicator ("Saved just now") anyway since the important thing is to communicate that changes won't be lost.

-To be extra safe we can have a special "Not saved for a while. Retrying..." when the counter goes beyond the limits we defined above (which may happen due to connection problems).

Arrbee moved this task from In Review to Done on the LE-Sprint-79 board.Dec 3 2014, 6:49 AM
santhosh reopened this task as Open.Dec 3 2014, 7:08 AM
santhosh moved this task from Done to In Review on the LE-Sprint-79 board.

Change 176896 merged by jenkins-bot:
Save the draft translations automatically

Arrbee moved this task from In Review to Done on the LE-Sprint-79 board.Dec 9 2014, 2:39 PM
Arrbee closed this task as Resolved.Dec 9 2014, 2:44 PM
Arrbee added a subscriber: Arrbee.