fix(kb): make article list search, category, and tag filters work #143

Closed
David wants to merge 0 commits from fix/mapps-156-kb-articles-search-category-filter into main
Owner

The KB article list search box and the category dropdown updated their signals but never narrowed the rendered rows and fired no request. The list resource read page/search/category OUTSIDE its use_resource closure and captured them by value, so Dioxus never subscribed the resource to those signals and never refetched (the same no-refetch defect class as MAPPS-148/MAPPS-153/MAPPS-154). On top of that, even a correctly wired server query could not satisfy tag search: GET /kb/articles?q= matches only title/content and ignores tags, and there is no tag endpoint (/kb/tags 404s).

Filter the loaded article set client-side, the same approach as the Tickets list (MAPPS-154). A single broad fetch feeds both the tree rail and the table; an extracted article_matches helper matches the search term case-insensitively against title, content, summary, AND tags, and matches the category dropdown against category_id. Empty search or category matches every article, so clearing either control restores the full list. Pagination now runs client-side over the filtered set. Drop the now-unused server q/category_id query building and the urlencoding_minimal import. Add unit tests covering empty filters, title search, tag search, category narrowing, and combined search+category.

#MAPPS-156

The KB article list search box and the category dropdown updated their signals but never narrowed the rendered rows and fired no request. The list resource read page/search/category OUTSIDE its use_resource closure and captured them by value, so Dioxus never subscribed the resource to those signals and never refetched (the same no-refetch defect class as MAPPS-148/MAPPS-153/MAPPS-154). On top of that, even a correctly wired server query could not satisfy tag search: GET /kb/articles?q= matches only title/content and ignores tags, and there is no tag endpoint (/kb/tags 404s). Filter the loaded article set client-side, the same approach as the Tickets list (MAPPS-154). A single broad fetch feeds both the tree rail and the table; an extracted article_matches helper matches the search term case-insensitively against title, content, summary, AND tags, and matches the category dropdown against category_id. Empty search or category matches every article, so clearing either control restores the full list. Pagination now runs client-side over the filtered set. Drop the now-unused server q/category_id query building and the urlencoding_minimal import. Add unit tests covering empty filters, title search, tag search, category narrowing, and combined search+category. #MAPPS-156
fix(kb): make article list search, category, and tag filters work
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m2s
Create release / Create release from merged PR (pull_request) Has been skipped
f21ea953dc
The KB article list search box and the category dropdown updated their signals but never narrowed the rendered rows and fired no request. The list resource read page/search/category OUTSIDE its use_resource closure and captured them by value, so Dioxus never subscribed the resource to those signals and never refetched (the same no-refetch defect class as MAPPS-148/MAPPS-153/MAPPS-154). On top of that, even a correctly wired server query could not satisfy tag search: GET /kb/articles?q= matches only title/content and ignores tags, and there is no tag endpoint (/kb/tags 404s).

Filter the loaded article set client-side, the same approach as the Tickets list (MAPPS-154). A single broad fetch feeds both the tree rail and the table; an extracted article_matches helper matches the search term case-insensitively against title, content, summary, AND tags, and matches the category dropdown against category_id. Empty search or category matches every article, so clearing either control restores the full list. Pagination now runs client-side over the filtered set. Drop the now-unused server q/category_id query building and the urlencoding_minimal import. Add unit tests covering empty filters, title search, tag search, category narrowing, and combined search+category.

#MAPPS-156
Author
Owner

Closing as superseded, not merged.

main already implements this fix via PR #141 (feat(kb): surface article tags as clickable filter chips, commit 2ff408d). That PR reworked the same KBArticleListPage filtering block so search, category, and tag filters all work (the page/search/category/tag signals are now read inside the use_resource closure, so Dioxus subscribes and refetches), and additionally surfaced tags as clickable chips. It therefore covers MAPPS-156 as well as MAPPS-157.

This PR is an independent, earlier fix for MAPPS-156 only (a single broad fetch plus a client-side article_matches helper and unit tests). Both rewrote the exact same block, so they conflict, and there is no clean resolution:

  • Taking this PR's side would revert #141's clickable-tag-chips feature and its server-side q/category query (a regression).
  • Taking main's side leaves this PR contributing nothing but unit tests against an article_matches helper that does not exist in main's approach (orphaned / non-compiling).

MAPPS-156 is resolved on main by #141, so closing this as superseded. The only potentially salvageable piece is the filtering unit-test coverage, which would need porting to main's current approach as separate follow-up work.

Closing as superseded, not merged. `main` already implements this fix via PR #141 (`feat(kb): surface article tags as clickable filter chips`, commit `2ff408d`). That PR reworked the same `KBArticleListPage` filtering block so search, category, and tag filters all work (the `page`/`search`/`category`/`tag` signals are now read inside the `use_resource` closure, so Dioxus subscribes and refetches), and additionally surfaced tags as clickable chips. It therefore covers MAPPS-156 as well as MAPPS-157. This PR is an independent, earlier fix for MAPPS-156 only (a single broad fetch plus a client-side `article_matches` helper and unit tests). Both rewrote the exact same block, so they conflict, and there is no clean resolution: - Taking this PR's side would revert #141's clickable-tag-chips feature and its server-side `q`/`category` query (a regression). - Taking main's side leaves this PR contributing nothing but unit tests against an `article_matches` helper that does not exist in main's approach (orphaned / non-compiling). MAPPS-156 is resolved on `main` by #141, so closing this as superseded. The only potentially salvageable piece is the filtering unit-test coverage, which would need porting to main's current approach as separate follow-up work.
David closed this pull request 2026-06-14 18:40:38 +02:00
David deleted branch fix/mapps-156-kb-articles-search-category-filter 2026-06-14 18:42:56 +02:00
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m2s
Required
Details
Create release / Create release from merged PR (pull_request) Has been skipped

Pull request closed

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!143
No description provided.