dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

life: support displaying an arbitrary taxon from the lifelist #186

Closed synrg closed 5 months ago

synrg commented 1 year ago

Currently if a user wants to do any further actions on a taxon that's in the lifelist display, their best option (and the only one that will work for any arbitrary taxon, not just the topmost one on each page) is to type out a new command with the name of the desired taxon in it.

The best way to improve on this, I think, would be via Reply chaining. But currently that depends on the topmost observations search link on the page having the currently selected taxon in it, and that's not the case right now. It is either:

  1. on the first page, the Observations link is for the taxon (if any) in the original ,life command before the user made any changes to it via the buttons on the menu
  2. on the second and subsequent pages, the topmost link is for the topmost taxon on that page, i.e. is essentially arbitrary as the user has no direct control over which taxon is at the top of the page

For example, typing ,life my molluscs produces a display as per the following screenshot. Currently, the user can select any taxon on the current page, let's say "Arion", but when they select it, the page is not edited, and when the menu times out, the fact they previously made that selection vanishes without a trace.

image

I think the "Observations" link should be changed to "Observations of Mollusca" initially, and then subsequent actions on the page should update the link:

The only slight wrinkle in this plan is on page 1 when the user has type ,life my the first taxon on the page is the very first kingdom in the life list, e.g. Animalia (usually), not Life (the root taxon of all taxa in iNaturalist) which is concealed. Thus, the user has no direct link to all observations for the query. That would be best addressed by going back on that design decision, i.e. include Life as the first entry of the page instead of concealing it.

synrg commented 1 year ago

If we're putting Life back in the game, a better implementation would be to not output the now-redundant "Observations" link at the top of each page. After all, it just duplicates the link to the observations for the taxon which is already present in the page body. Instead, we could add some visible indicator on the page to show which taxon is currently selected from the dropdown menu, then modify the Reply converter to recognize that the currently selected entry on the page is the one to use as the basis for the reply query, not the topmost one on the page.

synrg commented 5 months ago

Has been fixed for a while. Selecting from lifelist's taxon menu updates the display with a visual indicator. Any Reply-chained or link-chained command will locate the indicator and use that taxon as part of the query.