-
Notifications
You must be signed in to change notification settings - Fork 129
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
Feature: move subclasses to sub-tab #507
Comments
Alright, so I have taken a look at getting this feature implemented, and here are my thoughts. Essay incoming. TLDR: probably best to wait until API V2 before undertaking this fix. I'll tag this issue as blocked, but if you have a genius solution to solve it then be my guest! One Possible SolutionAdding the subclasses as a nested section to each class would require a refactor of how we currently handle the genration of navlinks. With possibly three-layers of nested links, recursive generation of subroutes seems like the wisest idea. Assume we can format route data from the in the form:
Then the follow pseudo-code might be a good way to recursively generate the nav-links:
This might be called in the component template like:
(NB. this is pseudo-code and hasn't been tested) The IssueThe principal obstacle to this solution is fetching and formatting the API data in a way that avoids spaghetti while keeping the API response payloads as small as possible given how the Open5e API handles subclasses (archetypes in the parlance of the API) Subclasses do not have their own endpoint, they are returned as an array for a given class. ie. Barbarian subclasses are access via the If we request the archetype data in the Compare this to the size of the response payload from the current reversion of the website. Requesting the 'archetypes' field from Taking a peek at API v2, this shouldn't be so much of a problem. Classes and subclasses are now both returned directly from the |
We would like to update the sidebar (implemented in
layouts/default.vue
) so that when a class is being viewed via the/class/[id]
route, its subclasses are visible in the sidebar. Something like this:It might be worth considering how we avoid allowing the sidebar to people excessively long. One idea might be to hide the other classes in the sidebar when one is already being viewed, but this might impair navigation too much.
The text was updated successfully, but these errors were encountered: