Page MenuHomePhabricator

It should be possible to undo edits on mobile
Closed, ResolvedPublic3 Estimated Story Points

Description

T191706: It's not possible to undo/rollback edits from diff on Mobile was marked resolved last year, but I can't see a revert button on mobile.

image.png (1×824 px, 179 KB)

A Rollback button is present, but nothing for undoing edits.

Designs

Card openCard closedUser group popoverNo user groupsCheck user preference on
Card open.png (671×391 px, 70 KB)
Card closed.png (671×391 px, 101 KB)
Popover open.png (671×391 px, 70 KB)
No user groups.png (671×391 px, 68 KB)
Group 36.png (671×391 px, 70 KB)

Acceptance criteria

  • The Undo button is visible in the tray alongside Thanks and Rollback
  • The three buttons are styled as buttons, not just plain links
  • The buttons are all visible in both Visual and Wikitext diff modes
  • The Undo button is only visible to registered users

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

@Samwalton9-WMF

New Patch demo here that proposes a solution to address the show ip button issue.
Note you'll have to go into the developer tools to modify the username there as it would be very tedious to create enough temp users to make this issue occur.
Screenshots as well:

Screenshot 2025-11-18 at 2.07.16 PM.png (910×402 px, 78 KB)

Screenshot 2025-11-18 at 2.10.07 PM.png (909×406 px, 83 KB)

I noticed we're not displaying edit count for temporary accounts, could we add that in? Obviously user groups doesn't make sense but I think edit count is still useful.

Test wiki created on Patch demo by KGraessle-WMF using patch(es) linked to this task:
https://8a0f7cc768.catalyst.wmcloud.org/w/

I noticed we're not displaying edit count for temporary accounts, could we add that in? Obviously user groups doesn't make sense but I think edit count is still useful.

I don't believe this is supported as when I attempt to retrieve this information using the current interfaces I don't get any count returned because the user is null when temporary.

There is a bug with the info card wrapping on long usernames. I would've added this as a comment on Gerrit, but I can't upload screenshots there.

Screenshot 2025-11-19 at 9.49.17 AM.png (170×784 px, 16 KB)
Screenshot 2025-11-19 at 9.51.26 AM.png (232×1 px, 80 KB)

I noticed we're not displaying edit count for temporary accounts, could we add that in? Obviously user groups doesn't make sense but I think edit count is still useful.

I don't believe this is supported as when I attempt to retrieve this information using the current interfaces I don't get any count returned because the user is null when temporary.

Hmm, Special:Contributions for a temporary account does show an edit count, so I naively assume the data is somewhere, unless it's being calculated live: https://en.wikipedia.org/wiki/Special:Contributions/~2025-34962-58

I noticed we're not displaying edit count for temporary accounts, could we add that in? Obviously user groups doesn't make sense but I think edit count is still useful.

I don't believe this is supported as when I attempt to retrieve this information using the current interfaces I don't get any count returned because the user is null when temporary.

Hmm, Special:Contributions for a temporary account does show an edit count, so I naively assume the data is somewhere, unless it's being calculated live: https://en.wikipedia.org/wiki/Special:Contributions/~2025-34962-58

Ok upon closer inspection it was our code that was causing it, I'm able to get the user edit count to display, but still hide the user groups:

Screenshot 2025-11-19 at 9.04.33 AM.png (840×380 px, 69 KB)

Patch incoming!

Change #1207252 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/core@master] It should be possible to undo edits on mobile

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

Thank you @Kgraessle! It looks great, one small thing. One tiny change, can the space between user links, edit count and buttons be 12 pxs?

Screenshot 2025-11-20 at 08.42.21.png (688×896 px, 103 KB)

Test wiki on Patch demo by KGraessle-WMF using patch(es) linked to this task was deleted:

https://8a0f7cc768.catalyst.wmcloud.org/w/

This adds the message diff-usergroups. Currently, its English text is "$1 user groups" and its qqq is "The text for displaying user groups on diff view."

$1 is not documented in qqq. As far as I can see in the code, it's a number of user groups.

