Skip to content

Conversation

@dsblack0
Copy link

This PR implements a minimal, safe category-scoped search provider to satisfy issue #128.

Summary of changes

  • Added src/categories/search-provider.js — registers a fallback filter:categories.getTopicIds hook that filters topic tids within a category by matching the search term against topic titles. It preserves pinned/topic ordering and respects paging (data.start/data.stop). The provider returns the original payload on error or when the term is too short, so it is fail-safe.

How to test

  1. Lint: npm run lint — should produce no errors (only unrelated vendor warnings).
  2. Start NodeBB: npm start (or your development startup sequence). Visit a category page and use the search bar to search within that category (term length >= 2).
  3. Alternatively, run the smoke test locally: node tools/smoke-category-search.js to exercise the provider headlessly (prints returned tids or payload).

Copy link

@MeghaJasti MeghaJasti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes made are not accurate to the search functionality, or even to JS functionality. Ex: plugins.hooks.register is not a valid function to create a plugin, which causes cascading issues throughout the entire application. This PR needs to be completely reworked before approving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants