Add Use GitLab locally widget to the personal homepage

What does this MR do and why?

Adds a Use GitLab locally widget to the personal homepage for new users. It suggests installing a GitLab extension in the IDE (VS Code, JetBrains) or the GitLab CLI, so users who only work in the browser learn they can use GitLab from their editor and terminal.

  • The widget shows only to users with fewer than 5 sign-ins whose account is younger than 30 days.
  • It's behind the homepage_use_gitlab_locally_widget wip feature flag (user actor, checked in the backend).
  • Dismissal is stored as a use_gitlab_locally_homepage_widget user callout.
  • Removing the widget hides it right away and shows a toast with Undo. The callout is saved only when the toast closes without Undo, because there is no API to delete a dismissed callout.

Tracking (events and metrics) follows in a separate MR.

References

Screenshots or screen recordings

Before (no widget) After
image.png

How to set up and validate locally

  1. Enable the feature flag in the Rails console:

    Feature.enable(:homepage_use_gitlab_locally_widget)
  2. Create a new user (or use an existing account with fewer than 5 sign-ins, created in the last 30 days) and sign in as that user.

    Alternatively update the show_use_gitlab_locally_homepage_widget? method and comment these 2 checks (this is validated in the spcs):

    def show_use_gitlab_locally_homepage_widget?
      return false unless current_user
      return false unless Feature.enabled?(:homepage_use_gitlab_locally_widget, current_user)
      # return false if current_user.sign_in_count >= USE_GITLAB_LOCALLY_HOMEPAGE_WIDGET_MAX_SIGN_IN_COUNT
      # return false if current_user.created_at <= USE_GITLAB_LOCALLY_HOMEPAGE_WIDGET_MAX_ACCOUNT_AGE.ago
    
      !user_dismissed?(USE_GITLAB_LOCALLY_HOMEPAGE_WIDGET)
    end
  3. Visit the personal homepage at http://127.0.0.1:3000. The Use GitLab locally widget shows at the top of the right column.

  4. Expand each item and check that the links open the IDE extension setup docs and the GitLab CLI installation page in a new tab.

  5. Select the close button, then Undo in the toast. The widget comes back, and it still shows after a refresh.

  6. Select the close button again and wait for the toast to close. Refresh the page: the widget stays hidden.

  7. To show the widget again, delete the callout:

    User.find_by(username: '<username>').callouts.where(feature_name: 'use_gitlab_locally_homepage_widget').delete_all

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Marco Tomasi

Merge request reports

Loading
Loading