@@ -90,14 +90,15 @@ const checkIcons = {
9090 done : '<span style="color: green;">✔</span>' ,
9191 error : '❌' ,
9292}
93-
93+ // TODO: Commenting out this code to do a better UX in the V2 version after science support
94+ /*
9495interface StepStatus {
9596 step: TestGenerationBuildStep
9697 status: 'wait' | 'current' | 'done' | 'error'
9798}
9899
99100const stepStatuses: StepStatus[] = []
100-
101+ */
101102export const testGenBuildProgressMessage = ( currentStep : TestGenerationBuildStep , status ?: string ) => {
102103 const session = ChatSessionManager . Instance . getSession ( )
103104 let message = `Sure. This may take a few minutes and I'll update the progress here.\n
@@ -107,6 +108,21 @@ export const testGenBuildProgressMessage = (currentStep: TestGenerationBuildStep
107108 return message . trim ( )
108109 }
109110
111+ if ( currentStep === TestGenerationBuildStep . RUN_BUILD ) {
112+ message += `${ checkIcons [ 'wait' ] } Project compiling\n\n`
113+ }
114+ if ( currentStep === TestGenerationBuildStep . FIXING_TEST_CASES && session . buildStatus === BuildStatus . FAILURE ) {
115+ message += `${ checkIcons [ 'wait' ] } Fixing test failures\n\n`
116+ } else if (
117+ currentStep >= TestGenerationBuildStep . FIXING_TEST_CASES &&
118+ session . buildStatus === BuildStatus . FAILURE
119+ ) {
120+ message += `${ checkIcons [ 'done' ] } Fixed test failures\n\n`
121+ }
122+ if ( currentStep > TestGenerationBuildStep . RUN_BUILD && session . buildStatus === BuildStatus . SUCCESS ) {
123+ message += `${ checkIcons [ 'done' ] } Project compiled\n${ checkIcons [ 'done' ] } All tests passed\n\n`
124+ }
125+ /*
110126 updateStepStatuses(currentStep, status)
111127
112128 if (currentStep >= TestGenerationBuildStep.RUN_BUILD) {
@@ -135,15 +151,15 @@ export const testGenBuildProgressMessage = (currentStep: TestGenerationBuildStep
135151 ) {
136152 message += `${checkIcons['done']} Fixed test failures\n\n`
137153 }
138-
154+ */
139155 if ( currentStep > TestGenerationBuildStep . PROCESS_TEST_RESULTS && session . buildStatus === BuildStatus . FAILURE ) {
140156 message += `**Results**\n
141157Amazon Q executed the tests and identified at least one failure. Below are the suggested fixes.\n\n`
142158 }
143159
144160 return message . trim ( )
145161}
146-
162+ /*
147163const updateStepStatuses = (currentStep: TestGenerationBuildStep, status?: string) => {
148164 const session = ChatSessionManager.Instance.getSession()
149165 for (let step = TestGenerationBuildStep.INSTALL_DEPENDENCIES; step <= currentStep; step++) {
@@ -176,3 +192,4 @@ const getIconForStep = (step: TestGenerationBuildStep) => {
176192 const stepStatus = stepStatuses.find((s) => s.step === step)
177193 return stepStatus ? checkIcons[stepStatus.status] : checkIcons.wait
178194}
195+ */
0 commit comments