fix(kb): re-render article detail when the route id changes #142

Merged
David merged 2 commits from fix/mapps-155-kb-article-nav-rerender into main 2026-06-14 18:12:53 +02:00
Owner

The KB article detail view captured the route's id param as a plain
String inside each use_resource closure. A plain captured value is not reactive, so navigating from one article to another in-app (same KBArticleDetailPage component, new id prop) 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 route id becomes 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

The KB article detail view captured the route's `id` param as a plain `String` inside each `use_resource` closure. A plain captured value is not reactive, so navigating from one article to another in-app (same `KBArticleDetailPage` component, new `id` prop) 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 route `id` becomes 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>
fix(kb): re-render article detail when the route id changes
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 49s
ce33dd2a81
The KB article detail view captured the route's `id` param as a plain
`String` inside each `use_resource` closure. A plain captured value is not reactive, so navigating from one article to another in-app (same `KBArticleDetailPage` component, new `id` prop) 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 route `id` becomes 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>
Merge branch 'main' into fix/mapps-155-kb-article-nav-rerender
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 48s
9c2607f590
David merged commit 1017f77338 into main 2026-06-14 18:12:53 +02:00
David deleted branch fix/mapps-155-kb-article-nav-rerender 2026-06-14 18:12:53 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!142
No description provided.