Projects BibleWeb Search Grouped results by book
Planned

Grouped results by book

Area: Search Milestone: v1

Context

Problem: Search results are a flat list. When a term appears in many books, users can't quickly see the distribution — is this a Genesis concept or a Psalms concept? How many results are in each book?

Solution: Group search results under book headers with counts (e.g., "Genesis — 12 results", "Psalms — 8 results"). Each group can be collapsed or expanded.

Not included: Filtering by book or testament. Just visual grouping with counts.

Functional

Expected user flow:

  1. User searches for a term
  2. Results grouped under book name headers in biblical order
  3. Each header shows: book name + result count
  4. Headers are collapsible (click to expand/collapse)
  5. Total result count at the top

UX & Design

Book headers: Bold text with count right-aligned. Chevron icon for collapse/expand.

Collapse animation: 200ms ease-out height transition.

Technical

Implementation:

  • Client-side grouping by book_id from search results
  • Book names from BOOK_NAMES constant
  • Collapsible sections with local state

Files:

  • apps/web/src/routes/(app)/search/+page.svelte (modify)

Status

Current: PLANNED Milestone: v1 Priority: Medium — improves search result navigation

Dependencies:

  • Requires: full-text search (DONE)