Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(recommend): add Trending-Facets model #6556

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

raed667
Copy link
Contributor

@raed667 raed667 commented Feb 10, 2025

Summary

Add Recommend model trending-facets

TODO

  • Fix legacy algoliasearch v4 type issue
  • Figure out what to do with sendEvent (Recommend analytics does not support trending-facets)
  • Fix duplicated type definitions
  • Implement tests

@raed667 raed667 requested review from marialungu, dhayab, sarahdayan and aymeric-giraudet and removed request for marialungu February 10, 2025 07:16
Copy link

codesandbox-ci bot commented Feb 10, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9fb4690:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@raed667 raed667 force-pushed the feat/recommend/trending-facets branch from c0c390d to 6e760d8 Compare February 10, 2025 07:41
@raed667 raed667 force-pushed the feat/recommend/trending-facets branch from 6e760d8 to bc997e5 Compare February 10, 2025 07:56
@raed667
Copy link
Contributor Author

raed667 commented Feb 10, 2025

@algolia/frontend-experiences-web hi team, this is not urgent, but can someone help figure out go the fix the V4 types 🙏 ?

@@ -0,0 +1,6 @@
import type { TrendingFacetHit as Base } from 'algoliasearch/lite';
Copy link
Contributor

@Haroenv Haroenv Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want to import this in the algoliasearch.d.ts file in the helper and correctly ts-ignore, and pass the relevant type of v3 (any?), v4 and v5

@raed667 raed667 force-pushed the feat/recommend/trending-facets branch 2 times, most recently from c077e94 to c02fee6 Compare February 10, 2025 09:04
@@ -19,7 +19,7 @@ import type {
Renderer,
SendEventForHits,
} from '../types';
import type { TrendingFacetHit as Base } from 'algoliasearch/lite';
import type { TrendingFacetHit as Base } from 'instantsearch.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should import from ../types

@raed667 raed667 force-pushed the feat/recommend/trending-facets branch from c02fee6 to 9137cc8 Compare February 10, 2025 10:08
Renderer,
SendEventForHits,
} from '../types';
import type { TrendingFacetHit } from 'algoliasearch';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should also be in the helper or just retyped { objectID: string, facetValue: string}?

@raed667 raed667 force-pushed the feat/recommend/trending-facets branch 2 times, most recently from cb6e6d3 to 2806db3 Compare February 11, 2025 10:26
@raed667 raed667 force-pushed the feat/recommend/trending-facets branch from 2806db3 to be5ab5c Compare February 11, 2025 10:37
@Haroenv
Copy link
Contributor

Haroenv commented Feb 11, 2025

Originally we didn't implement trending facets as it's not clear how we want to incorporate the filtering / links inside it, as it could be many different attributes, refinement types.

However, it makes sense to be able to fully deprecate the old recommend widgets, and so we'll need trending facets too.

What we'll need to be able to later create a filtering directly from this widget I think is to make the itemComponent required here, so changing the default isn't a breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants