Skip to content

Faceted Search Frontend #147

Description

@cl117

Summary
Build a clean, intuitive faceted search UI on top of the Typesense-backed search. Users should be able to narrow results by clicking filters in a sidebar — the way Addgene's catalog works. The look-and-feel target: natural to use, not visually busy, facets auto-populate from the data (no hardcoded lists).

Design principles
Addgene-like layout
Auto-populated: every facet value + its count comes from the backend (Typesense facet_by), never hardcoded. New data → facets update automatically.
Not busy: collapsible facet groups; show the top ~8 values per facet with a "Show more"; hide facets that have no values for the current result set; counts update as filters are applied.
Live: selecting/clearing a facet updates results and the other facets' counts without a full page reload.
What a "facet" is here
A facet = a field you can filter by, shown as a list of values with counts, e.g.:
Type
☐ ComponentDefinition (104,275)
☐ Sequence (93,660)
☐ ModuleDefinition (13,016)
☐ Collection (8,569)
Role (SO term)
☐ Promoter (…)
☐ CDS (…)
...
Backend prerequisites (coordinate with @cl117 — small, do first)
Currently only type and graph are facet-enabled in the Typesense part collection. Before/alongside this issue:

Enable facet: true on role and sboltype (and confirm type, graph/collection which are already on).
(For a length facet) add a numeric length field to the index + decide bucket ranges (e.g. <100, 100–500, 500–2000, >2000 bp). If length isn't ready, ship the categorical facets first and add length later — don't block on it.

Milestone 1 — Core faceted browsing

  • Sidebar listing facet groups for Type, Role, Collection (graph), each value with its live count (from facet_by).
  • Clicking a value filters the result list (Typesense filter_by); counts on the other facets update.
  • Active-filter chips above results + a "Clear all".
  • Works together with the existing free-text search box (facets refine the query results).
    ✅ Exit: a user can type rbs, then click Type = ComponentDefinition and Role = …, and see the list narrow with correct counts.
    Milestone 2 — Polish to the Addgene bar
  • Multi-select within a facet (OR within a facet, AND across facets).
  • Collapsible groups + "Show more / Show less" for long facets; search-within-facet for big lists (Typesense facet_query).
  • Hide empty facets; show selected values pinned at top.
  • Length facet as range buckets (if the backend field landed).
  • Filter state reflected in the URL (shareable/bookmarkable filtered searches).
  • Responsive layout; empty-state and loading states.

Where to build it
Build as a standalone demo page served by SBOLExplorer (extend [flask/templates/index.html]/ the /test route) that calls the Typesense-backed /search. Production integration into SynBioHub's UI stays with the team — keep your component self-contained so it can be ported.

Deliverables

  1. The faceted search page
  2. A short README: how facets map to Typesense fields, how to add a new facet.
  3. A screen recording / screenshots for the paper's UI figure.

Acceptance criteria
Facets auto-populate from live data (verified by adding a doc and seeing counts change).
Selecting/clearing facets updates results + counts live, no full reload.
Clean Addgene-like layout; uncluttered; no hardcoded facet values anywhere.
Reference
Addgene catalog faceting: https://www.addgene.org/search/catalog/plasmids/
Typesense faceting: facet_by, facet_query, max_facet_values, filter_by.

Note:
It has a real backend dependency — role/sboltype aren't facet-enabled yet and there's no length field.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions