Page MenuHomePhabricator

If you browse subcats, don't show articles
Open, LowPublicFeature

Description

This saves some queries and is more user friendly:

If user navigates via "(previous 200) (next 200)", don't show the other sections. I'm not talking about "from"...

Background: If the user browses through e.g. the list of subcats, he doesn't care much about the images atm. If he wants to see everything again he can click "catgeory" in the upper left.

Example without image gallery section:

public function getHTML() {

		global $wgOut, $wgContLang, $wgRequest;
		wfProfileIn( __METHOD__ );

		$this->clearCategoryState();
		$this->doCategoryQuery();
		$this->finaliseCategoryState();

		$subcatfrom  = $wgRequest->getVal( 'subcatfrom' );
		$subcatuntil = $wgRequest->getVal( 'subcatuntil' );
		$pagefrom    = $wgRequest->getVal( 'pagefrom' );
		$pageuntil   = $wgRequest->getVal( 'pageuntil' );

		$r = '';

		if (!isset($pagefrom) &&!isset($pageuntil))   {
			$r .= $this->getSubcategorySection();
		}

		if (!isset($subcatfrom) && !isset($subcatuntil)) {
			$r .= $this->getPagesSection();
		}

...


Version: 1.17.x
Severity: enhancement

Details

Reference
bz29586

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:34 PM
bzimport set Reference to bz29586.
bzimport added a subscriber: Unknown Object (MLST).

Can you provide this as a proper patch please?

Sorry. Never used patches before. Can you recommend a tool for creating them?

I personally don't think this is a good idea from a usability prespective.

(In reply to comment #2)

Sorry. Never used patches before. Can you recommend a tool for creating them?

[[diff]] is the general tool. The easiest way is to do an svn checkout of mediawiki, edit the file, then run svn diff. There's probably fancy gui front ends to all that as well if you prefer those. Also per coding conventions, one shouldn't use isset to check for nulls, but do if ( $f === null ) type checks.

Thanks for the null hint.

I do think it's user friendly.

http://commons.wikimedia.org/wiki/Category:Mountains_of_Tyrol

Click next 200 images. Why scroll below the 200 subcats A-S and below the 2 pages? Why load those again at all when I actually want to see images 201-400?

I'm just concerned someone might hit next 200 images, and then want to see subcats, and won't be able to figure out where the other stuff went.

What about making the next 200 link for images link to http://commons.wikimedia.org/w/index.php?title=Category:Mountains_of_Tyrol&filefrom=Kogelsee.JPG#mw-category-media instead so it goes directly to the section (and similar for other sections)?

The anchor would be a bit more user friendly, sure.

But I'd like to save CPU load wherever I can, esp. for non-cached stuff like category browsing. And seen this way loading all section while obviously browsing one oarticular section seems like a big waste.

Proviously there was only 'from' and 'until'. Now we got those per section. I have hard-coded this already, so I don't care much if MW applies it.

I did the target thing in r90815. I'll leave this bug open though in case anyone else has any thoughts on just not showing those sections (since the target thing is not what this bug was about)

But I'd like to save CPU load wherever I can, esp. for non-cached stuff like
category browsing. And seen this way loading all section while obviously
browsing one oarticular section seems like a big waste.

While personally I'd suggest just caching category pages (via squid caching or HTML caching) if your concerned about that - although I guess that doesn't get logged in folks. I'd be surprised if it actually saved enough to be worthwhile to not show those sections just for performance reasons.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:00 AM
Aklapper removed a subscriber: wikibugs-l-list.