Is this number always more than 1? If it can be 1 or 0, the English message text should probably be something like "$1 user {{PLURAL:$1|group|groups}}". Even if it is always more than one, it should use {{PLURAL}} because many languages use different forms for 2, 4, 6, etc.

For reference, this was addressed in https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1206868 .

Hey all! A few notes on the new mobile-diff footer design (speaking as an end-user);

  1. For editors with (relatively) short usernames, although the username doesn't take up the full width of the screen, the <a> HTML element does. This means that tapping to the right of the link's text will still result in your browser taking you away from the diff page & to the editor's userpage. IMO, this behaviour seems like it'd be unexpected. (Speaking personally, I encountered this behaviour when I was attempting to tap the 'expand' icon at the right of the footer, and obviously mistapped ever-so-slightly.)
    long a-tag screenshot.png (290×688 px, 29 KB)
  2. When viewing the expanded footer, after tapping on the 'info' icon next to the 'X user groups' label, the box slightly overlaps the right-hand edge of the screen.
    overlapping box screenshot.png (320×672 px, 23 KB)
    While testing, I viewed a random diff on zhwiki while logged-out, and this problem seems even worse on the edit I looked at there:
    overlapping box screenshot (zhwiki).png (442×614 px, 51 KB)
  3. In the 'user groups' box, it seems like the technical names of the user-groups are displayed (in my case, autopatrolled), rather than the 'human' version of the group names (in my case, 'Autopatrollers'). This feels like it's a change from the previous version of the mobile diff footer, and feels like it might cause problems/confusion on e.g. non-English wikis (and on wikis which have overridden a group's human/social names to be quite different to their technical names).
  4. It seems like there's a brief flash-of-unstyled-content after loading a diff-page, during which (if you expand the footer in that time) the e.g. 'undo' button appears as a link, rather than a button.

Let me know if you'd like me to split any of these out into their own tasks :)

Just came here to comment the same as above.

I think in particular the following issues need to be addressed more urgently as they could be disrupting editor workflows:

  • The user groups need to be translated (do not make sense in non-English)
  • I also keep accidentally clicking the username when I want to expand

Hey all! A few notes on the new mobile-diff footer design (speaking as an end-user);

  1. For editors with (relatively) short usernames, although the username doesn't take up the full width of the screen, the <a> HTML element does. This means that tapping to the right of the link's text will still result in your browser taking you away from the diff page & to the editor's userpage. IMO, this behaviour seems like it'd be unexpected. (Speaking personally, I encountered this behaviour when I was attempting to tap the 'expand' icon at the right of the footer, and obviously mistapped ever-so-slightly.)
    long a-tag screenshot.png (290×688 px, 29 KB)
  2. When viewing the expanded footer, after tapping on the 'info' icon next to the 'X user groups' label, the box slightly overlaps the right-hand edge of the screen.
    overlapping box screenshot.png (320×672 px, 23 KB)
    While testing, I viewed a random diff on zhwiki while logged-out, and this problem seems even worse on the edit I looked at there:
    overlapping box screenshot (zhwiki).png (442×614 px, 51 KB)
  3. In the 'user groups' box, it seems like the technical names of the user-groups are displayed (in my case, autopatrolled), rather than the 'human' version of the group names (in my case, 'Autopatrollers'). This feels like it's a change from the previous version of the mobile diff footer, and feels like it might cause problems/confusion on e.g. non-English wikis (and on wikis which have overridden a group's human/social names to be quite different to their technical names).
  4. It seems like there's a brief flash-of-unstyled-content after loading a diff-page, during which (if you expand the footer in that time) the e.g. 'undo' button appears as a link, rather than a button.

Let me know if you'd like me to split any of these out into their own tasks :)

Hi! Thank you for catching these issues. The tap target issue will be fixed with this patch so we shouldn't need to file any extra tickets for that.
I have added the functionality to translate user groups in the popover to my existing patch.
I have also rearranged the HTML a bit so the popover doesn't overflow, but waiting on @OTichonova's approval for this design tweak.

Patchdemo here.

Change #1207252 merged by jenkins-bot:

