@@ -4,22 +4,19 @@ import type { ToModelAlertsMessage } from "../../common/interface-types";
44import type {
55 VariantAnalysis ,
66 VariantAnalysisScannedRepositoryResult ,
7- VariantAnalysisScannedRepositoryState ,
87} from "../../variant-analysis/shared/variant-analysis" ;
98import { vscode } from "../vscode-api" ;
109import { ModelAlertsHeader } from "./ModelAlertsHeader" ;
1110
1211type Props = {
1312 initialViewState ?: ModelAlertsViewState ;
1413 variantAnalysis ?: VariantAnalysis ;
15- repoStates ?: VariantAnalysisScannedRepositoryState [ ] ;
1614 repoResults ?: VariantAnalysisScannedRepositoryResult [ ] ;
1715} ;
1816
1917export function ModelAlerts ( {
2018 initialViewState,
2119 variantAnalysis : initialVariantAnalysis ,
22- repoStates : initialRepoStates = [ ] ,
2320 repoResults : initialRepoResults = [ ] ,
2421} : Props ) : React . JSX . Element {
2522 const onOpenModelPackClick = useCallback ( ( path : string ) => {
@@ -42,8 +39,6 @@ export function ModelAlerts({
4239 const [ variantAnalysis , setVariantAnalysis ] = useState <
4340 VariantAnalysis | undefined
4441 > ( initialVariantAnalysis ) ;
45- const [ repoStates , setRepoStates ] =
46- useState < VariantAnalysisScannedRepositoryState [ ] > ( initialRepoStates ) ;
4742 const [ repoResults , setRepoResults ] =
4843 useState < VariantAnalysisScannedRepositoryResult [ ] > ( initialRepoResults ) ;
4944
@@ -60,18 +55,6 @@ export function ModelAlerts({
6055 setVariantAnalysis ( msg . variantAnalysis ) ;
6156 break ;
6257 }
63- case "setRepoStates" : {
64- setRepoStates ( ( oldRepoStates ) => {
65- const newRepoIds = msg . repoStates . map ( ( r ) => r . repositoryId ) ;
66- return [
67- ...oldRepoStates . filter (
68- ( v ) => ! newRepoIds . includes ( v . repositoryId ) ,
69- ) ,
70- ...msg . repoStates ,
71- ] ;
72- } ) ;
73- break ;
74- }
7558 case "setRepoResults" : {
7659 setRepoResults ( ( oldRepoResults ) => {
7760 const newRepoIds = msg . repoResults . map ( ( r ) => r . repositoryId ) ;
@@ -121,10 +104,6 @@ export function ModelAlerts({
121104 onViewLogsClick = { onViewLogsClick }
122105 stopRunClick = { onStopRunClick }
123106 > </ ModelAlertsHeader >
124- < div >
125- < h3 > Repo states</ h3 >
126- < p > { JSON . stringify ( repoStates , null , 2 ) } </ p >
127- </ div >
128107 < div >
129108 < h3 > Repo results</ h3 >
130109 < p > { JSON . stringify ( repoResults , null , 2 ) } </ p >
0 commit comments