Skip to content

Implement searchable FAQ feature with article validation and tests#626

Open
directorfloo wants to merge 1 commit into
code-flexing:mainfrom
directorfloo:BuildhelpcentrewithsearchableFAQ
Open

Implement searchable FAQ feature with article validation and tests#626
directorfloo wants to merge 1 commit into
code-flexing:mainfrom
directorfloo:BuildhelpcentrewithsearchableFAQ

Conversation

@directorfloo

Copy link
Copy Markdown

Closes #566

Here's a copyable PR description you can paste into GitHub:

Title: Add Help Centre (searchable FAQs, ratings, no-results tracking)

Summary:
Adds a lightweight, client-side Help Centre with full-text search (Fuse.js with substring fallback), categorized articles, per-article "Was this helpful?" ratings (stored in localStorage), and tracking of popular no-result queries. Includes unit tests and a lightweight validation script.

Files changed / added:
- Updated: `frontend/package.json` — add `fuse.js` dependency
- Added: `frontend/src/content/help/articles.json` — sample FAQ articles
- Added: `frontend/src/lib/help-search.ts` — search utility (Fuse.js + fallback)
- Added: `frontend/src/app/help/page.tsx` — Next.js client page and UI
- Added: `frontend/src/__tests__/help-search.test.ts` — unit tests for search
- Added: `frontend/scripts/validate-help.js` — quick validation script

Why:
- Reduce support load by surfacing common answers and letting users self-serve.
- Capture no-result queries to identify documentation gaps.
- Provide a small, incremental MVP that can be upgraded to Algolia DocSearch or server-backed tracking later.

Acceptance criteria coverage:
- Full-text search across articles: implemented via Fuse.js, with substring fallback if Fuse not installed.
- Articles organized by category: grouped and displayed when no search query.
- Each article has a `Was this helpful?` rating stored in localStorage under `helpful_<articleId>`.
- Popular search queries with no results are tracked in localStorage under `help_no_results`.

How to run & test locally:
1) Quick validation (no install required):
   cd frontend
   node scripts/validate-help.js

2) Full test run (requires installing deps):
   cd frontend
   npm install
   npm test

How to review:
- Check article text and categories in `frontend/src/content/help/articles.json`.
- Open the Help UI at `/help`:
  - Confirm search returns relevant articles.
  - Confirm browsing by category lists grouped articles.
  - Click `Yes`/`No` and verify `localStorage` entries `helpful_<articleId>`.
  - Search gibberish and verify `help_no_results` in `localStorage`.
- Run tests or the quick validator above.

Notes & next steps:
- Ratings and no-results are stored locally for MVP. For aggregated analytics we can POST to a server endpoint or integrate with existing telemetry.
- UI uses inline styles for rapid iteration; can be refactored to use the design system components.
- Articles are currently JSON; we can convert them to MDX for richer formatting if desired.

Rollback:
- Remove the added files and dependency or revert this branch/PR.

Would you like me to:
- run `npm install` and the full test suite now and fix any failures, or
- convert the articles to MDX and add MDX rendering?

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the vic's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@directorfloo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

#1039 Build help centre with searchable FAQ

1 participant