Smile-SA / slidev-component-progress

Progress component for Slidev
MIT License
11 stars 2 forks source link

Breaking changes due to recent base Slidev upgrades: composable imports, last active route calculation #7

Open ani-per opened 6 months ago

ani-per commented 6 months ago

As stated in pull requests for other Smile-Slidev components (Poll, Scroll), recent Slidev upgrades have deprecated the use of injection, importing nested modules, and titles.md (see the relevant documentation). Furthermore, the underlying route identifier has (at some point) shifted from path (of type string) to no (of type Number).

ani-per commented 6 months ago

My linked pull request #8 fixes these issues, as far as I can tell by my debugging.

However, while debugging I found another issue (which either was already an unfound bug or emerged due to these upgrades): the identification of the active route (lastActiveRoute) fails when there are slides with hideInToc = True in the frontmatter. In such cases, the calculation fails since any such slides are left out of the main tree entirely, which results in the last active route being set to the first TocItem in the tree. This results in mistaken formatting for each header in the progress bar.

I'm not sure how to fix this simply, since it seems like a drawback of the current logic that only searches through children of the main tree.