Page MenuHomePhabricator

Create special page to list all recovery data
Closed, ResolvedPublicFeature

Assigned To
Authored By
Samwilson
Sep 29 2023, 9:04 AM
Referenced Files
F41522492: Edit-Recovery-Dev-wiki1.png
Nov 21 2023, 4:00 AM
F41509364: 2023-11-15_16-45-44.png
Nov 16 2023, 12:57 AM
F41509371: 2023-11-15_16-51-02.png
Nov 16 2023, 12:57 AM
F41509324: image.png
Nov 16 2023, 12:57 AM
F41509321: 2023-11-15_16-30-49.png
Nov 16 2023, 12:57 AM
F41509319: 2023-11-15_16-30-02.png
Nov 16 2023, 12:57 AM
F41509317: 2023-11-15_16-27-07.png
Nov 16 2023, 12:57 AM
F41509347: 2023-11-15_16-29-34.png
Nov 16 2023, 12:57 AM

Description

Feature summary (what you would like to be able to do and where):

Add Special:EditRecovery to list all pages that have saved edit recovery data.

Use case(s) (list the steps that you performed to discover that problem, and describe the actual underlying problem which you want to solve. Do not describe only a solution):

  • Give users an overview of what data is stored on their device.
  • Have an option for deleting each item, or all at once (may be decided based on tracking information if this feature is required)
  • The special page can also have general information about the Edit Recovery feature, such as the fact that it is per-device (because the listed pages will differ between devices and this may not be clear to people).

Benefits (why should this be implemented?):

  • We need to provide a clear entry point for people to verify and discard any stored data.
  • Users may not remember which pages they had edits in progress for, and this special page will provide an overview of these.

QA Results - Beta

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald Transcript

Change 972933 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Edit Recovery: add new special page to list unsaved changes

https://gerrit.wikimedia.org/r/972933

The first part of this is ready for review. It's a very basic list of pages, but mainly is about setting up the structure and getting ready for when the design's ready.

Change 972933 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: add new special page to list unsaved changes

https://gerrit.wikimedia.org/r/972933

@Samwilson Data does store per browser on Special:EditRecovery. This could just be as designed but on the Timeless skin, it shows Special Page twice. Should it just all be under Wiki Tools just like the other skins are under Tools? In the Minerva Skin, there are no Tools section to choose from. Also regarding having an option for deleting each item, or all at once. Are you talking from the Developer Tool under unsaved-page-data on how to remove them all at once or is that still being worked on? Besides the ones I mentioned previously, it looks to be fine. I

Status:โ“NMI
Environment: Beta: 1.42.0-alpha (d5ff499)
OS: macOS Sonoma 14.0
Browser: Chrome 119, Firefox 119, Safari 17.0
Skins. Vector 2022, 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://en.wikipedia.beta.wmflabs.org/wiki/Special:EditRecovery
https://en.wikipedia.beta.wmflabs.org/wiki/Special:EditRecovery?uselang=es
https://en.wikipedia.beta.wmflabs.org/wiki/Special:EditRecovery?uselang=en-rtl

โ“AC1: https://phabricator.wikimedia.org/T347673

Browsers

ChromeSafariFirefox
2023-11-15_16-19-29.png (920ร—1 px, 166 KB)
2023-11-15_16-23-48.png (812ร—1 px, 131 KB)
2023-11-15_16-23-40.png (980ร—1 px, 176 KB)

Skins

Vector 2022Vector 2010MonobookTimelessMinerva
2023-11-15_16-36-03.png (981ร—2 px, 196 KB)
2023-11-15_16-26-31.png (725ร—3 px, 208 KB)
2023-11-15_16-27-38.png (811ร—3 px, 235 KB)
2023-11-15_16-29-34.png (970ร—2 px, 177 KB)
2023-11-15_16-27-07.png (635ร—2 px, 104 KB)

Languages

EsEn-rtlHe
2023-11-15_16-30-02.png (987ร—2 px, 178 KB)
2023-11-15_16-30-49.png (1ร—2 px, 198 KB)
image.png (1ร—2 px, 182 KB)

