Skip to content

A facet value in the search URL shows as selected but is not applied until the reader toggles it #793

Description

@jamiefolsom

What happens

Open an items search with a facet value in the URL, the form the stacked timeline's "Filtered search" bar link produces:

https://gwc.performant.studio/en/search/items/?786ddc04-3d48-45c9-8555-fe4bc4619509.name_facet[0]=Roman%20Egypt

The filter panel shows the badge "1", the chip "Geopolitical Context: Roman Egypt", and the Roman Egypt checkbox ticked, with a count of 34 beside it. But the result list is not narrowed: it shows 266 results, including items from other contexts such as the Adysh Gospels (Asia Minor and Caucasus).

Untick the Roman Egypt checkbox and the count changes to 250; tick it again and the list narrows to the expected 34 items (Bankes Homer, Codex Alexandrinus, and so on). So the refinement is only applied once the reader touches it.

Why it matters

The stacked timeline embed's "Filtered search" link sends readers to exactly this kind of URL, so the feature Paul Dilley was promised (click a timeline bar, see the items from that geopolitical context) lands on a page that looks filtered but is not. Until this is fixed the link mode should not be switched on for client sites.

Where to look

The search state is restored from the URL by the routing returned by TypesenseUtils.createRouting (core-data package) and the refinement widgets are mounted by Facets.tsx in this repo. The initial UI state reaches the widgets (the checkbox renders ticked) but the search parameters sent to Typesense do not include the refinement on the first request. Seen at v1.11.0 with core-data 3.1.25.

Related: performant-software/gwc-content#11.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions