OpenRefine / OpenRefine

OpenRefine is a free, open source power tool for working with messy data and improving it
https://openrefine.org/
BSD 3-Clause "New" or "Revised" License
10.82k stars 1.95k forks source link

Improve date placeholder in Wikibase schema #6300

Open cooperzoe opened 8 months ago

cooperzoe commented 8 months ago

When I created a statement in my schema for uploading into wikidata, I found the placeholder text in the date input field to be counterintuitive; I expected to be able to fill in the date as indicated in the field but wasn't able to.

It tells me YYYY(-MM(-DD), so I thought I'd input 2024(-01(-04)) and didn't understand why I was getting an error!

Could this field be amended to the actual desired date format?

Screenshot 2024-01-10 at 8 15 55 PM
tfmorris commented 8 months ago

The convention that I'm used to is square brackets for [optional elements]. What would you suggest as a notation to help the user understand that they can enter YYYY, YYYY-MM, or YYYY-MM-DD?

cooperzoe commented 7 months ago

@tfmorris I didn't realize any part of the date was optional!

I think square brackets are one option, so it would look like this: YYYY[MM[DD]]

To me it was the dashes that were a bit confusing.

wetneb commented 7 months ago

@cooperzoe do you mean by this that the formats allowed by this input field would then become YYYY, YYYYMM and YYYYMMDD instead of YYYY, YYYY-MM and YYYY-MM-DD? Or would you only change the placeholder while keeping the supported formats identical?

I think the YYYY-MM-DD format is more standard (ISO?) than YYYYMMDD and is a prefix of how OpenRefine currently represents dates, so I would be inclined to keep support for it.

cooperzoe commented 7 months ago

I would only change the placeholder (as written), and keep the supported formats identical.

wetneb commented 7 months ago

Alright, then let's mark it as a good first issue, since it would only require changing the placeholder from YYYY(-MM(-DD)) to YYYY[MM[DD]].

ostephens commented 7 months ago

I don't mind particularly, but I'm surprised that the hyphens would be omitted from the placeholder if they are required in the data. Why not YYYY[-MM[-DD]] ?

cooperzoe commented 7 months ago

I like @ostephens's idea, but I'm not sure it's clear to new users that they can input date info if they don't have all a full date on hand.

One idea: the placeholder could read: "YYYY or YYYY-MM or YYYY-MM-DD" - though it's a bit long, if enough of the text appears I think users know to scroll sideways a bit to read it.

thadguidry commented 7 months ago

Or make the input box slightly longer to have the explanation text.

But I think the best alternative would be that these types of fields are also great for the idea of the help (?) info icon in their top right corner with hover text that appears upon hover or maybe click of the (?) info icon.

Quick example illustration:

image

I'd love our new design system to adopt some help icon like this and begin to use it in places.

cooperzoe commented 7 months ago

I am wondering if making the box longer is possible - @wetneb, are there any constraints on that from the Wikidata POV?

I like @thadguidry's suggestion to add clickable info icon - we do have one in the design system currently. (Going forward, I'd like to make the image a bit more contemporary, but am also wary of keeping design changes consistent across OpenRefine.)

Screenshot 2024-02-28 at 6 01 52 PM