Skip to content

Commit

Permalink
improvement: search page refinement ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstadler committed Dec 2, 2024
1 parent 3cbfd6a commit 4e27d71
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/[locale]/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function FilterMenu(props: { attribute: string }) {
<>
<div className="text-right text-lg font-medium">
{
// TODO if count == 0, hide altogether
// eslint-disable-next-line @typescript-eslint/no-explicit-any
t(props.attribute.replaceAll(".", "_") as any)
}
Expand All @@ -29,7 +30,7 @@ function FilterMenu(props: { attribute: string }) {
}}
showMore={true}
showMoreLimit={100}
sortBy={["count", "name"]}
sortBy={["isRefined", "count", "name"]}
// TODO pass translations
// translations={{
// showMoreButtonText({ isShowingMore }) {
Expand All @@ -53,13 +54,16 @@ export default function SearchPage() {
translator: "contains.translators.name" as const,
}}
>
<FilterMenu attribute="language" />
<FilterMenu attribute="contains.work.short_title" />

<FilterMenu attribute="language" />

{
// TODO pass transform
// FIXME when changing the query removes a refinement from the list, that refinement
// should become inactive!? otherwise it's not clear that it's still toggled...
// TODO pass transform
// <FilterMenu attribute="contains.work.category" />
}
<FilterMenu attribute="contains.work.category" />

<FilterMenu attribute="contains.translators.name" />
</InstantSearchView>
Expand Down

0 comments on commit 4e27d71

Please sign in to comment.