Skip to content

perf: Refactor imports and clean up unused variables across multiple components#447

Merged
Roopan-Microsoft merged 1 commit intodevfrom
psl-codequality-cps
Mar 12, 2026
Merged

perf: Refactor imports and clean up unused variables across multiple components#447
Roopan-Microsoft merged 1 commit intodevfrom
psl-codequality-cps

Conversation

@VishalS-Microsoft
Copy link
Contributor

@VishalS-Microsoft VishalS-Microsoft commented Mar 12, 2026

Purpose

This pull request primarily refactors import statements across multiple files in the codebase to remove unused imports and streamline dependencies. It also includes minor code cleanups and state reset improvements. These changes help reduce bundle size, improve code readability, and prevent potential issues caused by unused code.

Import statement cleanup and optimization

  • Removed unused imports such as PayloadAction, makeStyles, useHeaderHooks, githubDarkTheme, and others from various files including centerPanelSlice.ts, defaultPageSlice.ts, rightPanelSlice.ts, Header.tsx, JSONEditor.tsx, and index.tsx. [1] [2] [3] [4] [5] [6]
  • Cleaned up imports in authentication-related files, removing unnecessary MSAL imports in AuthWrapper.tsx.
  • Removed unused React hooks such as useCallback and useState from ProcessSteps.tsx and HomePage.tsx. [1] [2]
  • Removed unnecessary imports from PanelRight.tsx.

Codebase simplification

  • Removed unused utility functions and variables, such as useScrollbarWidth, useFluent, and targetDocument from ProcessQueueGrid.tsx. [1] [2]
  • Cleaned up table selection logic by removing unused properties in ProcessQueueGrid.tsx.
  • Removed unused error handling logic in httpUtility.ts.

Minor functional improvements

  • Improved state reset logic in UploadFilesModal.tsx by properly terminating the function with a semicolon.

19 findings:

image

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes unused imports and variables across multiple frontend components, along with a minor semicolon fix. These are straightforward cleanup changes that reduce noise and slightly improve bundle size.

Changes:

  • Removed unused imports (PayloadAction, makeStyles, useHeaderHooks, githubDarkTheme, MSAL imports, React hooks, etc.) from 11 files
  • Removed unused variables (isNetworkError, targetDocument, unused table selection destructured properties)
  • Added missing semicolon in UploadFilesModal.tsx state reset function

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
centerPanelSlice.ts Removed unused PayloadAction import
defaultPageSlice.ts Removed unused createAsyncThunk, PayloadAction imports
rightPanelSlice.ts Removed unused toast import
AuthWrapper.tsx Removed unused MSAL imports
httpUtility.ts Removed unused isNetworkError variable
HomePage.tsx Removed unused useState import
DefaultPage/index.tsx Removed unused makeStyles import
PanelRight.tsx Removed unused updatePanelCollapse import
ProcessSteps.tsx Removed unused useCallback import
ProcessQueueGrid.tsx Removed unused imports and destructured variables
UploadFilesModal.tsx Added missing semicolon
JSONEditor.tsx Removed unused JsonEditorProps, githubDarkTheme imports
Header.tsx Removed unused useHeaderHooks import

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Collaborator

@AjitPadhi-Microsoft AjitPadhi-Microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good.

@Roopan-Microsoft Roopan-Microsoft merged commit 737c426 into dev Mar 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants