fix(kb): re-render article detail when the route id changes #142
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mapps-155-kb-article-nav-rerender"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The KB article detail view captured the route's
idparam as a plainStringinside eachuse_resourceclosure. A plain captured value is not reactive, so navigating from one article to another in-app (sameKBArticleDetailPagecomponent, newidprop) never restarted the fetch: the URL changed but the detail pane kept showing the previously opened article. Hard-reloading worked only because that remounts the component from scratch.Wrap the three id-dependent resources (article, versions, vote) in
use_reactive!so the routeidbecomes a reactive dependency. When the param changes the resources restart, the detail pane drops to its loading state, and the newly fetched article renders. Repeated article-to-article navigation now works without a reload.#MAPPS-155
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com