Skip to content

Code Insights: Refactor capture group live preview

Administrator requested to merge vk/refactor-capture-group-live-preview into main

Created by: vovakulikov

Based on https://github.com/sourcegraph/sourcegraph/pull/33609 Closes part of https://github.com/sourcegraph/sourcegraph/issues/32944

Background

This PR migrates capture group insights live preview from old live preview abstractions (god like components) to low-level abstractions for building insight card and live preview insight in particular. It's very similar that we've done in this PR https://github.com/sourcegraph/sourcegraph/pull/33609 for search based and for lang insights live previews before. To achieve this this PR introduces a new abstraction components over InsightCard components for building live preview cards UI (on creation UI pages and the landing page) - see LivePreviewCard components.

This PR also extracts the live preview fetching logic into separate re-usable hook and therefore simplifies live preview logic for all live previews besides capture group.

Test plan

  • Make sure that all preview charts have the right layout
  • Make sure that all preview charts send minimum number of request during falling out form fields (that debouncing works properly)
  • Make sure that dynamic insight example on the in product landing page works properly

App preview:

Merge request reports

Loading