Page MenuHomePhabricator

Special:NewPagesFeed "That" menu does not mark the current radio button as "checked"
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:

  • "Show all" is not checked

image.png (1,436×954 px, 101 KB)

What should have happened instead?:

  • "Show all" should be checked

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

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

  • This bug applies to all radio buttons in the "That" section, not just "Show all"

Event Timeline

Change 1009397 had a related patch set uploaded (by Maunikashekar; author: maunikashekar):

[mediawiki/extensions/PageTriage@master] Make "Show all" selected by default in filters

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

Hi @Soda, Can I immediately see the changes I make in the PageTriage extension while I apply the fix? I tend to find the termination of the container(docker-compose down) and restarting (docker-compose up) quite redundant. It takes some time before the changes reflect, this makes me feel like the changes are not implemented or are not working. Any help would be appreciated.

Note: As you have instructed, the extension is running in the MediaWiki dockerized version. I also have Echo and ORES installed as instructed in the PageTriage Installation page

Try adding ?debug=1 to the URL, which I think will bypass certain ResourceLoader caches. And/or try Ctrl-F5 hard reloading. You shouldn't need to restart your Docker container hardly ever, unless you're changing a .env variable or forcing an update of the Docker images or something.

core/extensions/PageTriage/modules/ext.pageTriage.newPagesFeed/stores/settings.js (file path)

const initState = () => {
	// Named users store params ( user-centric ) in a user option, other users store params in localStorage ( client-centric )
	const stored = mw.user.options.get( 'userjs-NewPagesFeedFilterOptions', localStorage.getItem( 'userjs-NewPagesFeedFilterOptions' ) );
	return {
		immediate: JSON.parse( JSON.stringify( defaultImmediate ) ),
		controlMenuOpen: false,
		applied: JSON.parse( JSON.stringify( defaultSettings ) ),
		unsaved: JSON.parse( JSON.stringify( defaultSettings ) ),
		// Load stored API parameters if possible, else defaults
		params: JSON.parse( stored ) || defaultParams,
		currentFilteredCount: -1,
                // this is the fix I have applied
		selected: "all",
	};
};

In this code I have set the selected field to "all" by default , there fore initializing the state of the selected v-model, this is supposed to work from my perspective , but when I review the code , drop my container and run it again , there is no changes .

Please is this fix wrong?

core/extensions/PageTriage/modules/ext.pageTriage.newPagesFeed/stores/settings.js (file path)

const initState = () => {
	// Named users store params ( user-centric ) in a user option, other users store params in localStorage ( client-centric )
	const stored = mw.user.options.get( 'userjs-NewPagesFeedFilterOptions', localStorage.getItem( 'userjs-NewPagesFeedFilterOptions' ) );
	return {
		immediate: JSON.parse( JSON.stringify( defaultImmediate ) ),
		controlMenuOpen: false,
		applied: JSON.parse( JSON.stringify( defaultSettings ) ),
		unsaved: JSON.parse( JSON.stringify( defaultSettings ) ),
		// Load stored API parameters if possible, else defaults
		params: JSON.parse( stored ) || defaultParams,
		currentFilteredCount: -1,
                // this is the fix I have applied
		selected: "all",
	};
};

In this code I have set the selected field to "all" by default , there fore initializing the state of the selected v-model, this is supposed to work from my perspective , but when I review the code , drop my container and run it again , there is no changes .

Please is this fix wrong?

I will let @Soda or @jsn.sherman reply to this one :)

core/extensions/PageTriage/modules/ext.pageTriage.newPagesFeed/stores/settings.js (file path)

const initState = () => {
	// Named users store params ( user-centric ) in a user option, other users store params in localStorage ( client-centric )
	const stored = mw.user.options.get( 'userjs-NewPagesFeedFilterOptions', localStorage.getItem( 'userjs-NewPagesFeedFilterOptions' ) );
	return {
		immediate: JSON.parse( JSON.stringify( defaultImmediate ) ),
		controlMenuOpen: false,
		applied: JSON.parse( JSON.stringify( defaultSettings ) ),
		unsaved: JSON.parse( JSON.stringify( defaultSettings ) ),
		// Load stored API parameters if possible, else defaults
		params: JSON.parse( stored ) || defaultParams,
		currentFilteredCount: -1,
                // this is the fix I have applied
		selected: "all",
	};
};

In this code I have set the selected field to "all" by default , there fore initializing the state of the selected v-model, this is supposed to work from my perspective , but when I review the code , drop my container and run it again , there is no changes .

Please is this fix wrong?

I will let @Soda or @jsn.sherman reply to this one :)

I've left comments in a gerrit review about your approach to the bug, but I will say that you should not have to restart or drop your container to see changes reflected. A page reload should be all that is required.

core/extensions/PageTriage/modules/ext.pageTriage.newPagesFeed/stores/settings.js (file path)

const initState = () => {
	// Named users store params ( user-centric ) in a user option, other users store params in localStorage ( client-centric )
	const stored = mw.user.options.get( 'userjs-NewPagesFeedFilterOptions', localStorage.getItem( 'userjs-NewPagesFeedFilterOptions' ) );
	return {
		immediate: JSON.parse( JSON.stringify( defaultImmediate ) ),
		controlMenuOpen: false,
		applied: JSON.parse( JSON.stringify( defaultSettings ) ),
		unsaved: JSON.parse( JSON.stringify( defaultSettings ) ),
		// Load stored API parameters if possible, else defaults
		params: JSON.parse( stored ) || defaultParams,
		currentFilteredCount: -1,
                // this is the fix I have applied
		selected: "all",
	};
};

In this code I have set the selected field to "all" by default , there fore initializing the state of the selected v-model, this is supposed to work from my perspective , but when I review the code , drop my container and run it again , there is no changes .

Please is this fix wrong?

I will let @Soda or @jsn.sherman reply to this one :)

I've left comments in a gerrit review about your approach to the bug, but I will say that you should not have to restart or drop your container to see changes reflected. A page reload should be all that is required.

Ok thanks I will go again.

Change #1009397 merged by jenkins-bot:

[mediawiki/extensions/PageTriage@master] Make "Show all" selected by default in filters

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