Misc.

Delete at once- If you delete the entries from the unsaved-page-data and refresh it, your Edit Recovery will be empty

2023-11-15_16-51-02.png (1ร—3 px, 280 KB)

Chrome Incognito
2023-11-15_16-45-44.png (679ร—3 px, 132 KB)

This could just be as designed but on the Timeless skin, it shows Special Page twice.

This is fine, one is a link to the special pages' overview, and one is a link to the current special page. It's similar on Vector:

Edit-Recovery-Dev-wiki1.png (497ร—618 px, 71 KB)

Should it just all be under Wiki Tools just like the other skins are under Tools? In the Minerva Skin, there are no Tools section to choose from.

Sorry about this I should've been clearer: the work so far doesn't include the tools link. I'm moving this back to in-dev to address the remaining parts (the tools link, and we've still got to sort out the actual proper design for the list of pages). Good point about Minerva; maybe the link should go in the personal menu, near Contributions (will get design input on this too).

Also regarding having an option for deleting each item, or all at once. Are you talking from the Developer Tool under unsaved-page-data on how to remove them all at once or is that still being worked on?

Yep, still being worked on! Sorry for not adding QA notes earlier. Thanks for testing everything so far, it's good to confirm that nothing's massively wrong. The remaining work will come soon.

Based on the discussion with @Samwilson on December 5th 2023, the following will be part of MVP:

  • A page with numbered list of all the edit recoveries that are currently stored on a device for a user. Entry point to this page will be a link (placement varies based on skin) with a tooltip that will show the number of edit recoveries saved on the current device
  • When no edit recovery is saved, there will be an empty state of the page with proper messaging. The entry point will be greyed out and the tooltip will show that there is no edit recovery saved
  • The format of each line item (pages) will be as following
    • Page:Section:Section name (view | edit) - no link on the Page:Section:...
    • Recovered on <Date & Time>

Design will be updated in this ticket

Change 981643 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Edit Recovery: improve special page listing

https://gerrit.wikimedia.org/r/981643

Page:Section:Section name

A couple of points regarding this format:

  • We can't actually retrieve the section name at this point, but I think you meant the number (or rather, number or new) anyway, so this is probably fine.
  • After looking at it more, I'm not sure about the colon as a separator between the page title (which can itself contain a colon as well as forward slashes) and the section label. Would it be suitable to match something similar to Recent Changes, where sections are shown in grey with a leading arrow?

Change 981643 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: improve special page listing

https://gerrit.wikimedia.org/r/981643

@Samwilson your first assumption is correct. regarding the second one are you saying the naming convention can be Page title --> Section?

Yeah I was thinking that something like this, with two colons, might be confusing:

Talk:Lorem ipsum/subpage:2

It could instead look like

Talk:Lorem ipsum/subpage โ†’2

Perhaps with the arrow and section bit in grey, I'm not sure. Recent changes has it in the comment part, in parentheses, but here it'll be immediately followed by the view/edit parentheses so that probably wouldn't look good.

  1. I find "view" completely redundant. Why not link the page name and just have "(edit)"? (Also the spaces around the links are inconsistent with most MW interface [.mw-changeslist-links].)
  2. While this may be an ESL thing, I find "Recovered on" confusing. The data is just saved, not "recovered", on that date, and it'll be recovered only if you reopen the editing page.
  3. It'd be nice if it was arranged in a table like Special:TopicSubscriptions.

Change 987133 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Edit Recovery: fix typo in expiry field name

https://gerrit.wikimedia.org/r/987133

Change 987133 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: fix typo in expiry field name

https://gerrit.wikimedia.org/r/987133

Change 986662 had a related patch set uploaded (by Samtar; author: Samwilson):

[mediawiki/core@wmf/1.42.0-wmf.12] Edit Recovery: fix typo in expiry field name

https://gerrit.wikimedia.org/r/986662

Change 986662 merged by jenkins-bot:

[mediawiki/core@wmf/1.42.0-wmf.12] Edit Recovery: fix typo in expiry field name

https://gerrit.wikimedia.org/r/986662

Mentioned in SAL (#wikimedia-operations) [2024-01-03T14:27:02Z] <samtar@deploy2002> Started scap: Backport for [[gerrit:986662|Edit Recovery: fix typo in expiry field name (T347673)]]

Mentioned in SAL (#wikimedia-operations) [2024-01-03T14:28:30Z] <samtar@deploy2002> samtar: Backport for [[gerrit:986662|Edit Recovery: fix typo in expiry field name (T347673)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-01-03T14:34:48Z] <samtar@deploy2002> Finished scap: Backport for [[gerrit:986662|Edit Recovery: fix typo in expiry field name (T347673)]] (duration: 07m 46s)

While this may be an ESL thing, I find "Recovered on" confusing. The data is just saved, not "recovered", on that date, and it'll be recovered only if you reopen the editing page.

We've talked about it, and will change it to from <date>, which I think reads a lot better. We could also add a tooltip to the date part, e.g. "The date and time that the recovery data was last saved."

It'd be nice if it was arranged in a table like Special:TopicSubscriptions.

The main issue with that I think is that tables don't work that well on narrow screens. I think a plain list looks good.


One possible issue: the current date format is done using Date.toLocaleString( { dateStyle: 'long', timeStyle: 'long' } ), which makes it conform to the browser/OS date locale, but not to the current MediaWiki interface language. @JSengupta-WMF is this a problem?

Change 987519 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Edit Recovery: change phrase and add tooltip to date on Special:EditRecovery

https://gerrit.wikimedia.org/r/987519

It'd be nice if it was arranged in a table like Special:TopicSubscriptions.

The main issue with that I think is that tables don't work that well on narrow screens. I think a plain list looks good.

I concur. We're also not showing the same amount of info as TopicSubscriptions.

One possible issue: the current date format is done using Date.toLocaleString( { dateStyle: 'long', timeStyle: 'long' } ), which makes it conform to the browser/OS date locale, but not to the current MediaWiki interface language. @JSengupta-WMF is this a problem?

My experience in maintaining https://pageviews.wmcloud.org has taught me that a lot of people don't have their locale settings where they actually want them, or they just have an issue with their locale's date format. I suspect the same will be true here. I see "month/day/year" date formats, which sure, that's en-US, but I actually prefer ISO 8601 or "[Month name] day, year" like my preference is set on the wiki. A pity there isn't a core JS utility for this, like i.e. Language::userDate() in PHP. Ideally we'd respect all preferences. I'm trying to find an existing example of where this is done in JS, but I'm not finding much. Other Core features like "enhanced" Recent Changes appear to do the date formatting server-side.

A pity there isn't a core JS utility for this, like i.e. Language::userDate() in PHP. Ideally we'd respect all preferences. I'm trying to find an existing example of where this is done in JS, but I'm not finding much.

That was one of my CWS wishes last year (T21992)! As Tgr commented there, however, Intl.DateTimeFormat may provide a viable alternative.

Change 987519 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: change phrase and add tooltip to date on Special:EditRecovery

https://gerrit.wikimedia.org/r/987519

Change 989640 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Edit Recovery: Use MomentJS for date formatting

https://gerrit.wikimedia.org/r/989640

Change 989640 merged by jenkins-bot:

[mediawiki/core@master] Edit Recovery: Use MomentJS for date formatting

https://gerrit.wikimedia.org/r/989640

Ready for QA again. With follow-ups to be created as separate tasks so we can close this one.

dom_walden subscribed.

I have checked out Special:EditRecovery on beta in a couple of different languages (incl. RTL) and skins. I see the date changes depending on the language you choose (although I cannot verify the translated date is correct).

I see that changing preferences like date format of timezone makes no difference to how the dates look. According to T347673#9443818, this is a known issue.

Test environment: https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (7cb542f) 12:29, 7 March 2024.

If PendingChanges should be a table, surely so should this...