Skip to content
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

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

Open
davidebbo opened this issue Nov 4, 2024 · 5 comments

Comments

@davidebbo
Copy link
Collaborator

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
Copy link
Collaborator

lentinj commented Nov 4, 2024

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:

Controller.prototype.click = function() {
this.close_all();
if (is_popup_state()) {
// NB: Record both states first, then run callback, so UI can get a URL with the popup applied
// (to open in a new window, e.g.)
record_url(this);
record_url(this, {record_popup: global_button_action});
} else if (global_button_action.action === "leap") {
record_url(this);
}
click_on_button_cb(this);
}

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
Copy link
Collaborator Author

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.

@davidebbo
Copy link
Collaborator Author

@jaredkhan, in case you get inspired by this one, it might be a good low hanging fruit :)

@jrosindell
Copy link
Member

A comment from a user that's closely related but doesn't involve closing the wiki page before going to the search bar

"Some weirdness with the internal browser. Not sure what the solution is but I feel like either the browser should just be closed when you click away or the browser should open at the new node (second sounds harder to me).
MWE:
go to cheetah, click to open the wiki page.
click to the search bar without closing the wiki page.
search for another species (panthera leo)
once it goes to the lion it will reopen the bowser pointing to the wiki page for cheetah."

@davidebbo
Copy link
Collaborator Author

@jrosindell yes, that is really the same issue. Basically, when you pop up the wikipedia page and dismiss it (whether by closing it with the X or by clicking anywhere outside), the pop query string param remains, triggering the issue when searching for something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants