Skip to content

Conversation

@lkwinta
Copy link
Contributor

@lkwinta lkwinta commented Apr 19, 2025

This pull request includes updates to dependencies, refactors to improve consistency in Grid component usage, and test updates to align with new component IDs. The most significant changes are grouped below:

Dependency Updates:

  • Updated several @mui packages (@mui/icons-material, @mui/lab, @mui/material, @mui/system, @mui/x-data-grid) to their latest versions.
  • Updated material-ui-popup-state to version ^5.3.5.
  • Added @types/node as a devDependency with version ^22.14.1.

Refactoring for Consistency:

  • Replaced xs prop with size in all Grid components across multiple files for consistency with the updated @mui library. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Removed redundant Grid2 imports and replaced them with Grid in ExamplePanel.tsx. [1] [2] [3]

Test Improvements:

  • Updated tests in FlukaConverter.test.ts and ShieldhitConverter.test.ts to use the newly defined id='generate-from-editor' for element selection instead of relying on dynamic XPath. [1] [2]

Minor Import Adjustments:

  • Simplified imports for Typography and SelectProps to remove redundant paths. [1] [2]

@lkwinta lkwinta requested a review from Copilot April 19, 2025 14:50
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 pull request upgrades MUI to v7 by updating import paths and component references to conform with the new version while fixing deep imports. Key changes include:

  • Replacing legacy Grid imports with the GridLegacy alias in several components.
  • Switching deep imports (e.g. for Select and Typography) to their public API entry points.
  • Updating component usage (e.g. replacing Grid2 with Grid) in ExamplePanel.

Reviewed Changes

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

Show a summary per file
File Description
src/WrapperApp/components/Simulation/SimulationCardGrid.tsx Updated Grid imports to use GridLegacy and GridLegacyProps.
src/WrapperApp/components/Panels/ExamplePanel.tsx Replaced Grid2 with Grid from '@mui/material'.
src/ThreeEditor/components/ZoneManagerPanel/GeometryIdSelect.tsx Fixed deep import by switching from '@mui/material/Select/Select' to '@mui/material/Select'.
src/ThreeEditor/components/Sidebar/properties/fields/PropertyField.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/ZoneOperations.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/OutputConfiguration.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/ObjectMaterial.tsx Corrected Typography deep import.
src/ThreeEditor/components/Sidebar/properties/category/ObjectInfo.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/ObjectDimensions.tsx Updated Grid import to GridLegacy.
src/JsRoot/GraphData.tsx Updated Grid import to GridLegacy.
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/WrapperApp/components/Panels/ExamplePanel.tsx:1

  • [nitpick] The grid component import in ExamplePanel now uses Grid from '@mui/material' while other parts use GridLegacy. Consider unifying grid imports for consistent usage post upgrade.
import { Box, Grid, Paper, Typography } from '@mui/material';

@grzanka
Copy link
Contributor

grzanka commented Apr 19, 2025

@lkwinta I see tests are still failing

kmichalikk
kmichalikk previously approved these changes Apr 19, 2025
Ciorolla
Ciorolla previously approved these changes Apr 20, 2025
@grzanka grzanka requested a review from Copilot April 22, 2025 07:25
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 upgrades the MUI dependencies to v7 by updating package versions, adjusting imports to use the proper Grid components and Typography paths as required by the new MUI changes, and improving test reliability by switching from an XPath‐based selector to an id-based selector for the “generate from editor” button.

  • Updated several @mui packages and third‑party dependencies in package.json.
  • Replaced imports (e.g. Grid → GridLegacy, adjusted Typography import and SelectProps path) to reflect MUI v7 changes.
  • Improved test stability by replacing unstable XPath selectors with id-based selectors.

Reviewed Changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/tests/ShieldhitConverter.test.ts Changed selector lookup from XPath to id; test comment still references XPath.
src/tests/FlukaConverter.test.ts Similar update to use id-based selector; comment needs updating.
src/WrapperApp/components/Simulation/SimulationCardGrid.tsx Replaced Grid with GridLegacy to match new MUI import changes.
src/WrapperApp/components/Panels/ExamplePanel.tsx Changed import from Grid2 to Grid; verify if using Grid here (vs. GridLegacy) is intended.
src/WrapperApp/components/InputEditor/InputEditorPanel.tsx Added id to LoadingButton to support the new id-based selector.
src/ThreeEditor/components/ZoneManagerPanel/GeometryIdSelect.tsx Adjusted SelectProps import path.
src/ThreeEditor/components/Sidebar/properties/fields/PropertyField.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/ZoneOperations.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/OutputConfiguration.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/ObjectMaterial.tsx Simplified Typography import.
src/ThreeEditor/components/Sidebar/properties/category/ObjectInfo.tsx Updated Grid import to GridLegacy.
src/ThreeEditor/components/Sidebar/properties/category/ObjectDimensions.tsx Updated Grid import to GridLegacy.
src/JsRoot/GraphData.tsx Updated Grid import to GridLegacy.
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/WrapperApp/components/Panels/ExamplePanel.tsx:1

  • [nitpick] Review the usage of Grid in ExamplePanel; if the migration intends to use GridLegacy consistently, confirm whether this file should also import GridLegacy instead of Grid.
