[Story-1097] KB search and tags

Story 1097Epic None29 files · +820/−23

PR #267 · pramaan-io/pramaan-app · merged 2026-06-08

Why this matters

Your help center is a folder, not a finder.

Without tags and a search index, readers give up before they read.

Each keystroke is a network roundtrip. The Help page becomes slower than the work it explains.

The fix — Build the catalog at build time, flip it in the browser — no server call per keystroke.

How it flows

sequenceDiagram
  autonumber
  participant mdx as KB articles (MDX)
  participant build as Build pipeline
  participant index as Search index (JSON)
  participant browser as Browser (runtime)
  mdx->>build: frontmatter + title read
  build->>index: lean FlexSearch JSON emitted
  index->>browser: bundled with the Help page
  browser->>browser: live FlexSearch query — no server call
  browser->>browser: empty / no-results / results state

What changed, file by file

Agent guide for KB authors — now documents the optional frontmatter fields (audience, updated) that the build-time search index and tag system read from each article.

New fields: audience : Everyoneupdated : Jun 2026

Files changed (29)

File±
content/kb/AGENTS.md+74
content/kb/forums/add-a-forum/article.en.mdx+1
content/kb/forums/archive-vs-delete/article.en.mdx+1
content/kb/forums/edit-a-forum/article.en.mdx+1
content/kb/forums/what-is-a-forum/article.en.mdx+1
content/kb/forums/when-you-cant-delete/article.en.mdx+1
content/kb/matters/archiving-a-matter/article.en.mdx+1
content/kb/matters/create-a-matter/article.en.mdx+1
content/kb/matters/review-the-chronology/article.en.mdx+1
content/kb/matters/sharing-and-access/article.en.mdx+1
content/kb/matters/upload-and-process-evidence/article.en.mdx+1
content/kb/matters/what-is-a-matter/article.en.mdx+1
docs/walkthroughs/story-1097-walkthrough.html+162
messages/en.json+5
messages/hi.json+5
package.json+1
pnpm-lock.yaml+8
src/app/[locale]/(workspace)/help/page.tsx+6
src/components/kb/HelpHome.stories.tsx+8
src/components/kb/HelpHome.tsx+26 −20
src/components/kb/HelpSearch.tsx+64
src/components/kb/KbSearchResults.stories.tsx ★+85
src/components/kb/KbSearchResults.tsx ★+80
src/components/kb/kb-fixtures.ts+23 −1
src/lib/kb/content.ts+21 −1
src/lib/kb/localize.ts+5 −1
src/lib/kb/schema.ts+16
src/lib/kb/search.test.ts+47
src/lib/kb/search.ts ★+173