Page MenuHomePhabricator

Improve date range searches on Special:Contributions
Closed, ResolvedPublic8 Estimated Story Points

Assigned To
Authored By
DannyH
Dec 7 2015, 10:46 PM
Referenced Files
F5151276: pasted_file
Dec 24 2016, 5:28 PM
F5151280: pasted_file
Dec 24 2016, 5:28 PM
F4929662: pasted_file
Dec 1 2016, 3:23 PM
F4867867: pasted_file
Nov 27 2016, 4:54 PM
F3893692: Screen Shot 2016-04-19 at 5.42.23 PM.png
Apr 19 2016, 4:56 PM
F3888672: before.png
Apr 18 2016, 1:10 PM
F3888676: after.png
Apr 18 2016, 1:10 PM
Tokens
"Yellow Medal" token, awarded by matej_suchanek."Party Time" token, awarded by RandomDSdevel."Doubloon" token, awarded by Elitre."Like" token, awarded by MGChecker."Like" token, awarded by IKhitron."Yellow Medal" token, awarded by Quiddity."Like" token, awarded by TerraCodes."Manufacturing Defect?" token, awarded by Dalba.

Description

There is no good way to search a window of time in Special:Contributions. Currently, you can set a date but then you get from that date AND ALL earlier contribs which can be too many to sift through. It would be good to refine the date searches from Point A in time to Point B in time. As an example, we should be able to search the last three months and ONLY the last three months. Every editor and admin that hunts socks, spammers, paid editors, long term abusers, etc. would benefit from this as it allows them to refine their searches for relevance. At the present, very few editors are manipulating the search strings in the URLs to force time windows but it is very cumbersome. You add a string that matches this pattern: " ?ucstart=yyyymmddhhmmss&ucend=yyyymmddhhmmss " Please see this example of URL string manipulation and the tail end of this thread to see that folks have been looking for this. Please modify the queries and front end of this interface to have start and end dates so that we may search time windows.

⋙–Berean–Hunter—► ((⊕)) 23:26, 9 November 2015 (UTC)

This card tracks a proposal from the 2015 Community Wishlist Survey: https://meta.wikimedia.org/wiki/2015_Community_Wishlist_Survey

This proposal received 49 support votes, and was ranked #15 out of 107 proposals. https://meta.wikimedia.org/wiki/2015_Community_Wishlist_Survey/Moderation_and_admin_tools#Improve_date_range_searches_on_Special:Contributions

Progress report

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

So the main thing left to do here is review https://gerrit.wikimedia.org/r/#/c/316574/ and get it merged, right @Sn1per?

Yes, that patch should add the date range filter functionality. (Though I still need to finish up that patch to get it production-ready)

By the way, I have a feeling that a change to the Special:Contributions interface would cause quite an uproar on enwiki (and likely other WMF wikis). Would a user preference be appropriate?

Yes, that patch should add the date range filter functionality. (Though I still need to finish up that patch to get it production-ready)

Any specific pieces you could elaborate on? Anything we could help with?

By the way, I have a feeling that a change to the Special:Contributions interface would cause quite an uproar on enwiki (and likely other WMF wikis). Would a user preference be appropriate?

Please, for the sake of the children, no more preferences. This feature was the 15th most popular request on the 2015 Commuity Wishlist Survey so it may be less controversial than you think. It's also more or less backwards compatible with the previous functionality, so I don't see a good justification for making it a user preference.

Change 326459 had a related patch set uploaded (by Sn1per):
Pager class for filtering by date range

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

I still think, writing full month names as default is an improvement for users by reducing cognitive load when dealing with the widget. There seems to be enough space. Opinions?

@Volker_E: I agree, especially because month abbreviations may not be as commonly used in other languages.

As DateInputWidget gets more exposure, it's important to document how the months/dates are translated (it should use either CLDR or MediaWiki's own messages) and to make a call to action on translators-l etc. (I really hope that the moment.js locale files were only mentioned as an example: it would be disheartening if we were using that stuff, and it would not be appropriate to mix different formats/l10n on the same page.)

