-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement date search that works intuitively with new date range fields #3285
Comments
The strict/lax setting will need to be persisted in the URL like other aspects of search parameters (but will be the first such thing that is per-field but is not a search parameter passed to LAPIS). |
@theosanderson can you explain why it needs to be persisted? For UI/UX reasons? It's just a radio button? What am I missing? |
The page is set up such that you can send the link of your current page to someone and they will see what you see (or refresh the page, or bookmark, etc.) |
Right, and that includes the exact state of the search facet widgets. To keep that up we'd need to add a field for radio state and it wouldn't be entirely unambiguous to deduce which date field has the entry. Is that a strict requirement of the code or something we could drop in that case? |
Whether this is a "field" in the conventional sense I don't think is determined? It could be a special thing, like
It would be unambiguous if we named the query param specifically per field?
We've put a fair amount of effort into this behaviour, so it would feel strange to me to give up on it now |
Sorry for being imprecise, yes that's what I meant, a URL param of some sort
I don't think so unless we decide to only surface date lower and upper search as an integrated component and not as optionally a joint one and optionally individual one. It might make sense to not allow anything but integrated, however, for simplicity. There's not that much use for combinations that are neither strict nor lax, in theory one can specify 4 combinations of (cartesian of
It would only be unambiguous if we allowed both the joint upper/lower strict/lax search type to be selecteable as well as upper/lower individually as classic date searches. If we were to only support joint mode we wouldn't actually need that new URL param, the radio button state would be encoded into the combination of: If one of How does that sound? |
I was assuming date search would continue to be a single field - I think anything else would be quite confusing.
Yes I haven't worked that through myself, but it makes sense on the face of it - sounds OK! |
Well it ceases to be single field as soon as we hit merge on the ranges :) Yeah I think I'm quite happy with the solution above, it should work. I wasn't aware of the complication of URL <-> state mapping but I think we've resolved it pretty much. |
Yep, I get it! I just think I would have defined the lax/partial overlap differently: I am just not sure about your definition of lax. There are these four overlap situations:
Intuitively I'd say: strict mean only A is accepted: The sample collection date must be in the range I search for. And for lax I'd say: B, C and D (EDIT: and of course A) are accepted: The sample might have been collected in the range I search for. You defined lax as:
but that would only include D (not even A) Now that I wrote all this, I think that might just have been a mistake on your end. Instead I guess we'd define lax as this:
If we'd go with this definition of 'lax', I'm not sure what I'd name the parameters. I hope I understood what you meant! Oh, but the general idea of it seem pretty clear to me 👍 |
not 100% sure I'm following but my thoughts, for whatever they're worth:
|
Oh yes! I'll edit that in |
@emmahodcroft if we don't have strict/lax (which I agree is an option) we still need changes to search code, and to decide which of strict or lax to use (do you have a preference?) |
Thanks @fhennig for catching my logic error, indeed the following is correct as you state:
Felix' solution of using a checkbox instead of radio works quite nicely as well, it makes lax the default (unnamed) and offers strict as an option via checkbox. The only confusion now is that the tooltip introduces "lax" as a concept but this isn't visible in the UI at all as it's the implicit default. I don't think I'm too worried about this, just pointing it out. |
Actually the default seems to be strict in Felix's PR, which makes sense to me - if you reduce the date range to 1 week, you don't (by default) want sequences with just the year specified appearing. And "not strict" is explained in a tooltip, which seems reasonable to me. |
Right, my memory was incorrect. Strict is checked by default and the unchecked version is called |
We will soon no longer have a single date field: there will be two dates for each sample instead: lower range and upper range of what the date string we got means. For complete dates, the 2 are the same. But for incomplete they aren't.
This makes search non-intuitive to users. Most users will initially not care about the concept of date ranges, they just want something that works for filtering dates somehow.
What we get instead after #3263 is two dates to filter by, and this causes cognitive strain (even to me having thought about this feature for weeks).
There's a simple way of having intuitive search: show just one date search bar with two modes (selectable through radio button):
People probably want strict to be the default, but we can change this once we know what's more intuitive. The idea to have strict and lax search is something that I haven't seen much on other websites so even this way will take some getting used to (the good thing is that people won't need to know about strict vs lax, it'll just intuitively work ok).
Implementation:
date_range
(exact names tbd, just for scoping I choose some)date_lower
andupper
, to refer to the metadata fields that should be usedrange_min
andrange_max
That's it, I hope that's clear and should be doable. Let me know if you have questions.
The text was updated successfully, but these errors were encountered: