[go: nahoru, domu]

Page MenuHomePhabricator

[L] Improve the date field in describe step of upload wizard
Closed, ResolvedPublic

Description

This task is part of improving the describe step of the Upload Wizard on Commons T358765.

As part of this ticket we will be making some improvements to the date of creation field such as simplifying the input, using EXIF data as a starting point and provide guidance to the user.

Link to UI
  • Replace the grouped button with a single button to access the calendar as shown in the UI
  • The text input is always editable even after the user has selected a date from a date component. (Added June 28)
  • If the file is ‘own work’ and has a date in the EXIF show that date in the date field by default with a message as shown here
  • If the file is ‘not own work’ do not use the date in EXIF to pre-fill the date field
  • Tapping on calendar icon shows the existing calendar widget where users will be able to choose a date
    • The format of the date will be displayed in input box will be the same as what shows in wikitext (Added June 28)
  • If the user picks a date in the future show the error message as shown here
  • Allow users to enter their own date or time period in the input box.
  • When the user is typing the date, check if the format is a valid format that we can copy to SD if not show the message as shown here (Updated June 28)
    • If the user choses a date from the calendar widget remove the above message and replace the previously typed input with date selected.
    • If we detect that the user has typed the valid full date then remove the above message (Added June 28)
  • If the user proceeds without entering the date show the error message as shown here
  • Attempt to automatically convert the entered date into a format suitable for structured data. If that conversion fails, only include the date in the wikitext.
  • "Copy information to other uploads" continues to work

Event Timeline

Just FYI, currently the second button (the pencil icon) allows users to enter a text-based date, which could be useful in cases where we know only partially the date (i.e. only the year of publication). Just checking if we got this use case considered too.

+1 to @Sannita - worth looking at the wikidata date interface for this (see https://www.wikidata.org/wiki/Help:Dates)

Oh, one other thing - I think we should make sure to record this directly into the inception structured data property as well as into the date field in Template:Information

@Sannita the text input is editable so users can enter partial dates.

@Cparle would those properties allow for storing partial dates? Also feel free to add the structured data property we want to add this to in the acceptance criteria in description

Yes, but it's more involved than just storing text like "between 1801 and 1805" - instead we'd have store the data "1800 CE" with precision 8 (meaning precision at the level of decades) and then add the qualifiers earliest date: 1801 and latest date:1085

MarkTraceur renamed this task from Improve the date field in describe step of upload wizard to [L] Improve the date field in describe step of upload wizard.Apr 17 2024, 4:40 PM
mfossati changed the task status from Open to In Progress.May 30 2024, 10:10 AM
mfossati claimed this task.

Change #1041681 had a related patch set uploaded (by Marco Fossati; author: Marco Fossati):

[mediawiki/extensions/UploadWizard@master] Describe step: improve the date field

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

@Cparle - There is a bunch of code already written for translating dates into Wikidata inception datetimes. See:
https://github.com/multichill/toollabs/blob/40bb7b9b838998d7ac1479d045914dcaab642847/bot/wikidata/rkdimages_importer.py#L414
https://github.com/multichill/toollabs/blob/40bb7b9b838998d7ac1479d045914dcaab642847/bot/wikidata/artdatabot.py#L538
It's all Python, but the important parts are just RegEx and complicated if/else trees. Hopefully some of the logic could be translated.

Thanks @Nosferattus - there's already a wikidata api endpoint for this, so I we're planning to use that

Change #1041681 merged by jenkins-bot:

[mediawiki/extensions/UploadWizard@master] Describe step: improve the date field

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

cc @Etonkovidova

The following AC messages are missing

  • If the file is ‘own work’ and has a date in the EXIF show that date in the date field by default with a message as shown here
  • If the user proceeds without entering the date show the error message as shown here

cc @Etonkovidova

The following AC messages are missing

  • If the file is ‘own work’ and has a date in the EXIF show that date in the date field by default with a message as shown here
  • If the user proceeds without entering the date show the error message as shown here

Yes, I noticed that too. I filed T369324: [beta] UploadWizard - saving empty Date filed triggers TypeError which might be an indication of why an error/warning messages are not displayed.

For @Sneha review:

  • I re-checked after T369324 was fixed and the following spec is done:
  • If the user proceeds without entering the date show the error message as shown here
  • the spec about giving a warning that the date is EXIF is still not present:
  • If the file is ‘own work’ and has a date in the EXIF show that date in the date field by default with a message as shown here
  • (a minor note) the placeholder text from the figma mockup is not present. The "Select a date" placeholder text is consistent with the placeholder text that is in production now.
figmacommons betaproduction commons wmf.12
Screen Shot 2024-07-05 at 3.34.43 PM.png (404×1 px, 62 KB)
Screen Shot 2024-07-05 at 9.36.01 AM.png (696×1 px, 101 KB)
Screen Shot 2024-07-05 at 3.42.03 PM.png (386×1 px, 58 KB)

@Etonkovidova Thanks.
@mfossati I am moving this back to doing as we have one AC missing

@mfossati I am moving this back to doing as we have one AC missing

@Sneha I think this will be addressed by https://gerrit.wikimedia.org/r/c/mediawiki/extensions/UploadWizard/+/1051758, is that right @matthiasmullie ?

Checked on commons wmf.13 - all specs seem to be in place. The additional refinements will be addressed in T369746.