Current status:

pasted_file (453×824 px, 56 KB)

One thing to consider is that the calendar-popup input is extremely hard to use with a keyboard, which for many users is a downgrade of functionality compared to the current date selector.

It's also practically impossible to correctly write in a format like "Tuesday, 5 April 2016" without many guesses and it's usually very hard to change selection (if you try to manually change the number of the day, month or year, JavaScript stuff tends to freak out). So you're always a slave of the calendar popup. It helps to reduce complexity of the date format: is the day of the week really necessary?

It helps to reduce complexity of the date format: is the day of the week really necessary?

I wonder this too. We don't expose days of the week anywhere else in the UI, so why here?

As DateInputWidget gets more exposure, it's important to document how the months/dates are translated (it should use either CLDR or MediaWiki's own messages) and to make a call to action on translators-l etc. (I really hope that the moment.js locale files were only mentioned as an example: it would be disheartening if we were using that stuff, and it would not be appropriate to mix different formats/l10n on the same page.)

DateInputWidget uses moment.js to format dates (such as at https://github.com/wikimedia/mediawiki/blob/master/resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js#L376) and does use moment locale data. The other date widget (DateTimeInputWidget) seems to use its own formatter with mediawiki locale data.

I wonder this too. We don't expose days of the week anywhere else in the UI, so why here?

Both DateInputWidget and DateTimeInputWidget show the day of the week by default.

As to keyboard-friendliness, with DateInputWidget the formatted date with day of the week etc. is just a pretty display; if you want to type, you input the actual date in YYYY-MM-DD format:

pasted_file (333×464 px, 33 KB)

In contrast, DateTimeInputWidget has the user type in the same format as the display format:

pasted_file (411×482 px, 27 KB)

DateInputWidget uses moment.js to format dates

This is extremely sad and should be reported as a bug if it isn't yet (to be marked as blocker of T31235: Make MediaWiki consistent in how it displays time).

In the meanwhile, someone who knows the process should document on https://www.mediawiki.org/wiki/Manual:DateInputWidget how one can add or change data to moment.js and get the updates on MediaWiki/Wikimedia, so that Special:Contributions doesn't become untranslatable. I can then distribute the information to translators on mediawiki-i18n, translators-l etc.

Change 335230 had a related patch set uploaded (by Sn1per):
e PHP DateInputWidget in Contribs and use for range filtering

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

Change 335230 merged by jenkins-bot:
Option for DateInputWidget to display full month and day names

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

@Sn1per: Are you still working on this? It looks like the task has attracted a bit of scope creep. We should concentrate on tackling the back-end support first and then worry about the front-end UI once we have a working prototype. The prototype could even just use text input fields for now. If you feel like you're stalled, Community Tech would be happy to work on it. Just let me know.

@Sn1per: Are you still working on this?

Sorry, I've been meaning to ask a question about @matmarex's comment on https://gerrit.wikimedia.org/r/#/c/316574/ but somehow forgot to.

Code-Review-1

  • If you specify an end date, it's not possible to use the "newer 50" link to view newer revisions (the link is not active). It can be done with the current interface.

Is this a required feature (which would make the end date behave differently from the start date)? My implementation of RangeChronologicalPager uses dates to simply filter the database query used by the pager, and checking for newer revisions to use and link to via a "newer 50" link would require some more complex logic.

If it's an intentional change, it's probably okay, I just pointed out a change in behavior that was not mentioned anywhere.

@Sn1per: Can you clarify that no longer supporting "newer 50" when there is an end date is intentional (or not)?

@kaldari It was unintentional because the pager logic checks to see if the mOffset field is empty to determine whether to check for "newer 50," and my change did not use this field, which caused the pager logic to never use "newer 50." (My response to @matmarex above was inaccurate because I mixed some things up in my head) I've updated both patches to simply reuse the offset field for the end date and to add a separate condition for the start date and the pager links and offset should work as before.

Change 341741 had a related patch set uploaded (by Sn1per):
[mediawiki/core] [WIP] Make infused and non-infused DateInputWidget consistent

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

Change 341741 merged by jenkins-bot:
[mediawiki/core] Make infused and non-infused DateInputWidget consistent

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

Change 326459 merged by jenkins-bot:
[mediawiki/core@master] Pager class for filtering by date range

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

The current patch works great, although the DataInputWidget becomes completely unusable if JavaScript is disabled due to T166416. Should we wait for that bug to be fixed before we merge this?

Change 316574 merged by jenkins-bot:
[mediawiki/core@master] Use PHP DateInputWidget in Contribs and use for range filtering

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

Everything in the original checklist for this task is complete, except for:

  • Address DateInputWidget's use of moment.js for date formatting instead of MediaWiki i18n messages

That seems outside the scope of this task, so I've broken it out into a separate task: T166625.

I think the <br> between the start and end inputs should be removed. So that the "settings box" would be more compact (not a luxury), more appealing (one less line, feels less cluttered) *and* more ergonomic (one line equals one functionality, whereas breaking this rule as currently is quite disturbing).

Then, even better, the "label + associated input" parts could be made unbreakable, so that on (very small) screens there wouldn't be a line break between the "To date:" label and its associated input.

Also, the mouse pointer could be improved:

  • When the date selector is opened, the mouse over the text input should be a caret and not a hand. It would make understandable the date can be manually typed.
  • Less important, when the date selector is closed, the mouse over the text of the input (e.g. "No date selected" or a date) is an arrow, while over the rest of the input the mouse is a hand. It should always be a hand.

Just wanted to leave a comment thanking you all for creating and deploying this feature - it's been incredibly useful to me lately, something I didn't even realized I needed so badly until I had it! Thank you, thank you, thank you :)

