SIGN IN SIGN UP

fix(sidebar): stop wrong branch of multi-located guide leaking open

Rspress's createInitialSidebar only ever sets collapsed=false and mutates the
shared sidebar data in place on navigation, so a branch opened once stays open
on every later page. For a multi-located guide the "wrong" branch leaked open
after you moved on, and it scrolled the active item to the bottom.

Replace the imperative post-collapse (discarded on Rspress's next rebuild) with
a declarative decision recomputed each render. Wrong branches are tracked in a
session-scoped suppressed set (their divergence group id) and force-collapsed
until the visitor navigates into one, which un-suppresses it. Highlight and
scroll still target only the resolved instance.
Y
Yoann Cosse committed
2e4069a86fcb64a17efffeeba0b7c029b77aa400
Parent: 60ad86a