Page MenuHomePhabricator

[L] Add UI support for time (date) Wikibase datatype for top-level statements and qualifiers
Closed, ResolvedPublic

Description

User story: As a uploader, I want 'time' support, so that I can specify the exact time the image was created/uploaded/etc

We have this:
On the front-end, we currently only support statements which take as their input Wikidata entities or quantities

We want this:
We should support time input.

The minimum requirement is just to be able to enter a date and time, without precision and without calendar.

The plan is to release this to beta/test and then to see if the community is ok with it without precision and calendar. We may have to do more work to include those if they don't think this is useful without those (will be another ticket)

See comments on T227112 for design input on the UI

Acceptance Criteria:

  • Users can add/edit/view date-and-time for statements that have 'time' values using the Commons UI
  • Users can add/edit/view date-and-time for qualifiers that have 'time' values using the Commons UI
  • on File page and in UploadWizard

Event Timeline

Reedy renamed this task from Add UI support for time Wikibase datatype for top-level statements to Add UI support for time Wikibase datatype for top-level statements.Sep 4 2019, 4:25 PM

I would be happy to start without timezone support because currently we're not including that data either (we just assume local time). We do need a higher precision than just the date. Take for example https://commons.wikimedia.org/wiki/File:%22_Tomb_of_Sher_Shah_Suri_%22.jpg . Here it's relevant that it's taken at "16:52:56" because it's an indication of the time of the day. In the future I probably want to query for images of a certain location taken during the gold hour (https://en.wikipedia.org/wiki/Golden_hour_(photography)). If I recall correctly, the precision is in the configuration somewhere so could probably just be changed for Commons.

AnneT renamed this task from Add UI support for time Wikibase datatype for top-level statements to Add UI support for time Wikibase datatype for top-level statements and qualifiers.Dec 10 2019, 5:51 PM

@Cparle to clean up Acceptance Criteria and add [L] to reflect estimation

Cparle renamed this task from Add UI support for time Wikibase datatype for top-level statements and qualifiers to [L] Add UI support for time Wikibase datatype for top-level statements and qualifiers.Dec 10 2019, 6:02 PM
Cparle updated the task description. (Show Details)
Cparle updated the task description. (Show Details)
Multichill renamed this task from [L] Add UI support for time Wikibase datatype for top-level statements and qualifiers to [L] Add UI support for time (date) Wikibase datatype for top-level statements and qualifiers.Jan 4 2020, 9:52 PM

Change 567125 had a related patch set uploaded (by Matthias Mullie; owner: Matthias Mullie):
[mediawiki/extensions/WikibaseMediaInfo@master] [WIP] Implement support for time datavalue

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

Patch is in code review.


Here are a few screenshots to confirm with design:

Initial (empty) input field:

Screenshot 2020-02-03 15.04.44.png (262×1 px, 17 KB)

Once user starts typing time. the thing will expand to display the formatted version & allow precision & calendar to be overwritten (pretty much exactly like currently on Wikidata)

Screenshot 2020-02-03 15.05.00.png (494×1 px, 60 KB)

Example of changing precision (which also affects the formatted version of the data, no longer showing the day)

Screenshot 2020-02-03 15.05.09.png (498×1 px, 59 KB)

After clicking "add", the time statement is rendered like all others.

Screenshot 2020-02-03 15.05.18.png (506×1 px, 50 KB)


And here's what things look like for qualifiers. Basically just the same thing:

Screenshot 2020-02-03 15.05.54.png (624×1 px, 77 KB)

Screenshot 2020-02-03 15.06.07.png (860×1 px, 122 KB)

Screenshot 2020-02-03 15.06.17.png (458×1 px, 61 KB)

Update after design feedback: checkboxes are gone & dropdowns always active. They'll automatically update with what's inferred from time input, until something else is manually selected.

3.png (436×1 px, 46 KB)

Screenshot 2020-02-13 11.56.14.png (276×1 px, 40 KB)

Ah. This perhaps creates a new problem - no explanation of what the dropdowns are. 😸 Can we just have "precision" and "calendar" labels without checkboxes? [I know you sent some sample images of your intent to the Slack on Thursday, but I was out and just saw them now. Sorry. This is why I don't take breaks.]

Update after design feedback: checkboxes are gone & dropdowns always active. They'll automatically update with what's inferred from time input, until something else is manually selected.

3.png (436×1 px, 46 KB)

Screenshot 2020-02-13 11.56.14.png (276×1 px, 40 KB)

Note: As shared in the design review a few weeks ago with @Ramsey-WMF, the primary progressive button representation is meant to only be used for one most important action per view.
“Add” should be a progressive button instead.

Thanks. We're planning to have that change ready in the next batch of updates.

Note: As shared in the design review a few weeks ago with @Ramsey-WMF, the primary progressive button representation is meant to only be used for one most important action per view.
“Add” should be a progressive button instead.

Change 574140 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Remove "primary" class from input widget "Add" buttons

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

Just submitted a patch that removes the "primary" class from the "Add" button in the String, Quantity, and GlobeCoordinate input widgets. Here's an example of how it looks just as a "progressive" button, in a QuantityInputWidget:

Screen Shot 2020-02-21 at 7.19.15 PM.png (876×1 px, 85 KB)

Interesting, that also uncovers an issue with this widget combination – double border. Will look if we have to tackle this in context or upstream.

Change 574140 merged by Eric Gardner:
[mediawiki/extensions/WikibaseMediaInfo@master] Remove "primary" class from input widget "Add" buttons

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

Change 567125 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Implement support for time datavalue

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