When the user selected multiple task types, the results should be interleaved (first result is from type 1, second from type 2 etc) but that seems to be done in a weird reverse fashion, with the result sets "right-aligned" (e.g. if result set 1 is X, Y, Z and set 2 is A, B, C, D, E then the final task list should be X, A, Y, B, Z, C, D, E but actually it is A, B, X, C, Y, D, Z, E).
|mediawiki/extensions/GrowthExperiments : master||Preserve result ordering when using the growthtasks API as a generator|
|mediawiki/extensions/GrowthExperiments : master||RemoteSearchTaskSuggester: improve unit test for interleaving|
@Tgr -- this looks like it's working in beta, thanks! I have a question about the exact logic. When there are two task types selected, it alternates them. When there are three, it doesn't exactly alternate them like A, B, C, A, B, C. It looks like the user does get about a third of each on average, but what is the exact logic? Or is there some randomness? (which would be fine).
We discussed this in the standup, but for the record, the code should alternate exactly, if it doesn't, that's a bug; but given that loading the next card can be slow and the navigation arrows are not disabled while the card loads, it's currently easy to accidentally skip tasks.
(Also, for now we filter out protected pages on the client side, so whenever that happens, there will be a gap, ie A followed by C. But that should be rare, affected something like 1% of the tasks in my tests. Eventually we'll probably move filtering to the server side and the issue will disappear, but it's considered low priority.)
If we do want some randomness, or different behavior, it would be easy to add (now that the bug with the client-side order not reflecting the TaskSuggester ordering has been fixed).
Checked in betalabs - the logic for alternating articles based on difficulty filter seems to be working as intended. .
There are some cases where the logic seems to be skewed (it could be the cases only for betalabs)
@Tgr - please review these two cases and if they seem ok, I''ll move the task to PM column.
(1) Easy -"Add links" is selected and it fetches only 33 articles and Hard - "Expand short" filter is selected which fetches only 16 articles. In this case, first 16 articles will be alternating, and remaining 33-16 Easy-"Add links" articles will be displayed in uninterrupted sequence, of course.
(2) If two Easy filters ("Copyedit" and "Add links between articles" ) are selected and only one of Medium filters ("Find references") - the set results for both groups will be 200 articles, but the fetched results will be:
"Copyedit", "Add links between articles" , "Find references" -> Easy, Easy, Medium.
So Easy edits will be over-represented comparing to Medium edits.
(3) Couple of strange cases (no reproducible steps, will do more testing)
- the counter of articles in the result set suddenly skips some counts (e.g. #4 article gets skipped)
- all filters are deselected and the label on the article card displays 'Select a filter;, but the card still displays an article.