wiki.techinc.nl/tests/phpunit/includes/Navigation
Bartosz Dziewoński cfd6ffe7bb Introduce PagerNavigationBuilder for making pagination links
We had several implementations of almost identical paging links:

* PrevNextNavigationRenderer: The nicest one, somewhat recently added
  (4ca72763ec). Unfortunately it was also the least featureful: only
  supporting paging by numeric offset and not by index, and not able
  to generate "first"/"last" links. Also, I didn't realize that it
  exists when working on 94553a1bcb and b95d208340, so it was missing
  those changes too.

* IndexPager/ReverseChronologicalPager/AlphabeticPager: These have
  been here forever. The most featureful, but not configurable, so
  a large part of the implementation was copy-pasted in two classes.

* SpecialWhatLinksHere: Through some accident of history, this one
  special page ended up with its own implementation???

They are all replaced to use the new PagerNavigationBuilder.
It may be slightly too much, but I had fun writing it.

Notable changes compared to PrevNextNavigationRenderer:
* Adds <div class="mw-pager-navigation-bar"> wrapper around the
  navigation and <span class="…"> wrappers on inactive links
* The current limit link is made inactive
  (like the "prev" link when on first page, etc.)

Notable changes compared to ...Pager/...Pager/...Pager:
* Does not generate useless tooltips that contain only the
  title of the page, can use custom tooltips
* The current limit link is made inactive
  (like the "prev" link when on first page, etc.)
* All links have query parameters in a consistent order:
  ?title= &... &dir= &offset= &limit= (some of them are optional)

These changes affect many special pages and actions. I tested on:
* Special:Contributions (ReverseChronologicalPager)
* action=history (ReverseChronologicalPager)
* Special:Categories (AlphabeticPager)
* Special:WantedPages (PrevNextNavigationRenderer)
* Special:Search (PrevNextNavigationRenderer)
* Special:WhatLinksHere

Bug: T308364
Change-Id: Ic75bd597b210e14612ca3aebb531b659897e8294
2022-09-05 16:10:36 -04:00
..
PagerNavigationBuilderTest.php Introduce PagerNavigationBuilder for making pagination links 2022-09-05 16:10:36 -04:00
PrevNextNavigationRendererTest.php Introduce PagerNavigationBuilder for making pagination links 2022-09-05 16:10:36 -04:00