Page MenuHomePhabricator

Update RC page results without reloading the page (AJAX) when filters are changed
Closed, ResolvedPublic

Description

When the user changes their filter selection and clicks the "Show" button [TODO: or does something else? closes the popup maybe? or on every filter selection?] the results should update using AJAX, without reloading the page.

The URL should update too, and if the user uses the back/forward buttons to navigate between these URLs, both the filter selections and the results should update as well.

Event Timeline

Change 328676 had a related patch set uploaded (by Catrope):
[WIP] RC filters: AJAX and pushState/popState

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

Change 328676 merged by jenkins-bot:
RC filters: AJAX and pushState/popState

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

Change 328676 merged by jenkins-bot:
RC filters: AJAX and pushState/popState

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

This makes selecting and unselecting filters AJAXy, but not the Show button yet.

This makes selecting and unselecting filters AJAXy, but not the Show button yet.

T157594: Make the old parts of the new RC form work in the same, dynamic fashion as the new filters controls is basically about that bit, so I propose we consider this task done (ready for QA) and have the other task be about the Show button.

@Catrope Not sure if the following cases should be covered with the fix in this ticket or in T157594: Make the old parts of the new RC form work in the same, dynamic fashion as the new filters controls.

(1) I

  • Select 'Category changes'
  • discard 'Category changes' and select another filter
  • try to navigate back to see the results for 'Category changes' filter selection - not possible
Uncaught TypeError: controller.updateFromURL is not a function(…)
anonymous function)

(2)

  • With default filters displayed, type 'Mobile' tag in 'Tag filter', click on 'Show' - the correct result is displayed
  • Click on the browser Back button - the initial state (with default filters 'Human (not bot)', 'Page edits', 'Page creation', 'Logged actions') will be displayed but with the 'Mobile' tag in the 'Tag filter' still present. In a sense, we have two different results sets with the same UI selection.

The same is, of course, for 'Namespace' selection.

(1) is definitely a bug in the code for this task.

As for (2), let's leave that for T157594.

Moving back to Ready for Pickup to address (1)

Change 340494 had a related patch set uploaded (by Sbisson):
[mediawiki/core] RC filters: update the state of the app on popstate.

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

Checked the scenario (1)

  • no Console errors displayed
  • the browser 'Back' button will not display the results of the previous filter selection. The page with the current selection will just reload.
  • there is one case when the browser 'Back' button works: 1) select any filter 2) click on 'Recent changes' link on the left panel) 3) click on the Back button - the previously selected filter(s) will be displayed. The 'Forward' button will display the default filter selection. So, back-and -forth navigation will be going between two states: default filters and the filter(s) selection that was made before clicking on the RC link.

QA recommendation: Product should weigh in.

I'm sorry, I don't know why I moved this to "QA Review". The patch that addresses the back and forward browser buttons is not merged yet.

Change 340494 merged by jenkins-bot:
[mediawiki/core] RC filters: update the state of the app on popstate.

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

Re-checked the scenario #1 after the merge.

  1. Discard the default filters.
  2. Select 'Category changes'
  3. Discard 'Category changes' and select any of the filters.
  4. Use browser back and forth buttons - the RC page correctly displays previous results of filters' selections.

QA recommendation: Resolve.