Macro such-data:

It would increase the tool's convenience a bit for me if, when I select a date in the "from" calendar dropdown, the cursor/focus automatically switched to the "to" dropdown. Currently after clicking a "from" date, the "from" calendar remains dropped-down and focused, but fast-forwards to today's date. The behavior I expect from this type of date selection, based on using it on many other sites, is to get automatically switched to the "to" calendar after selecting a date in the "from" one - that behavior makes entering a range a more streamlined, no-extra-clicks-needed flow.

Currently after clicking a "from" date, the "from" calendar remains dropped-down and focused, but fast-forwards to today's date.

It looks like this wasn't intended. In fact, Prateek wrote a patch in 2015 to make it close (see T114942) but that code doesn't work any more because it focuses the text box after closing the calendar, and in response to the text box being focused, the calendar opens again. This appears to be a regression from https://gerrit.wikimedia.org/r/341990 (written for T159987 in March 2017). I have a fix for this, will submit it shortly.

Change 364909 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] DateInputWidget: Unbreak closing the calendar when selecting a date

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

Change 364914 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] Special:Contributions: Open "To date" widget after selecting a "From date"

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

Change 364909 merged by jenkins-bot:
[mediawiki/core@master] DateInputWidget: Unbreak closing the calendar when selecting a date

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

Change 364914 merged by jenkins-bot:
[mediawiki/core@master] Special:Contributions: Open "To date" widget after selecting a "From date"

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

Any feedback about my comment above?

I think the <br> between the start and end inputs should be removed. So that the "settings box" would be more compact (not a luxury), more appealing (one less line, feels less cluttered) *and* more ergonomic (one line equals one functionality, whereas breaking this rule as currently is quite disturbing).

Then, even better, the "label + associated input" parts could be made unbreakable, so that on (very small) screens there wouldn't be a line break between the "To date:" label and its associated input.

Change 281113 abandoned by Jdlrobson:
Allow date ranges in Special:Contributions

Reason:
Associated phabricator ticket has been resolved so this patch can now be abandoned. Thanks for attempting to solve this Sumit! I hope you are doing well!

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

Following up to my above comment, there is no longer a linebreak between the "From date" and "To date" inputs since the form has been converted to OOUI, refs T117736 :)