loculus-project / loculus

An open-source software package to power microbial genomic databases
https://loculus.org
GNU Affero General Public License v3.0
34 stars 1 forks source link

Allow selection of sequences for download by ticking checkboxes in browse/search view #2247

Open corneliusroemer opened 2 months ago

corneliusroemer commented 2 months ago

This comes from our beta testers:

It would be nice to be able to checkbox-select sequences in the browse view to subset sequences for download.

Implementation wise, we could store the list of selected sequences in URL path, similar to how we allow filtering by accession. Just that in this case we only filter at the point of download not as soon as the first accession is entered.

theosanderson commented 2 months ago

The somewhat hard case to handle for this is what happens when someone wants to download all sequences for an organism which contains millions of sequences, or for a subsearch of an organism that contains milllions of sequences. (A very common requirement). Requiring the client to download a list of millions of accessions, then to reupload that list to make a download makes network requests heavier. Just storing millions of accessions in the browser has some implications for client side RAM.

theosanderson commented 2 months ago

ChatGPT estimates 10M sequences would use 477 MB of RAM in Chrome

corneliusroemer commented 2 months ago

I don't think these are reasons not to do it and there are reasonable choices we can make:

Do you see any issues with that?

I would keep it simple as a start: checking a box simply adds a sequence to a list of "selected accessions". Unchecking the box removes from it. No interaction of list with filters. Filters simply hide sequences. But don't change the state of the list.

theosanderson commented 2 months ago

Hmm. I can't think of a UI experience that I'm aware of which has check boxes and yet downloads everything when none are ticked - if I saw checkboxes I would assume that downloading would not download anything if they are unchecked. I suppose updating the text on the button to "Download all" would help, but I think users will expect to see a "tick all" checkbox above the top checkbox.

theosanderson commented 2 months ago

And having filters not affect the list would IMO be very confusing. If I'm looking at a list of 3 sequences having filtered, I would not expect 5 sequences to be downloaded because I selected them at some point in the past.

theosanderson commented 2 months ago

(But I don't think it would be hard to combine the filters and the list)

corneliusroemer commented 2 months ago

Hmm, I think it's silly to have to tick all, it's an unnecessary click for no reason. If you don't want to download anything, then don't click the button.

We can also have two buttons: download all shown (i.e. selection through filtering) and download selected (orthogonal to filtering, based on tickboxes).

The selected button would be disabled until someone ticks something. We could also show in parens how many are ticked. And a clear button.

I'm not a fan of adding button clicks that are unnecessary. I hate that I have to tick the "check all" button on other websites when I want to download all sequences I've filtered to. Clearly I don't want to download no sequences, otherwise why would I click download? 😀

But UI is of course somewhat a question of taste and if others find it confusing I will not block it 😄

theosanderson commented 2 months ago

I just think the presence of checkboxes strongly suggests that checkboxes are required for download. (If you can point to an existing UI that doesn't provide that "tick all" box then that would help to calm my fears). I can see a way to go we could have a "check all" box that above a certain threshold simply sets allChecked = true, and when allChecked=true you can't untick arbitrary options.

corneliusroemer commented 3 weeks ago

+1 on this issue from Richard, see https://loculus.slack.com/archives/C05G172HL6L/p1724457474224369