OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
90 stars 20 forks source link

Previously shown wikipedia page gets displayed again after searching for unrelated taxon #892

Open davidebbo opened 2 days ago

davidebbo commented 2 days ago

Repro steps:

Result: it goes to Tiger, but then also pops up the Lion wikipedia page again!

I think part of the problem is that pop=ol_563151 stays in the URL after dismissing the wikipedia page. And after navigation through search, it ends up being applied again.

Note that after dismissing the wikipedia page, if you drag the tree or zoom in or out, the pop=ol_563151 disappears and the issue does not occur. It only occurs if you search right after dismissing it (which for me, is rather common!).

lentinj commented 2 days ago

I think part of the problem is that pop=ol_563151 stays in the URL after dismissing the wikipedia page.

Yup, spot on. This has been an issue for some time.

record_url is what updates the URL. It has no way of finding out if a pop-up is open (it's part of the treeviewer, and supposed to be UI agnostic), so we instead do a special "with a popup" record_url on click:

https://github.com/OneZoom/OZtree/blob/f90d82ccab3b168fedeada4ee732c8d1641cddb2/OZprivate/rawJS/OZTreeModule/src/controller/controller_interactor.js#L91-L102

Once the pop-up is closed and you start moving about, eventually another record_url call will happen, without the record_popup and clear it.

Getting the UI to call onezoom.controller.record_url() (without a record_popup) when a pop-up is closed might be enough, but I'm assuming I've tried this in the past and it wasn't that easy.

Ideally it'd be the UI managing the page URL, the treeviewer doing it is somewhat backward.

davidebbo commented 2 days ago

Thanks @lentinj for giving context and background on this issue. I'm not familiar enough with the UI side of things to be of much help, but if there is a way to address it cheaply and with low regression risk, it would be nice.