import { Box, Grid, Paper, Typography } from '@mui/material';

Copy link
Contributor

@grzanka grzanka left a comment

Choose a reason for hiding this comment

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

Seem comments inline, take a look as well on the suggestions by copilot

@lkwinta lkwinta requested a review from Copilot April 22, 2025 10:10
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 upgrades the Material UI dependencies to v7 by updating package versions, adjusting import paths (e.g. switching from Grid2 to Grid and replacing xs with size), and improving test reliability by switching to id-based selectors.

  • Dependency updates and new devDependencies in package.json
  • Import adjustments and prop changes in various components
  • Test updates for stable element selection

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/tests/ShieldhitConverter.test.ts Updated test selector from XPath to id
src/tests/FlukaConverter.test.ts Updated test selector from XPath to id
src/WrapperApp/components/Simulation/SimulationCardGrid.tsx Changed grid item prop name from xs to size and added component id
src/WrapperApp/components/Panels/ExamplePanel.tsx Replaced Grid2 components with Grid for MUI v7
src/WrapperApp/components/InputEditor/InputEditorPanel.tsx Added id attribute to LoadingButton for element selection
src/ThreeEditor/components/ZoneManagerPanel/GeometryIdSelect.tsx Updated import path for SelectProps
src/ThreeEditor/components/Sidebar/properties/* Replaced xs prop with size prop in Grid elements and updated import paths accordingly
src/JsRoot/GraphData.tsx Updated Grid prop usage from xs to size
Files not reviewed (1)
  • package.json: Language not supported

@lkwinta lkwinta requested a review from Copilot April 22, 2025 10:13
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 upgrades the Material-UI dependencies to v7 and adjusts related code accordingly, while also improving test stability with more reliable element selectors.

  • Updated MUI packages and changed import paths to reflect new package structures
  • Replaced outdated grid properties (xs/item) with the new "size" syntax
  • Updated test selectors from XPath to id-based selectors

Reviewed Changes

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

Show a summary per file
File Description
src/tests/ShieldhitConverter.test.ts Updated button locator from XPath to id-based selection
src/tests/FlukaConverter.test.ts Updated button locator from XPath to id-based selection
src/WrapperApp/components/Simulation/SimulationCardGrid.tsx Replaced grid property xs with size and modified default grid props
src/WrapperApp/components/Panels/ExamplePanel.tsx Replaced Grid2 with Grid per updated MUI guidance
src/WrapperApp/components/InputEditor/InputEditorPanel.tsx Added id for the generate button
src/ThreeEditor/components/ZoneManagerPanel/GeometryIdSelect.tsx Adjusted the import path for SelectProps
src/ThreeEditor/components/Sidebar/properties/fields/PropertyField.tsx Updated grid properties for label and child field layout
src/ThreeEditor/components/Sidebar/properties/category/ZoneOperations.tsx Updated grid property usage
src/ThreeEditor/components/Sidebar/properties/category/OutputConfiguration.tsx Updated grid property usage
src/ThreeEditor/components/Sidebar/properties/category/ObjectMaterial.tsx Simplified Typography import path
src/ThreeEditor/components/Sidebar/properties/category/ObjectInfo.tsx Updated grid property usage for layout consistency
src/ThreeEditor/components/Sidebar/properties/category/ObjectDimensions.tsx Updated grid property usage
src/JsRoot/GraphData.tsx Updated grid property usage to match new MUI v7 syntax
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/WrapperApp/components/Simulation/SimulationCardGrid.tsx:87

  • Removing the default 'item: true' prop from gridItemProps may lead to unexpected behavior if child grid components do not explicitly set the 'item' property. Consider verifying that all grid items are correctly flagged as items or defaulting gridItemProps to include { item: true } where necessary.
let gridItemProps: GridProps = {}; // default grid item props

@grzanka grzanka requested a review from Copilot April 22, 2025 10:25
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 pull request upgrades the MUI dependencies to v7 and updates import paths and component prop usage to align with the new library conventions, while also improving element selection in tests.

  • Updated dependency versions and import paths for various @mui packages
  • Replaced Grid-related prop names (e.g. xs → size) across multiple components
  • Improved test reliability by switching from XPath to ID-based element selection

Reviewed Changes

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

Show a summary per file
File Description
src/tests/ShieldhitConverter.test.ts Updated element selector from XPath to ID
src/tests/FlukaConverter.test.ts Updated element selector from XPath to ID
src/WrapperApp/components/SimulationCardGrid.tsx Changed grid item props from xs to size and added a grid ID
src/WrapperApp/components/Panels/ExamplePanel.tsx Replaced Grid2 with Grid for consistency with MUI v7
src/WrapperApp/components/InputEditor/InputEditorPanel.tsx Added an ID to the LoadingButton for element selection
src/ThreeEditor/components/ZoneManagerPanel/GeometryIdSelect.tsx Adjusted import path for SelectProps
src/ThreeEditor/components/Sidebar/properties/fields/PropertyField.tsx Updated Grid prop from xs to size
src/ThreeEditor/components/Sidebar/properties/category/* Revised Grid props to use size instead of xs
src/JsRoot/GraphData.tsx Updated Grid props from xs to size for consistency
Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/WrapperApp/components/SimulationCardGrid.tsx:87

  • The default gridItemProps no longer includes the item: true flag compared to the previous version, which may affect the layout. Consider retaining an explicit item: true (or verifying that Grid automatically treats these as items in MUI v7) to ensure consistent behavior.
let gridItemProps: GridProps = {}; // default grid item props

@grzanka grzanka requested a review from Copilot April 22, 2025 17:15
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 pull request upgrades the MUI library to v7, updates related dependency versions, adjusts import paths, and improves test stability by switching element selectors.

  • Updated various @mui packages and material-ui-popup-state dependencies
  • Replaced deprecated import paths and props (e.g. Grid2/xs → Grid/size)
  • Improved test selectors by using stable id attributes

Reviewed Changes

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

Show a summary per file
File Description
src/tests/ShieldhitConverter.test.ts Replaced XPath selector with id selector for improved test reliability
src/tests/FlukaConverter.test.ts Replaced XPath selector with id selector for improved test reliability
src/WrapperApp/components/Simulation/SimulationCardGrid.tsx Updated grid props and added width to grid container for MUI v7 compatibility
src/WrapperApp/components/Panels/ExamplePanel.tsx Updated Grid2 imports to new Grid component consistent with the latest MUI changes
src/WrapperApp/components/InputEditor/InputEditorPanel.tsx Added id attribute to LoadingButton for test selection
src/ThreeEditor/components/ZoneManagerPanel/GeometryIdSelect.tsx Simplified SelectProps import path to align with new MUI structure
src/ThreeEditor/components/Sidebar/properties/fields/PropertyField.tsx Replaced deprecated xs prop with size prop in Grid components
src/ThreeEditor/components/Sidebar/properties/category/ZoneOperations.tsx Updated Grid component props from xs to size for consistency
src/ThreeEditor/components/Sidebar/properties/category/OutputConfiguration.tsx Updated Grid component prop from xs to size
src/ThreeEditor/components/Sidebar/properties/category/ObjectMaterial.tsx Updated Typography import path for a simpler structure
src/ThreeEditor/components/Sidebar/properties/category/ObjectInfo.tsx Replaced xs prop with size prop in Grid component
src/ThreeEditor/components/Sidebar/properties/category/ObjectDimensions.tsx Replaced xs prop with size prop in Grid component
src/JsRoot/GraphData.tsx Updated Grid props from xs to size for consistency with new MUI v7 API
Files not reviewed (1)
  • package.json: Language not supported

@grzanka grzanka added this pull request to the merge queue Apr 22, 2025
Merged via the queue into master with commit 1db380a Apr 22, 2025
8 checks passed
@grzanka grzanka deleted the 2001-bump-mui-upgrade branch April 22, 2025 17:17
lkwinta added a commit that referenced this pull request Apr 23, 2025
* upgrade mui to v7, fix GridLegacy imports and deepimports

* fix converter tests

* unnecessary file, test comments

* upgrade grid legacy to new grid

* copilot suggestion fix

* remove unecessary id

* fix simulation cards

* remove unnecessary console log
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.

5 participants