dgidb / dgidb-v5

Providing interactions between drugs and genes sourced from a variety of publications and knowledgebases
https://dgidb.org
MIT License
14 stars 2 forks source link

feat: adding breadcrumbs for users to easily navigate back to search … #501

Open katiestahl opened 3 months ago

katiestahl commented 3 months ago

…results on record pages

I had to adjust some styling for this. The 404 Not Found page may look a little silly, but I will fix it up and add a container for it once #500 is merged

close #339

katiestahl commented 3 months ago

This looks really nice!

A couple cases for which I'm not sure is the right way to handle things:

  1. if I keep clicking different drugs and genes, it'll send me down a chain of record pages, but "Search Results" still points back to the original search. I think that's correct, and the alternative would be like a growing chain of random drugs and genes (complicated to retain, could get too big) but it's a little unexpected also
  2. If you click on a gene in Browse Categories, the breadcrumb is still "Search Results", and it points to the last search you did in that session. It would be really nice if we could set ourselves up to ensure the breadcrumb goes back to Browse Categories, and if the link opened the tab for the category that you clicked from (would probably entail some non-minor lifting on that page though).
  3. If you are looking at a gene/drug page, and then put in the URL for a different gene/drug page, the breadcrumb will point back to your previous search results (even though you technically didn't get there via searching). Opening a new tab fixes this, but I'd say it's unexpected behavior.

thank you so much for testing this thoroughly and leaving this amazing feedback!!

  1. Yeah, I was trying to think about how to correctly represent the breadcrumbs for this page. I agree it is a bit unexpected. I'll do a bit more research to see what the standard is here and make an update.
  2. oh dang, I definitely missed this case. I'm wondering if it might make sense to just keep a state of previous pages visited and popping them off the array as the user goes back...
  3. Ah, I agree. I'm going to do some more research to figure out the best way to handle these scenarios
mcannon068nw commented 2 months ago

This looks really nice!

A couple cases for which I'm not sure is the right way to handle things:

  1. if I keep clicking different drugs and genes, it'll send me down a chain of record pages, but "Search Results" still points back to the original search. I think that's correct, and the alternative would be like a growing chain of random drugs and genes (complicated to retain, could get too big) but it's a little unexpected also

I think the way this is implemented currently is the correct way to handle. I think the growing chain of drugs and genes could be useful actually, but I agree it has the capacity to grow really unwieldy very quickly. We can use the current implementation and loop back to this if it becomes a requested or desired feature.

  1. If you click on a gene in Browse Categories, the breadcrumb is still "Search Results", and it points to the last search you did in that session. It would be really nice if we could set ourselves up to ensure the breadcrumb goes back to Browse Categories, and if the link opened the tab for the category that you clicked from (would probably entail some non-minor lifting on that page though).

Also agree on this point. How much of a lift is non-minor?

  1. If you are looking at a gene/drug page, and then put in the URL for a different gene/drug page, the breadcrumb will point back to your previous search results (even though you technically didn't get there via searching). Opening a new tab fixes this, but I'd say it's unexpected behavior.

I am actually having a hard time thinking about if this is a problem or not. In this case, I think the expected behavior would just be either: 1) the breadcrumbs reset to just Home / Gene 2) the breadcrumbs grow to Home / Search / Gene / Gene2

We already kind of discussed that we don't necessarily want the behavior in option 2, but I don't know that the user would care about the implementation of option 1? I feel like they might actually want to get back to their own initial search results easily (but maybe I'm wrong about this)