[mediawiki/core@master] It should be possible to undo edits on mobile

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

Change #1208464 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/core@master] It should be possible to undo edits on mobile - Add edit count to new mobile diff footer for temp users - Fix usergroups popover overflow issue by rearranging HTML - Support translated user groups in the usergroups popover

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

Change #1208464 abandoned by Kgraessle:

[mediawiki/core@master] It should be possible to undo edits on mobile

Reason:

N/A

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

Change #1208482 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/core@master] It should be possible to undo edits on mobile

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

Test wiki created on Patch demo by JSherman (WMF) using patch(es) linked to this task:
https://eab42efffd.catalyst.wmcloud.org/w/

Hi! Thank you for catching these issues. The tap target issue will be fixed with this patch so we shouldn't need to file any extra tickets for that.
I have added the functionality to translate user groups in the popover to my existing patch.
I have also rearranged the HTML a bit so the popover doesn't overflow, but waiting on @OTichonova's approval for this design tweak.

Thanks! Looking at the Patch Demo linked from T402297#11398004, a couple more notes:

  1. It seems like the new patches result in the 'X user groups' text being split onto a separate line to the 'X edits' text. Is this intentional? I only ask as I'm conscious that it'll result in more of the available screen-space being taken up (& IMO might not look as good, though YMMV).
    screenshot.png (344×600 px, 24 KB)
  2. With the new patches, clicking anywhere to the right of the editor's username (not just on the 'expand' icon) results in the footer opening/closing. I just wanted to check if this was intentional? (In addition, a grey-background-flash appears in the screen recording whenever I expand/un-expand the footer. I verified that this also seems to occur on a real mobile device that I viewed the Patch Demo on.) Screen recording: F70376748

Spotted a new issue:

image.png (706×868 px, 122 KB)

When you have the 'editor help panel' enabled, it sits directly above the expand arrow. Not sure what the best solution is, moving it above the card?

Change #1206949 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] It should be possible to undo edits on mobile

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

Hi! Thank you for catching these issues. The tap target issue will be fixed with this patch so we shouldn't need to file any extra tickets for that.
I have added the functionality to translate user groups in the popover to my existing patch.
I have also rearranged the HTML a bit so the popover doesn't overflow, but waiting on @OTichonova's approval for this design tweak.

Thanks! Looking at the Patch Demo linked from T402297#11398004, a couple more notes:

  1. It seems like the new patches result in the 'X user groups' text being split onto a separate line to the 'X edits' text. Is this intentional? I only ask as I'm conscious that it'll result in more of the available screen-space being taken up (& IMO might not look as good, though YMMV).
    screenshot.png (344×600 px, 24 KB)

Yes, this is intentional, but it is a compromise. When trying to keep everything on one line, there were lots of buggy edge cases; in the interest of getting this reliably working, we moved it onto its own line

  1. With the new patches, clicking anywhere to the right of the editor's username (not just on the 'expand' icon) results in the footer opening/closing. I just wanted to check if this was intentional?

Yep, that just the normal behavior for the accordion component
https://doc.wikimedia.org/codex/latest/components/demos/accordion.html

(In addition, a grey-background-flash appears in the screen recording whenever I expand/un-expand the footer. I verified that this also seems to occur on a real mobile device that I viewed the Patch Demo on.) Screen recording: F70376748

I'm not able to reproduce this, but it's obvious in the video (thank you for sharing that!) can you share your mobile browser + version?

Spotted a new issue:

image.png (706×868 px, 122 KB)

When you have the 'editor help panel' enabled, it sits directly above the expand arrow. Not sure what the best solution is, moving it above the card?

@Samwalton9-WMF where are you seeing these collide? GrowthExperiments isn't in the patchdemo, and I'm not able to get the help panel to display on beta, even with the preference enabled.

Change #1208482 merged by jenkins-bot:

[mediawiki/core@master] diff: fix mobile footer layout bug

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

Noting that that the thanks button has a smaller max width than the other buttons, which becomes obvious with wider viewports

image.png (1×921 px, 84 KB)

I think we're in a lot better shape than we were. Hopefully good enough for the holiday?

So far as I know, this is what we still need to tackle:

To reproduce and fix:

[...]

(In addition, a grey-background-flash appears in the screen recording whenever I expand/un-expand the footer. I verified that this also seems to occur on a real mobile device that I viewed the Patch Demo on.) Screen recording: F70376748

To reproduce and consider what is correct:

Spotted a new issue:

image.png (706×868 px, 122 KB)

When you have the 'editor help panel' enabled, it sits directly above the expand arrow. Not sure what the best solution is, moving it above the card?

To fix:

Noting that that the thanks button has a smaller max width than the other buttons, which becomes obvious with wider viewports

image.png (1×921 px, 84 KB)

Spotted a new issue:

image.png (706×868 px, 122 KB)

When you have the 'editor help panel' enabled, it sits directly above the expand arrow. Not sure what the best solution is, moving it above the card?

@Samwalton9-WMF where are you seeing these collide? GrowthExperiments isn't in the patchdemo, and I'm not able to get the help panel to display on beta, even with the preference enabled.

I was seeing it in production, but now I'm not, and I've lost the specific diff I was looking at. I think the Help panel is only supposed to display when editing anyway, so I'm not sure why it was showing up here. I'll return if I can reproduce this.

Spotted a new issue:

image.png (706×868 px, 122 KB)

When you have the 'editor help panel' enabled, it sits directly above the expand arrow. Not sure what the best solution is, moving it above the card?

@Samwalton9-WMF where are you seeing these collide? GrowthExperiments isn't in the patchdemo, and I'm not able to get the help panel to display on beta, even with the preference enabled.

I was seeing it in production, but now I'm not, and I've lost the specific diff I was looking at. I think the Help panel is only supposed to display when editing anyway, so I'm not sure why it was showing up here. I'll return if I can reproduce this.

Ah, the latest work wasn't on production yet since the train was not rolling. We'll need to make sure that we're checking on wikis running 1.46.0-wmf.4. See https://versions.toolforge.org/ for current status on the rollout

I'm seeing a z-index stacking bug on test wiki that I didn't see anywhere else.
The "wikipedia" wordmark image is not occluded by the footer as expected
https://test.wikipedia.org/w/index.php?title=Main_Page&diff=684158&oldid=684157

Screen Shot 2025-11-25 at 08.47.38.png (1×640 px, 93 KB)

It looks like it's an svg image on production wikis whereas it's just text locally and on beta wikis. We should try to get a fix backported if possible.

Sure enough; thanks for mentioning! It's a relief to know we didn't create a new problem here.

Screen Shot 2025-11-25 at 09.38.26.png (1×640 px, 64 KB)

Change #1216640 had a related patch set uploaded (by Kgraessle; author: Kgraessle):

[mediawiki/skins/MinervaNeue@master] It should be possible to undo edits on mobile

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

Patch Demo here that fixes the flashing and the thanks button width.
Note to reproduce the flashing you need to either be on mobile, or in responsive view in dev tools as the flashing only occurs in those circumstances.

Change #1216640 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] It should be possible to undo edits on mobile

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

Change #1189383 abandoned by Jsn.sherman:

[mediawiki/skins/MinervaNeue@master] Display undo link on narrow screens in mobile view and Minerva

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

I don't think we announced this in Tech News yet.

The tray shown on Special:Diff in mobile view has been redesigned. It is now collapsed by default, and incorporates a link to undo the edit being viewed.

Adding it.

I don't think we announced this in Tech News yet.

The tray shown on Special:Diff in mobile view has been redesigned. It is now collapsed by default, and incorporates a link to undo the edit being viewed.

Test wiki on Patch demo by SCardenas (WMF) using patch(es) linked to this task was deleted:

https://2f174c3d9a.catalyst.wmcloud.org/w/

Test wiki on Patch demo by SCardenas (WMF) using patch(es) linked to this task was deleted:

https://2f174c3d9a.catalyst.wmcloud.org/w/

Test wiki on Patch demo by JSherman (WMF) using patch(es) linked to this task was deleted:

https://eab42efffd.catalyst.wmcloud.org/w/