Page MenuHomePhabricator

CheckUser should not hardcode parentheses in the HTML
Open, Needs TriagePublic

Description

The Special:CheckUser page hardcodes '(' and ')' characters in the output. This reduces the ability of a skin to style this and make this content responsive. The two offending elements are the timestamp and roles
e.g.

<li><a href="/wiki/User:DoRD" title="User:DoRD"><bdi>DoRD</bdi></a> <span><span><a href="/wiki/User_talk:DoRD" class="mw-usertoollinks-talk" title="User talk:DoRD">talk</a></span> <span><a href="/wiki/Special:Contributions/DoRD" class="mw-usertoollinks-contribs" title="Special:Contributions/DoRD">contribs</a></span></span>&rlm;&lrm; 

<!-- problem 1-->
(<a href="/wiki/Wikipedia:Edit_filter" title="Wikipedia:Edit filter">abuse filter editor</a>, <a href="/wiki/Wikipedia:CheckUser" title="Wikipedia:CheckUser">check user</a>, <a href="/wiki/Wikipedia:Oversight" title="Wikipedia:Oversight">oversight</a>, <a href="/wiki/Wikipedia:Administrators" title="Wikipedia:Administrators">administrator</a>)

<!-- problem 2-->
 (Created on 17 December 2009 at 03:32)</li>

The new way of doing this is:

<div class=".mw-changeslist-links">Created on 17 December 2009 at 03:32</div>

The visual effect is the same, but it gives skins more flexibility to style.

https://en.wikipedia.org/wiki/Special:RecentChanges, https://en.wikipedia.org/wiki/Special:Contributions and the history pages do not do this and can be used for guidance.

Related tasks

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 20 2019, 8:57 AM
Ammarpad renamed this task from CheckUser should not hardcode paranthesises in the HTML to CheckUser should not hardcode parentheses in the HTML.Oct 5 2019, 11:46 PM

Hi @Jdlrobson, I would like to work on this task but I noticed the Special:CheckUser page is a restricted page and I don't have the permission to access it. Can I still work on this?

Hey @Zaycodes you'll need to set this up locally to be able to test it and write the code so it shouldn't matter if you can view production .

Try setting up https://m.mediawiki.org/wiki/Extension:CheckUser as a first step and let me know if you run into any problems that I can help with!

Hey @Zaycodes you'll need to set this up locally to be able to test it and write the code so it shouldn't matter if you can view production .
Try setting up https://m.mediawiki.org/wiki/Extension:CheckUser as a first step and let me know if you run into any problems that I can help with!

Thanks @Jdlrobson, will work on that and get back to you

Hi @Jdlrobson, I'm trying to set up mediawiki locally but i keep getting the following error:

Undefined index: UseWindowsAuth in C:\xampp\htdocs\mediawiki-1.33.1\includes\libs\rdbms\database\DatabaseMssql.php on line 75

I need some help on this

Sounds like you are hitting bug T214055 ?

Hi @Jdlrobson, I've successfully set up mediawii locally

Congrats! Can you replicate this bug?

Ok I'll see if I can do that and get back to you if I experience any issues

hi @Jdlrobson i have set up the mediawiki locally. I want to work on this issue. please help me how should I get start.

Demian added a comment.EditedMar 1 2020, 2:57 AM

Wrapping the parenthesis and vertical line in a span with a specific class in addition to an alternative for .mw-changeslist-links would solve both, I assume.

  • It can be copied.
  • It can be hidden by skins if needed.

The class used to mark up the parts to be wrapped in parenthesis is: .mw-changeslist-links
This adds ::before , ::after pseudo-elements with a single parenthesis content:,
and .mw-changeslist-links > span:not(:first-child):before with content: ' | ';

There's also .mw-diff-bytes, .mw-uctop also wrapping in parenthesis
and mw-changeslist-separator:empty:before which adds 2 dots.

Status quo:

  • &action=history uses .mw-changeslist-links
  • Special:Log uses both .mw-changeslist-links and inline parenthesis for "thank"
  • Special:RecentChanges: .mw-changeslist-links
  • Special:Contributions: .mw-changeslist-links
  • Special:CheckUser: .mw-changeslist-links
  • more?
Demian updated the task description. (Show Details)Mon, Mar 2, 5:04 PM

hi @Jdlrobson i have set up the mediawiki locally. I want to work on this issue. please help me how should I get start.

Have you managed to get CheckUser working locally? If so can you replicate the bug being described here?

I was able to do so after adding the following to LocalSettings.php and running composer update --no-dev && php maintenance/update.php in the core folder.

wfLoadExtension( 'CheckUser' );
$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;

Once you can do that, you'll want to review the code in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/CheckUser/+/master/includes/specials/SpecialCheckUser.php#1422

Wrapping the parenthesis and vertical line in a span with a specific class in addition to an alternative for .mw-changeslist-links would solve both, I assume.

Please reuse the classes defined in core that mirror the ones used on other pages e.g. Special:RecentChanges rather than creating your own new ones. If we need to create new ones that's a sign that the code in core is not good enough and needs improving.

Thanks in advance for looking into this!