fix(kb): make article list search, category, and tag filters work #143
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/mapps-156-kb-articles-search-category-filter"
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 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
Closing as superseded, not merged.
mainalready implements this fix via PR #141 (feat(kb): surface article tags as clickable filter chips, commit2ff408d). That PR reworked the sameKBArticleListPagefiltering block so search, category, and tag filters all work (thepage/search/category/tagsignals are now read inside theuse_resourceclosure, 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_matcheshelper and unit tests). Both rewrote the exact same block, so they conflict, and there is no clean resolution:q/categoryquery (a regression).article_matcheshelper that does not exist in main's approach (orphaned / non-compiling).MAPPS-156 is resolved on
mainby #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.Pull request closed