Code Insights: Add code insights beta modal UI
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 |
---|---|
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
- Go to any code insights-related page.
- You should see this free beta modal UI
- Maybe a later button should lead you to the homepage.
- If you go back to any insights-related page you should see modal UI.
- 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
- 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)
- 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.
- Turn off code insights by
"codeInsights": false
in theexperimentalFeatures
section. - See no insights specific navbar, pages, buttons on the search page.
Before merging this PR
- Check the latest copy for this modal here https://docs.google.com/document/d/1VaC3XN2K-cNiBKdJ_pSH61Mye6yozXhzhi5wP9ACShQ/edit# and change if needed
- Test modal UI appearance based on tests cases below from Joel and above about feature flag.
- Update feedback link based on this PR https://github.com/sourcegraph/sourcegraph/pull/24979#pullrequestreview-755275161