Open synrg opened 5 years ago
See also https://github.com/synrg/quaggagriff/issues/34 to support the shorthand "L. occidentalis", etc. for a specified list of taxa.
A modifier with
might be nice to support in the query to control what gets enumerated, where the default is to enumerate immediate children, but with
could be used to enumerate the specified rank instead, e.g. [p]taxon Anisoscelini
to start at the tribe and enumerate its top genera, but [p]taxon Anisoscelini with sp
would enumerate the species within the tribe instead. This, of course, should have its own issue if we pursue it.
The preferred preposition now for listing taxa at a specific rank would be per
, just like in the ,life
command, e.g. [p]t Anisoscelini per sp
to enumerate all species as a flat list, and should accept all of the same values as ,life
does (main
, any
, leaf
).
We should add per child
as another value: listing the whole tree has performance implications, as the whole tree may need to be traversed with additional API hits to collect all of the descendants, whereas no additional API calls are needed to enumerate all of the direct children of a taxon that has been already fetched by /v1/taxa/{id}
endpoint.
The per child
feature can be developed with ,life
command first. Then to make all of this work with ,taxon
, we could support it as a whole new taxon menu that looks and feels just like life
only is populated from descendent taxa of the specified taxon.
When this new interaction is started, the "social buttons" will no longer be available. If a user wants to show the children for an existing taxon display that they or someone else displayed, reply-chaining can be used to start the interaction, e.g.
,t anisoscelini
=> displays the usual Taxon display with just this taxon
,t per child
(Reply to previous display) => starts the per child
interaction with a menu just like the ,life
command, but populated from the descendents of the taxon, whether or not they have observations
If the options are combined, i.e. ,t Anisoscelini by me per species
, then it should just invoke the ,life
command instead.
As of 38bc513f5c64574ec4d48b20bc4a10da2faf47c9 with latest dronefly-discord and dronefly-core, per child
is supported for ,life
command, but not yet in conjunction with sort by obs
. Also, the ,taxon
command doesn't yet support per child
. That will take a fair amount more work.
With #118 now closed, it could be argued that ,t list
provides all of this info in a more convenient way because you can paginate through it. I'll leave this open, though, because it's still a nice idea to provide a small summary of the most popular child taxa in the main taxon display, something that comes at the cost of zero additional API calls which is very appealing.
In the meantime, you can now display a list of child taxa (i.e. only direct children, not grandchildren and below) sorted by # of observations for an already shown taxon display either with ,t list [query] sort by obs
or with ,t [query]
(or any other command that outputs a single taxon) then reply-chain ,t list sort by obs
to the taxon displayed by the bot.
Related to https://github.com/synrg/quaggagriff/issues/41 it would be nice to expand on that display and also include children of a taxon, up to some reasonable limit, with the same sort of "and # more" collapsing that that the
map
command has for the overflow.So, something like:
[p]taxon leptoglossus
->The constraints on how many child taxa can be listed are:
Note: the mockup above is already approaching 1000 characters without links to all of the listed taxa or their maps included, so this may indicate that it's a bad idea to add so many links. Consider leaving off the more "expensive" links to maps and/or the links to the child taxa themselves so we can include more child taxa within the constraints shown above.
It would be helpful to also provide another command (perhaps
[p]inat next
, aliased as[p]next
or[p]n
) and/or reaction button menu to access the "inaccessible" children in the ellipsis "and 50 more". But that should be the topic of new issue.