Page MenuHomePhabricator

Wrap "username or IP address removed" comment in a span and appropriate class
Open, LowPublicFeature

Description

If a sysop or oversighter revdels/suppresses a username on a given revision, someone with those same perms will see at Special:Contributions that revision followed by the following html:

<strong>[username or IP address removed – edit hidden from contributions]</strong>

There's no span and no class, so it can be a bit of a pain to access; at the very least, it stands out from everything else. I'm not sure on ideas for a class; history-deleted will gray and cross-out the message, which is not what would be wanted here.

Event Timeline

DannyS712 changed the subtype of this task from "Task" to "Feature Request".
DannyS712 subscribed.

For anyone who would like to work on this:
There are two different places that the message (rev-deleted-user-contribs) is shown, on Special:Contributions and Special:DeletedContributions. Each requires a different fix.

Once a class name is decided:
For Special:Contributions, modify the SpecialContributionsLine template to add a class to the <strong> tag

For Special:DeletedContributions, the DeletedContribsPager's formatRevisionRow method is what controls how each line is shown. Rather than its current manual construction of a strong element, it should be updated to call Html::element, and that call should include the new class for the text.

Feel free to add me as a reviewer for any patches

taavi subscribed.

Taking this to get more into MW core dev

How about .history-user-removed? for me that sounds like a reasonable class name

Change 612548 had a related patch set uploaded (by Majavah; owner: Majavah):
[mediawiki/core@master] Wrap rev-deleted-user-contribs message in history-user-removed class

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

...history-deleted will gray and cross-out the message, which is not what would be wanted here.

Please explain why. I'd rather have the behavior be consistent (for things that are basically the same) than introduce new arbitrary class.

...history-deleted will gray and cross-out the message, which is not what would be wanted here.

Please explain why. I'd rather have the behavior be consistent (for things that are basically the same) than introduce new arbitrary class.

I think you might have misread, this is entirely different: it's a message from the software, not the username that was hidden, so crossing it out is counter-productive and would if anything convey the opposite message. That is, at this point, there's nothing that's being hidden from the viewing user.

I think you might have misread, this is entirely different: it's a message from the software, not the username that was hidden, so crossing it out is counter-productive and would if anything convey the opposite message.

I didn't misread, and I do know the context where the message appears. The point I wanted to make, is that both the (username removed) —in all places it appears— and [username or IP address removed - edit hidden from contributions] are communicating essentially the same thing. That some text is redacted/concealed around here, not necessarily the exact spot, and greying out seems a great way to communicate that. That's why history-deleted is used even outside wiki "history" pages.

That is, at this point, there's nothing that's being hidden from the viewing user.

If that's the bug, then probably removing or tweaking the message would be a good start. Since if you 're seeing it, you already have access it to it.

I am not completely opposed to the idea of adding new CSS class though, just I don't think it is the better idea here.

The difference, though, is that history-deleted is marking text that is used as a stand-in for the hidden user name in a history or diff, whereas this text is presented in addition in order to provide some information, as the username is not displayed on each li on Special:Contributions. This text is thus (potentially) the only marker on Special:Contributions that a revision has had just the username revdel'd. Removing it would be harmful: the main reason I opened this was so that scripts could detect hidden usernames on a contribs page, but even in normal usage, it's the best way to confirm that a user's revisions have been sufficiently hidden.

At any rate, it was just my opinion, certainly not fact.

@taavi: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on October 11th.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

Change #1093839 had a related patch set uploaded (by GauriGuptaa; author: GauriGuptaa):

[mediawiki/core@master] T255903 - Update visibility of formatRow method in DeletedContribsPager and add user removal message formatting

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

Change #1093839 abandoned by GauriGuptaa:

[mediawiki/core@master] T255903 - Update visibility of formatRow method in DeletedContribsPager and add user removal message formatting

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

Change #1093839 restored by GauriGuptaa:

[mediawiki/core@master] T255903 - Update visibility of formatRow method in DeletedContribsPager and add user removal message formatting

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

Change #1093839 abandoned by GauriGuptaa:

[mediawiki/core@master] T255903 - Update visibility of formatRow method in DeletedContribsPager and add user removal message formatting

Reason:

Forget to add something

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

Change #1093839 restored by GauriGuptaa:

[mediawiki/core@master] T255903 - Update visibility of formatRow method in DeletedContribsPager and add user removal message formatting

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

Change #1093853 had a related patch set uploaded (by GauriGuptaa; author: GauriGuptaa):

[mediawiki/core@master] T255903 - Update visibility of formatRow in DeletedContribsPager and format user removal message

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

Change #1093853 had a related patch set uploaded (by Jdlrobson; author: GauriGuptaa):

[mediawiki/core@master] Pager: Update visibility of formatRow in DeletedContribsPager and format user removal message

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

Change #1093839 abandoned by GauriGuptaa:

[mediawiki/core@master] T255903 - Update visibility of formatRow method in DeletedContribsPager and add user removal message formatting

Reason:

Not able to contribute

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

Change #1093853 abandoned by GauriGuptaa:

[mediawiki/core@master] Pager: Update visibility of formatRow in DeletedContribsPager and format user removal message

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

RaushanCode subscribed.

Hi! I’m a student developer currently learning JavaScript and CSS. I’d like to take a look at this task as my first contribution to Wikimedia. I'll start by setting up my environment and checking the current progress. Please let me know if there are any specific docs I should check out first! Thanks!

Hi! I've successfully completed this task.
Summary of changes:

  • Modified the PHP logic to wrap the '(username removed)' text in a <span> tag with the class history-user-removed instead of the legacy <strong> tag.

Verification:

  • I verified the fix in a local MediaWiki Docker environment.
  • After hiding a revision's username, I inspected the DOM and confirmed the output is now: <span class="history-user-removed">(username removed)</span>.

Please let me know the next steps for submitting a patch or if further changes are needed.

image.png (1,435×674 px, 129 KB)

I have uploaded a patch for this task: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1240077 I replaced the legacy <strong> tags with <span> in Special:Contributions. You can see the clean diff in the attached screenshot. Ready for review!

image.png (1,902×971 px, 202 KB)

@241663: Hi, please fix your commit message: https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines - thanks!
(No need to post comments here (which look a bit AI-created to me) about uploading a patch, relevant information should be in the commit message instead.)

Change #1240077 had a related patch set uploaded (by Pppery; author: Raushan 31):

[mediawiki/core@master] Replace legacy strong tags with span in Special:Contributions

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

Change #612548 abandoned by Hashar:

[mediawiki/core@master] Wrap rev-deleted-user-contribs message in history-user-removed class

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

Change #612548 restored by Thcipriani:

[mediawiki/core@master] Wrap rev-deleted-user-contribs message in history-user-removed class

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

Hi! I'd like to work on this task. I'm reviewing the previous patches and will investigate the remaining work needed.

I investigated the current master branch and found that the older DeletedContribsPager::formatRevisionRow() implementation mentioned in the task description no longer exists. The remaining use of <strong> for rev-deleted-user-contribs is in SpecialContributionsLine.mustache.

I updated it to use <span class="history-user-removed"> and uploaded a patch for review:

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1303615

Change #1303615 had a related patch set uploaded (by Pushpaktiwari; author: Pushpaktiwari):

[mediawiki/core@master] T255903: Wrap rev-deleted-user-contribs message in history-user-removed class

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

Change #1240077 abandoned by Raushan 31:

[mediawiki/core@master] Replace legacy strong tags with span in Special:Contributions

Reason:

Time contraints

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