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

"osn number" missing from the images in the footer, causing hanging #799

Closed
hyanwong opened this issue Apr 16, 2024 · 9 comments · Fixed by #800
Closed

"osn number" missing from the images in the footer, causing hanging #799

hyanwong opened this issue Apr 16, 2024 · 9 comments · Fixed by #800
Assignees

Comments

@hyanwong
Copy link
Member

On beta, the images in the footer like this

Screenshot 2024-04-16 at 14 31 24

Currently give a link like

https://beta.onezoom.org/life/@=965954?pop=osn_&init=jump

I think the the osn_ should be followed by a number?

A secondary bug is that when such a number is missing, the tree login hangs indefinitely. We need to fix this: I suspect @lentinj would be best placed to fix both problems?

@lentinj
Copy link
Collaborator

lentinj commented Apr 16, 2024

Yes, it should have an OTT postfixed:

* * ``pop``: Trigger a UI popup, a string of the form "(tab)-(OTT)" e.g. ``pop=ol_417950``

It's flat out not there:

<a href="/life/@={{=data[p][0]}}?pop=osn_&init=jump" target="_blank"><img class="species" alt="{{=data[p][1]}}" src="{{=img.thumb_url(data[p][2], data[p][3])}}" /></a>

An extra {{=data[p][0]}} should save the day I think?

The URL parsing crashing is unfortunate, but I'm not sure what can be done to generically solve the problem. A global error handler would be nice, but I'm guessing there's a lot of other cases that would then need tidying up.

@hyanwong
Copy link
Member Author

Thanks. I'll add the {{=data[p][0]}} in a PR then, and give it a whirl.

@hyanwong
Copy link
Member Author

hyanwong commented Apr 16, 2024

Ah, that bit requires the OneZoom ID, not the OpenTree ID (because it's intended to specify an internal node, and nodes don't necessarily have OpenTree IDs.

However, getting the OneZoom ID would require querying the DB: avoiding this was the reason to hard-code the URLs in the first place.

Perhaps the best thing would be to allow a blank osn_ and within the tree viewer, fill it in from the OTT id if the osn_ is missing?

We should also correct the documentation, where it says that the number is supposed to be an OTT, and document when it should instead be an OZid

@lentinj
Copy link
Collaborator

lentinj commented Apr 16, 2024

Possibly, but it's making a mechanism which is already a bit all over the shop even worse, as we have to hardcode which are OZid-y options in the page setup.

Is there a sponsor URL we could link directly to, that will convert OTT->OZid if that's what's given? I'm guessing not though.

@hyanwong
Copy link
Member Author

Possibly, but it's making a mechanism which is already a bit all over the shop even worse, as we have to hardcode which are OZid-y options in the page setup.

I think the convention is that nodes are always OZids and leaves are always OTTids?

Is there a sponsor URL we could link directly to, that will convert OTT->OZid if that's what's given? I'm guessing not though.

There's an API to convert OZ->OTT, I think. We could make a redirect page, I suppose?

@hyanwong
Copy link
Member Author

hyanwong commented Apr 16, 2024

We can link directly to a node page given an OTTid: the link is of the form:

https://beta.onezoom.org/sponsor_node?ott=244265

as opposed to using an OZid:

https://beta.onezoom.org/sponsor_node?id=884549

It would be easy, I guess, to pass the OTT somehow through the URL parser (e.g. hack it using a negative number?)

@hyanwong
Copy link
Member Author

hyanwong commented Apr 16, 2024

We could, I suppose, clarify things in the URL parser by adopting some sort of convention, e.g. that an "at" sign (@) followed by a number means an OTT ID, and a plain number means an OZid?

I don't know if/how this would mess with the current convention, though. I tend to think of "@" as giving a location.

@lentinj
Copy link
Collaborator

lentinj commented Apr 16, 2024

I was thinking of the links in the footer going directly to https://beta.onezoom.org/sponsor_node?ott=244265, and skipping the tree. They are sponsorship links after all, so this doesn't seem too unreasonable to me.

Changing the pop parameter to take a pinpoint, e.g. pop=ow_ozspons@%3D244265 or pop=ow_ozspons@_ottid%3D12345 seems cleanest to me, given it's something we have a specification for, but it'd be fiddly work.

Given this though, it'd be a lot easier to also say "if the pinpoint is missing, use the main pinpoint" in the URL parser, rather than doing so later on once our pinpoint has been looked up.

@hyanwong
Copy link
Member Author

Ah yes, ISWYM. It's indeed quite reasonable to direct straight to the sponsor_node page. I guess I'll do that as a quick workaround. We can think about pinpoints at some later date.

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

Successfully merging a pull request may close this issue.

2 participants