Page MenuHomePhabricator

Integrate 'Time Period Selector' into the new filters for edit review
Closed, ResolvedPublic8 Story Points

Description

The Time Period Selector enables users to select how far back in time they wish Recent Changes to search.

Time Period Selector Functions

  • The selector is accessed by means of a button visible on the main interface. The button shows the currently selected timer period, along with a calendar icon and a downward-facing arrow.
  • Clicking the button opens a menu that lists:
    • "Recent hours", with the following choices: 1, 2, 6, 12
    • "Recent days", with the choices: 1, 3, 7, 14, 30
  • When the user makes a selection, the following things happen:
    1. In the menu, the selection remains highlighted in blue
    2. The top-level button label changes to reflect the new selection (e.g., "7 days" changes to "2 hours").
    3. The search results update to implement the new parameter.

Design details

Layout guidelines are shown below:

For the icon we can use the standard "calendar" icon from the icon repo even though that differs a bit from the one used in the mockups.


(This ticket does not include support for custom period selection, which is just kept for future reference in T162784#3330522 )

Event Timeline

Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptApr 12 2017, 9:41 AM
Pginer-WMF renamed this task from Integrate time period selection in the new filters for review to Integrate time period selection in the new filters for edit review.Apr 12 2017, 9:47 AM

Following up on our discussions the other day, I talked to James about the use cases we might try to cover. He sees three:

  1. People methodically checking all edits--along the lines of what Timo showed us. They want to step through and see everything.
  2. People opportunistically cutting in and reloading. This is pretty much what is accommodated now, with both page reload and the "Show new changes starting from..." function.
  3. Auto-update people. He named two types: People who want to just keep an eye on something as it flows past, like James, who might want to monitor the stream of Visual Editor edits. Or people who like vandalism patrollers, who want to catch things as they happen and who, on a busy wiki, might use very restrictive filters.
Catrope set the point value for this task to 8.
Catrope added a subscriber: Catrope.

Note that setting a "to" timestamp is not currently supported in the backend, but everything else is: you can already set arbitrary "from" timestamps, which is enough to implement everything here except the "to" timestamp feature.

Pginer-WMF updated the task description. (Show Details)May 25 2017, 10:36 AM

Note that setting a "to" timestamp is not currently supported in the backend, but everything else is: you can already set arbitrary "from" timestamps, which is enough to implement everything here except the "to" timestamp feature.

Funnily enough, we have two related parameters -- 'days' and 'from'. Initially, I thought we couldn't do "hours" but we could if we calculate it into the "from" field. Which, ironically, we could also use for the "days" (just calculate further out?)

So, @Catrope, technical question -- we should definitely respect the 'days' parameter on load, but do we actually need to use it in the system, or should we output 'from' with the proper timestamp for all time intervals (hours/days/month/etc) ?

jmatazzoni updated the task description. (Show Details)

Saved for Phase 2—Custom Time Period Selector

Roan says that the custom time period selector will be a job of work and requests that we split this job off and save for later (he knows it's already on the contributions page). Because @Pginer-WMF put time into documenting this function, I'm copying his specs below, for later use.

In order to support other review patterns such as backlogs, it may be useful to allow setting a custom range:

The custom range selection provides two date input elements to define the range.

  • As soon as the "from" date is set, the "to" date will default to "today" having an initial range for the user to adjust if needed.
  • The calendar widget should reflect both, the current selection and the range.
  • The custom selection can be cancelled by clicking an "x" (available when the selection is active) or by selecting a default value from the quick options above.

Check this prototype for more details.

Layout guidelines are shown below:

jmatazzoni renamed this task from Integrate time period selection in the new filters for edit review to Integrate 'Time Period Selector' into the new filters for edit review.Jun 7 2017, 10:41 PM
jmatazzoni updated the task description. (Show Details)
Pginer-WMF removed Pginer-WMF as the assignee of this task.Jun 8 2017, 12:55 PM
Pginer-WMF updated the task description. (Show Details)
Pginer-WMF removed a project: Design.

Change 360385 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] [wip] RCFilters: Add 'limit' and 'days' parameters with hidden group

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

Change 361186 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] [wip] RCFilters: Add range group filters - limit and days

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

Change 360385 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Add 'single_option' group type

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

So, @Catrope, technical question -- we should definitely respect the 'days' parameter on load, but do we actually need to use it in the system, or should we output 'from' with the proper timestamp for all time intervals (hours/days/month/etc) ?

days=5 and from=<5 days ago> are not the same. They are equivalent right now but one is relative while the other one is absolute. If I open a filter I've saved a week ago they don't mean the same thing anymore.

Of course you could save days in the filters and translate it to from every time you query but that seems unnecessary since the server supports days and could very easily support hours.

Mooeypoo added a comment.EditedJul 14 2017, 3:58 PM

So, @Catrope, technical question -- we should definitely respect the 'days' parameter on load, but do we actually need to use it in the system, or should we output 'from' with the proper timestamp for all time intervals (hours/days/month/etc) ?

days=5 and from=<5 days ago> are not the same. They are equivalent right now but one is relative while the other one is absolute. If I open a filter I've saved a week ago they don't mean the same thing anymore.
Of course you could save days in the filters and translate it to from every time you query but that seems unnecessary since the server supports days and could very easily support hours.

Yeah I realized that after I asked... This commit only implements the 'days' parameter (and the 'limit', which are in the same commit, despite being two different tasks) but we'll have to come up with a way to support the "from" in the UI, and then add 'hours' to the backend.

By the way, since 'days' supports fractions, we could probably get away with doing days=0.25 or smething like that, instead of having an extra parameter for 'hours'. If we do have 'hours' as a separate parameter, we'll have to figure out how to choose if we get a URL with both days=X and hours=Y...

Or what do we do if we get hours=24. Do we convert to days=1? And vice versa...

It might be easier to just keep days=X as the parameter, but have the UI say "Hours" and give "days" a fraction....

Change 365536 had a related patch set uploaded (by Mooeypoo; owner: Mooeypoo):
[mediawiki/core@master] RCFilters: Add 'hours' to UI range picker

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

Change 365536 abandoned by Mooeypoo:
RCFilters: Add 'hours' to UI range picker

Reason:
Squashed into parent

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

Change 361186 merged by jenkins-bot:
[mediawiki/core@master] RCFilters: Add range group filters - limit, days and hours

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

Etonkovidova added a subscriber: Etonkovidova.EditedJul 19 2017, 10:31 PM

@Mooeypoo @jmatazzoni
Questions:
(1) Are we discarding user preferences for Recent changes-'Days to show in recent changes' and 'Number of edits to show in recent changes, page histories, and in logs, by default' ?
Filed as T171202: 'Display options' from Recent changes User preferences are not displayed with 'Time Period Selector' and 'Number of Changes Selector'

Right now these user preferences are working on RC but with new selectors the selection is not displayed to users.

(2) 'Recent hours' selection is not working yet? The range of the hours displayed (from the screenshot below my the range is about 17 hours) and it is unchanged even if I select just 1 hour.

(3) Some extra whitespace is displayed above the date - see the screenshot above.

In T162784#3454711, @Etonkovidova wrote:

(2) Are we discarding user preferences for Recent changes-'Days to show in recent changes' and 'Number of edits to show in recent changes, page histories, and in logs, by default' ?

The short answer is that we do need to observe preferences (unless the user has overridden preferences by setting a Saved Filters default). There are two issues here:

  1. If users set their preference to one of the options we already offer, we should conform with that setting.
  2. If users set their preference to a number we don't offer—including random numbers like 23 or 254—then we should do more or less what the system does now: 1) add that number to the available options list and 2) select it.

Re. #2, I have some questions:

  • The system currently doesn't appear to stop me from putting in numbers higher than 500 for # of results. I just put in 575 and 1200, and it appears to have executed both.
    • Is there an actual, though unstated, limit? (If so, we should at least state it.). There is clearly a stated limit for # of days (30).
    • Should we impose a limit? Is there, for example, a practical performance or usability limit? Remember that in the new Preferences system, the Pref page control will govern Watchlist, Logs, Contributions and History as well. Or is that a bad idea?
  • Where should we put any free-form numbers in the menu?. There are three choices: 1) just pick a spot at either end, left or right; or 2) insert the number where it would go numerically in the lineup. I don't actually care which we choose. There is room for another square on the menu, I see.
Mooeypoo added a comment.EditedJul 20 2017, 7:32 PM

I'll take a deeper look at the rest of the questions, but regarding the free form input, if anyone fills in the URL (and when I implement listening to the preference it will act the same) with some number, that number is inserted in order to the list of current options. You can try that by changing days= parameter in the URL to some custom number. If you use fractions, like days=0.01 it will translate to hours and place them in order.

Iirc this is the way things work in the nojs version too.

In T162784#3457592, @Mooeypoo wrote:

If anyone fills in the URL (and when I implement listening to the preference it will act the same) with some number, that number is inserted in order to the list of current options. ....If you use fractions, like days=0.01 it will translate to hours and place them in order.

Works for me. Good job! So we just need to make it do the same based on the preference setting.

Change 367626 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/core@master] SpecialRecentchanges: Handle ?days= parameter more sanely

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

Change 367626 merged by jenkins-bot:
[mediawiki/core@master] SpecialRecentchanges: Handle ?days= parameter more sanely

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

Change 367626 merged by jenkins-bot:
[mediawiki/core@master] SpecialRecentchanges: Handle ?days= parameter more sanely
https://gerrit.wikimedia.org/r/367626

Since you're looking at this code, might be able to give this lower priority tech-debt/bug a shot:
T149890: Fatal error on Special:Recentchanges when days=800000 or higher

Since you're looking at this code, might be able to give this lower priority tech-debt/bug a shot:
T149890: Fatal error on Special:Recentchanges when days=800000 or higher

Done. A well-executed nerd snipe, chapeau.

Krinkle removed a subscriber: Krinkle.Jul 26 2017, 10:58 PM

The 'Hours' selection is working now. The issue T171202: 'Display options' from Recent changes User preferences are not displayed with 'Time Period Selector' and 'Number of Changes Selector' has not been fixed yet (and it's already present in wmf.11).

QA Recommendation: Resolve

I recall this being mentioned, but I saw it was not solved (ignore if it is in a patchset not deployed yet).

Time panel seems to open to the left side of the button:

It should open to the right, as captured in the mockups above:


The same happens with the "show last X changes" menu.

jmatazzoni closed this task as Resolved.Jul 28 2017, 3:32 PM

Closing this. @Pginer-WMF it looks like the number of results selector is going left as well. I will close this. Can you file a new ticket to fix those display issues?

Closing this. @Pginer-WMF it looks like the number of results selector is going left as well. I will close this. Can you file a new ticket to fix those display issues?

Sure. Here it is: T171968: Number of results and time selector show their menus on the wrong side