Skip to content

Code Insights: Add code insights beta modal UI

Administrator requested to merge vk/add-code-insights-beta-modal into main

Created by: vovakulikov

Closes: https://github.com/sourcegraph/sourcegraph/issues/24298, https://github.com/sourcegraph/sourcegraph/issues/24538

Context

This PR adds a modal UI for the code insights pages. This modal appears for all users but only once if users accepted Free Beta rules by clicking the Understood, let's try button. Maybe later button always leads to the homepage.

Light mode Dark Mode
Screenshot 2021-09-14 at 20 19 36 Screenshot 2021-09-14 at 20 19 48

Also, this PR turns on by default the code insights functionality. With that PR change, you can disable code insights by setting

"experimentalFeatures": {
 "codeInsights": false
}

Tech details

Information to show/hide this modal UI is stored by Temporary Settings. This PR also introduces a new field in temporary settings for this code insights modal case insights.acceptFreeBeta.

How to test

- Code Insights Free beta modal UI

  1. Go to any code insights-related page.
  2. You should see this free beta modal UI
  3. Maybe a later button should lead you to the homepage.
  4. If you go back to any insights-related page you should see modal UI.
  5. After click on the Understood, let's try button you should see no modal. Even if you reload the page or log in through a different browser.

- Code insights feature flag

  1. Go to sourcegraph.com homepage as a logout user. See that no code insights things have appeared (insights navbar item, create insights button on the search page, All insights specific routes such as /insights, insights/dashboard/all are disabled)
  2. Go to sourcegraph.com a sign-in user and see the insights nav bar, insights pages, insight creation UI, create insights button on the search page.
  3. Turn off code insights by "codeInsights": false in the experimentalFeatures section.
  4. See no insights specific navbar, pages, buttons on the search page.

Before merging this PR

Merge request reports

Loading