From 0e5daee5f5cfbf8a30e062d51e64bbe97ee2e96f Mon Sep 17 00:00:00 2001 From: Kanchan-Microsoft Date: Thu, 21 May 2026 16:51:49 +0530 Subject: [PATCH 1/3] refactor: clean up imports and remove unused code across multiple components --- .../ProgressModal/progressModal.tsx | 4 ---- .../src/components/batchHistoryPanel.tsx | 2 +- src/frontend/src/components/bottomBar.tsx | 1 - src/frontend/src/main.jsx | 16 ------------- src/frontend/src/pages/batchView.tsx | 2 +- src/frontend/src/pages/landingPage.tsx | 8 +++---- src/frontend/src/pages/modernizationPage.tsx | 23 ++----------------- src/frontend/src/pages/processPage.tsx | 4 ---- 8 files changed, 7 insertions(+), 53 deletions(-) diff --git a/src/frontend/src/commonComponents/ProgressModal/progressModal.tsx b/src/frontend/src/commonComponents/ProgressModal/progressModal.tsx index f800e29e..1b4d066c 100644 --- a/src/frontend/src/commonComponents/ProgressModal/progressModal.tsx +++ b/src/frontend/src/commonComponents/ProgressModal/progressModal.tsx @@ -271,10 +271,6 @@ const ProgressModal: React.FC = ({ const actionsMatch = raw.match(/📊\s*(\d+)\s*actions?/); const actionCount = actionsMatch ? parseInt(actionsMatch[1]) : 0; - // Extract blocking info from 🚧 segment - const blockingMatch = raw.match(/🚧\s*Blocking\s*(\d+)/); - const blockingCount = blockingMatch ? parseInt(blockingMatch[1]) : 0; - // Special handling for Coordinator: parse routing info from message let coordinatorTarget = ''; let coordinatorInstruction = ''; diff --git a/src/frontend/src/components/batchHistoryPanel.tsx b/src/frontend/src/components/batchHistoryPanel.tsx index d180b78c..a9a2d3d7 100644 --- a/src/frontend/src/components/batchHistoryPanel.tsx +++ b/src/frontend/src/components/batchHistoryPanel.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect } from "react"; import { useDispatch, useSelector } from 'react-redux'; import { Card, Spinner, Tooltip } from "@fluentui/react-components"; diff --git a/src/frontend/src/components/bottomBar.tsx b/src/frontend/src/components/bottomBar.tsx index e43aa3d9..c2702d2e 100644 --- a/src/frontend/src/components/bottomBar.tsx +++ b/src/frontend/src/components/bottomBar.tsx @@ -1,6 +1,5 @@ import { Button, Card, Dropdown, DropdownProps, Option } from "@fluentui/react-components" import React from "react" -import { useNavigate } from "react-router-dom" // Define possible upload states const UploadState = { diff --git a/src/frontend/src/main.jsx b/src/frontend/src/main.jsx index 8cdbeda1..4d31d4b4 100644 --- a/src/frontend/src/main.jsx +++ b/src/frontend/src/main.jsx @@ -106,22 +106,6 @@ const Main = () => { initMsal(); // Call the async function inside useEffect }, []); - async function checkConnection() { - if (!config) return; - - const baseURL = config.API_URL.replace(/\/api$/, ''); // Remove '/api' if it appears at the end - console.log('Checking connection to:', baseURL); - try { - const response = await fetch(`${baseURL}/health`); - if (response.ok) { - console.log('========> Backend connection successful'); - } else { - console.log('========> Backend responded with error status:', response.status); - } - } catch (error) { - console.log('========> Backend not available (this is okay for frontend-only testing):', error.message); - } - } // useEffect(() => { // if (config) { diff --git a/src/frontend/src/pages/batchView.tsx b/src/frontend/src/pages/batchView.tsx index 0f40c131..cad270fd 100644 --- a/src/frontend/src/pages/batchView.tsx +++ b/src/frontend/src/pages/batchView.tsx @@ -38,7 +38,7 @@ import PanelRight from "../components/Panels/PanelRight"; import PanelRightToolbar from "../components/Panels/PanelRightToolbar"; import BatchHistoryPanel from "../components/batchHistoryPanel"; import ConfirmationDialog from "../commonComponents/ConfirmationDialog/confirmationDialogue"; -import { determineFileStatus, filesLogsBuilder, renderErrorSection, useStyles, renderFileError, filesErrorCounter, completedFiles, hasFiles, fileErrorCounter, BatchSummary, fileWarningCounter } from "../api/utils"; +import { renderErrorSection, useStyles, renderFileError, BatchSummary, fileErrorCounter } from "../api/utils"; export const History = bundleIcon(HistoryFilled, HistoryRegular); import { format } from "sql-formatter"; diff --git a/src/frontend/src/pages/landingPage.tsx b/src/frontend/src/pages/landingPage.tsx index 619ee84d..88a3d72d 100644 --- a/src/frontend/src/pages/landingPage.tsx +++ b/src/frontend/src/pages/landingPage.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, useState } from "react"; +import React, { useEffect } from "react"; import { useSelector, useDispatch } from "react-redux"; import { RootState } from "../store/store"; import { togglePanel, closePanel } from "../slices/historyPanelSlice"; @@ -32,10 +32,8 @@ export const LandingPage = (): JSX.Element => { dispatch(resetState()); }, [dispatch]); - const [uploadState, setUploadState] = useState<"IDLE" | "UPLOADING" | "COMPLETED">('IDLE'); - - const handleUploadStateChange = (state) => { - setUploadState(state); + const handleUploadStateChange = (_state) => { + // State change handler - currently unused but kept for future use }; const handleStartTranslating = async () => { diff --git a/src/frontend/src/pages/modernizationPage.tsx b/src/frontend/src/pages/modernizationPage.tsx index 421f5bd2..dc32c831 100644 --- a/src/frontend/src/pages/modernizationPage.tsx +++ b/src/frontend/src/pages/modernizationPage.tsx @@ -29,7 +29,7 @@ import { Light as SyntaxHighlighter } from "react-syntax-highlighter" import { vs } from "react-syntax-highlighter/dist/esm/styles/hljs" import sql from "react-syntax-highlighter/dist/cjs/languages/hljs/sql" import { useNavigate, useParams } from "react-router-dom" -import { useState, useEffect, useCallback, useRef } from "react" +import { useState, useEffect } from "react" import { getApiUrl, headerBuilder } from '../api/config'; import BatchHistoryPanel from "../components/batchHistoryPanel" import PanelRight from "../components/Panels/PanelRight"; @@ -412,25 +412,6 @@ const fetchBatchSummary = async (batchId: string): Promise => { } }; - -enum ProcessingStage { - NotStarted = 1, - Queued = 10, - Starting = 20, - Parsing = 40, - Processing = 60, - FinalChecks = 95, - Completed = 100 -} - -enum Agents { - Verifier = "Semantic Verifier agent", - Checker = "Syntax Checker agent", - Picker = "Picker agent", - Migrator = "Migrator agent", - Agents = "Agent" -} - const getPrintFileStatus = (status: string): string => { switch (status) { case "completed": @@ -481,7 +462,7 @@ const ModernizationPage = () => { const selectedFile = files.find((f) => f.id === selectedFileId); if (!selectedFile || !selectedFile.translatedCode) { setFileLoading(true); - const newFileUpdate = await fetchFileFromAPI(selectedFile?.fileId || ""); + const _newFileUpdate = await fetchFileFromAPI(selectedFile?.fileId || ""); setFileLoading(false); } diff --git a/src/frontend/src/pages/processPage.tsx b/src/frontend/src/pages/processPage.tsx index a85f8d30..10740664 100644 --- a/src/frontend/src/pages/processPage.tsx +++ b/src/frontend/src/pages/processPage.tsx @@ -3,10 +3,6 @@ import { useSelector, useDispatch } from "react-redux"; import { useNavigate, useParams } from "react-router-dom"; import { RootState } from "../store/store"; import { togglePanel, closePanel } from "../slices/historyPanelSlice"; -import { - Button, - Tooltip, -} from "@fluentui/react-components"; import { MessageBar, MessageBarType } from "@fluentui/react"; import Header from "../components/Header/Header"; import HeaderTools from "../components/Header/HeaderTools"; From 59a5950cd20c48d2945cba09c3385bc057e45cc9 Mon Sep 17 00:00:00 2001 From: Kanchan-Microsoft Date: Mon, 25 May 2026 15:36:03 +0530 Subject: [PATCH 2/3] copilot fixes --- src/frontend/src/components/batchHistoryPanel.tsx | 2 +- src/frontend/src/pages/batchView.tsx | 2 +- src/frontend/src/pages/modernizationPage.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/components/batchHistoryPanel.tsx b/src/frontend/src/components/batchHistoryPanel.tsx index a9a2d3d7..d180b78c 100644 --- a/src/frontend/src/components/batchHistoryPanel.tsx +++ b/src/frontend/src/components/batchHistoryPanel.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useState, useEffect, useRef } from "react"; import { useDispatch, useSelector } from 'react-redux'; import { Card, Spinner, Tooltip } from "@fluentui/react-components"; diff --git a/src/frontend/src/pages/batchView.tsx b/src/frontend/src/pages/batchView.tsx index cad270fd..f3ffba29 100644 --- a/src/frontend/src/pages/batchView.tsx +++ b/src/frontend/src/pages/batchView.tsx @@ -38,7 +38,7 @@ import PanelRight from "../components/Panels/PanelRight"; import PanelRightToolbar from "../components/Panels/PanelRightToolbar"; import BatchHistoryPanel from "../components/batchHistoryPanel"; import ConfirmationDialog from "../commonComponents/ConfirmationDialog/confirmationDialogue"; -import { renderErrorSection, useStyles, renderFileError, BatchSummary, fileErrorCounter } from "../api/utils"; +import { renderErrorSection, useStyles, renderFileError, BatchSummary } from "../api/utils"; export const History = bundleIcon(HistoryFilled, HistoryRegular); import { format } from "sql-formatter"; diff --git a/src/frontend/src/pages/modernizationPage.tsx b/src/frontend/src/pages/modernizationPage.tsx index dc32c831..ef96f286 100644 --- a/src/frontend/src/pages/modernizationPage.tsx +++ b/src/frontend/src/pages/modernizationPage.tsx @@ -462,7 +462,7 @@ const ModernizationPage = () => { const selectedFile = files.find((f) => f.id === selectedFileId); if (!selectedFile || !selectedFile.translatedCode) { setFileLoading(true); - const _newFileUpdate = await fetchFileFromAPI(selectedFile?.fileId || ""); + await fetchFileFromAPI(selectedFile?.fileId || ""); setFileLoading(false); } From 970822db14095bfc5d263a45cec3cb5ac44df06c Mon Sep 17 00:00:00 2001 From: Shreyas-Microsoft Date: Wed, 27 May 2026 12:02:23 +0530 Subject: [PATCH 3/3] chore: regenerate infra/main.json with Bicep CLI 0.43.8 PR #254 (dev -> main) shows infra/main.json on dev was last generated with Bicep CLI 0.42.1.51946, while main is already on 0.43.8.12551. This is a downgrade in the merge surface. Recompiled infra/main.bicep using Azure CLI's bundled Bicep (0.43.8.12551) so the generator metadata on dev matches what's already in main. The bicep source is unchanged; only the four _generator blocks (root + three nested modules) and their templateHash values are updated. Once this lands on dev, regenerating against PR #254 will no longer show a Bicep version downgrade on infra/main.json. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- infra/main.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/infra/main.json b/infra/main.json index df3ac114..67cbf372 100644 --- a/infra/main.json +++ b/infra/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.42.1.51946", - "templateHash": "16235959711463268871" + "version": "0.43.8.12551", + "templateHash": "2561563027340256551" } }, "parameters": { @@ -4717,8 +4717,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.42.1.51946", - "templateHash": "2245351167779444314" + "version": "0.43.8.12551", + "templateHash": "4604761290796021104" } }, "definitions": { @@ -27476,8 +27476,8 @@ }, "dependsOn": [ "appIdentity", - "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]", "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]", + "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]", "virtualNetwork" ] }, @@ -31449,8 +31449,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.42.1.51946", - "templateHash": "16866311185741009453" + "version": "0.43.8.12551", + "templateHash": "13516349791985095953" } }, "definitions": { @@ -35199,8 +35199,8 @@ }, "dependsOn": [ "aiFoundryAiServices", - "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]", "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]", + "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]", "[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]", "virtualNetwork" ] @@ -35238,8 +35238,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.42.1.51946", - "templateHash": "16351752584270870112" + "version": "0.43.8.12551", + "templateHash": "17583277036649944863" } }, "parameters": {