Skip to content

Fetch frecent groups and projects via the GraphQL API

Paul Gascou-Vaillancourt requested to merge 431045-graphql-frecent-items-fe into master

What does this MR do and why?

Fetch frecent groups and projects via the GraphQL API

Implements the frontend bits necessary to fetch frecent items through the GraphQL API and render them in the global search modal. This drops the localStorage-based frecency tracking. Users might see slightly different namespaces being suggested as we switch to a smarter scoring algorithm. Due to the tracking being done server-side, frecent items now persist across browsers. Namespaces that have been removed or that the user can't access (when SAML is required for example) are now properly excluded from the displayed list.

These changes are behind the disabled-by-default frecent_namespaces_suggestions feature flag.

Screenshots or screen recordings

frecent_items

How to set up and validate locally

  1. Enable the :frecent_namespaces_suggestions feature flag:
    echo "Feature.enable(:frecent_namespaces_suggestions)" | rails c
  2. In any page, open the global search modal (/ keyboard shortcut).
    • Notice that the Frequently visited projects and Frequently visited groups load items.
    • When the query resolves, you should see a list of namespaces you have frequently/recently (frecently) interacted with.
    • There should be more or less the same items as with the :frecent_namespaces_suggestions feature flag disabled, but you might notice some differences as the scoring algorithm boosts most recent visits.
    • If, for some reason1 you loose access to any namespace in the list, it should not show up anymore the next time frecent items are loaded.
    • You cannot manually remove a project from the list. The ability to remove a project was previously introduced as a workaround to some namespaces remaining in the list even though they had become unavailable (see previous point). This is now all handled server-side.
    • Note that your frecent items persist across browsers/devices since visits are now tracked server-side instead of client-side in the local storage.

1: You are removed from a private project's members, the project gets deleted, the project requires SAML sign-in, etc.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #431045 (closed)

Edited by Ammar Alakkad

Merge request reports