Page MenuHomePhabricator

Special:NewPagesFeed should not highlight AFC drafts red
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
Novem_Linguae
Dec 7 2022, 7:21 AM
Referenced Files
F35935584: image.png
Jan 1 2023, 5:36 AM
F35935590: image.png
Jan 1 2023, 5:36 AM
F35935581: image.png
Jan 1 2023, 5:36 AM
F35935579: image.png
Jan 1 2023, 5:36 AM
F35935504: T324645.png
Jan 1 2023, 2:33 AM
F35843930: image.png
Dec 7 2022, 7:23 AM
F35843921: image.png
Dec 7 2022, 7:21 AM
F35843916: image.png
Dec 7 2022, 7:21 AM

Description

Steps to replicate the issue (include links if applicable):

What happens?:

image.png (159×470 px, 8 KB)

What should have happened instead?:

image.png (144×475 px, 7 KB)

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • For drafts, the user submits it for review when they are ready. So there is no need to discourage immediate reviewing. The user telegraphs that they are done editing by clicking the submit button.
  • Can turn off the red highlighting for all 4 draft states. None of these benefit from a red highlight, imo.

image.png (350×458 px, 16 KB)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Greetings!!
I am new here. So for the very first contribution I need some guidance. I want to work on this issue. Please help me get started.

Greetings!!
Could you please guide me to the target file where the changes are supposed to be made?

Greetings!!
Could you please guide me to the target file where the changes are supposed to be made?

I think that file would be modules/ext.pageTriage.views.list/ext.pageTriage.listItem.underscore, (for a tutorial on how to make changes, take a look at Gerrit/Tutorial) however, I am not a developer for PageTriage, maybe @TheresNoTime or @Novem_Linguae might be able to guide you better.

When trying to figure out what HTML needs to be modified, a good trick is to open the page in a browser, then right click -> inspect. Take a peek at the classes. Then search the codebase for it.

In this case, mwe-pt-new-article-warning is the class we want. So @Soda is correct above, modules/ext.pageTriage.views.list/ext.pageTriage.listItem.underscore is the file that needs to be modified. You probably need to add a second condition to this line: if ( article_age_in_minutes <= new_article_warning_minutes ) {

Did you get PageTriage working on localhost OK? You'll need that to properly test your patches. Let me know if you need help with that.

Hi @Novem_Linguae

Added a second condition by removing class:mwe-pt-new-article-warning which turns off red highlighting.

T324645.png (326×1 px, 35 KB)
Is it okay now? If yes, please guide me through the next steps.

@Sushrith_Bogi Next step is to test your fix locally (set up a mediawiki with pagetriage installed on localhost, and with your changed code) and make sure it works.

Next step after that is to upload it as a patch to Gerrit. Uploading patches to Gerrit if you've never done it is pretty hard. Here's a tutorial that will hopefully help: https://www.mediawiki.org/wiki/Gerrit/Tutorial

After your code is uploaded to Gerrit, then it will be easier for people like me to load your code locally and test it, and offer feedback. We'll do some back and forth feedback in Gerrit, then it'll eventually get approved (+2'd as we call it)

@Novem_Linguae I set up the mediawiki and installed pagetriage extension through following the steps in pagetriage. Could you please guide me how to test my fix locally.

In addition to the normal setup of mediawiki and pagetriage, also add this to your LocalSettings.php file to turn on "Articles for Creation" in Special:NewPagesFeed

	$wgExtraNamespaces[118] = 'Draft'; // enable AFC
	$wgPageTriageDraftNamespaceId = 118; // enable AFC

Then create an account without permissions, log in, and create one article in mainspace, and one article in draftspace (prefix Draft:)


Then go to Special:NewPagesFeed. Click the radio button for "New Page Patrol".

image.png (142×621 px, 9 KB)

You should see something like

image.png (99×387 px, 4 KB)

You should NOT see something like

image.png (67×353 px, 3 KB)


Then go to Special:NewPagesFeed -> "Articles for Creation"

image.png (125×600 px, 8 KB)

If your fix worked, you should see something like

image.png (67×353 px, 3 KB)

If your fix didn't work, you should see something like

image.png (99×387 px, 4 KB)

@Novem_Linguae I added
` $wgExtraNamespaces[118] = 'Draft'; enable AFC
$wgPageTriageDraftNamespaceId = 118;
enable AFC`
to my LocalSettings.php and created an account.

Could you please guide where and how should I create an article.

You can just create the following:

  • Article title "Test", wikitext "Test"
  • Article title "Draft:Test", wikitext "Test"

Change 874823 had a related patch set uploaded (by Novem Linguae; author: NovemLinguae):

[mediawiki/extensions/PageTriage@master] Special:NewPagesFeed should not highlight AFC drafts red

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

Change 874823 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] Special:NewPagesFeed should not highlight AFC drafts red

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

MPGuy2824 moved this task from Waiting for enwiki deploy to Done on the PageTriage board.