inaturalist / iNaturalistReactNative

Cross-platform version of the iNat mobile app
MIT License
63 stars 21 forks source link

Info button in ExploreTaxonSearch doesn't take you to TaxonDetails #1705

Closed kueda closed 2 months ago

kueda commented 3 months ago

Describe the bug When you search for a taxon on Explore and tap the info button next to a result, nothing happens other than the status bar disappears. You should go to TaxonDetails

To Reproduce Steps to reproduce the behavior:

  1. Go to Explore
  2. Tap on "All organisms" in the header to get to ExploreTaxonSearch
  3. Tap the "i" button next to the result
  4. The status bar disappears, but nothing else happens
  5. Tap the back button
  6. Now you land on TaxonDetails showing the taxon you wanted info about, instead of returning to the search results

Expected behavior When you tap the "i" button, TaxonDetails should appear showing the taxon you wanted info about.

Context (please complete the following information):

Additional context Probably has something to do with the modal.

kueda commented 2 months ago

The problem is that ExploreTaxonSearch is in a modal, and thus does not allow navigation. We can close the modal and then push TaxonDetails onto the stack, but then you can't go back to your search results.

I don't really think ExploreTaxonSearch should be a modal, especially if it needs to support navigation away from it. I think the real desire here is for ExploreTaxonSearch to exist as normal screen in the stack navigator, just without the bottom tabs. We don't have a good way of doing that, just a few bad ways, like the contortions we do to support the add obs flow, which leaves the current stack entirely. I spent most of today trying a new bad way to hide the bottom tabs that seems slightly less-bad than leaving the stack, but it unravels a lot of the ways Explore is designed to work at present.

So IMO, options here are

  1. Show TaxonDetails in a modal on top of the ExploreTaxonSearch modal. Probably the simplest, but still bad b/c it's a modal on top of a modal, plus we have to hide the Taxonomy section since that also navigates by pushing new TaxonDetails screens onto the stack.
  2. Continue down the path hiding the bottom tabs. This also isn't pretty and I think to make it work I'll have to really overhaul Explore, which doesn't seem worth it right now.
  3. Just treat ExploreTaxonSearch like a regular nav screen without hiding the bottom tabs. All the same limitations as 2.
  4. Investigate another parallel navigator approach where the presentation is modal but we might be able to nest a stack navigator inside of it. I worry that we'll still have problems of the modal not having access to Explore's state.

I need @abhasinat to make a call here.

kueda commented 2 months ago

Ok, after discussing this w/ Abhas we're going with this:

When the user taps the info button, close the modal, and navigate to TaxonDetails. Avoids modal on modal limitations, punts on the harder work of making this screen not a modal at all.