For the backstory on why I built this sidebar, please read this post.
This post is my reasoning document on why I included some features, left out others, and what I’d like to see improved.
Characteristics
- Usable in any JS project, as long as the routes are known
- Configurable
- Clean, accessible DOM
- Keyboard usable
- h(n) performance to match active route
Restrictions / Things I decided against
- Bring-your-own subcomponents (slots)
- The application using the sidebar must pre-compute and pass the visualized routes outside the sidebar. There’s no fuzzy matching.
- No full-width links (recommended accessibility by post ToDO): to allow visual hierarchy
To Improve
- Icons
- Code understandability of events
- Testing (E2E) - unit testing is anyway not really known how to do in svelte