Skip to content

Upgrade to MUI v7#1241

Open
carojeandat wants to merge 7 commits into
mainfrom
caroline/upgrade-to-mui-v7
Open

Upgrade to MUI v7#1241
carojeandat wants to merge 7 commits into
mainfrom
caroline/upgrade-to-mui-v7

Conversation

@carojeandat

Copy link
Copy Markdown
Contributor

PR Summary

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@carojeandat, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7603fb7f-1324-4a7b-9989-3ad6dde84db4

📥 Commits

Reviewing files that changed from the base of the PR and between e02bfa0 and 8644eff.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (14)
  • demo/src/app.jsx
  • package.json
  • src/components/composite/customAGGrid/cell-renderers.tsx
  • src/components/ui/csvPicker/csv-picker.tsx
  • src/components/ui/reactHookForm/autocompleteInputs/MultipleAutocompleteInput.tsx
  • src/components/ui/reactHookForm/booleans/BooleanInput.tsx
  • src/components/ui/reactHookForm/text/TextInput.tsx
  • src/components/ui/reactHookForm/utils/HelperPreviousValue.tsx
  • src/features/parameters/common/widget/parameter-line-slider.tsx
  • src/features/parameters/network-visualizations/network-visualizations-parameters-dialog.tsx
  • src/features/parameters/pcc-min/pcc-min-parameters-dialog.tsx
  • src/features/parameters/security-analysis/security-analysis-parameters-dialog.tsx
  • src/features/parameters/voltage-init/voltage-init-parameters-dialog.tsx
  • stories/reactHookForm/expandableInput/ExpandableInput.stories.tsx
📝 Walkthrough

Walkthrough

Changes

MUI 7 migration

Layer / File(s) Summary
Dependency and Grid layout migration
package.json, demo/src/*, src/components/**, src/features/**
MUI packages are upgraded to version 7; Grid imports and GridItemProps layout types are migrated from Grid2 to Grid.
Component slot API migration
src/components/**, src/features/network-modifications/**, src/features/parameters/**, src/features/topBar/**
TextField, Autocomplete, Checkbox, Switch, Tabs, Tooltip, Dialog, and Accordion configurations use MUI slots and slotProps APIs.
Theme utility and supporting updates
src/features/network-modification-table/**, src/features/topBar/TopBar.tsx, src/components/**, demo/src/*
Standalone color helpers are replaced with theme methods, while existing adornments, chip rendering, accessibility attributes, and related MUI wiring are preserved through the updated APIs.

Suggested reviewers: antoinebhs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description is only a placeholder PR Summary and does not describe the actual changes. Replace the placeholder with a brief summary of the MUI v7 upgrade, including the version bump and deprecation updates.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: upgrading the project to MUI v7.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/components/ui/reactHookForm/text/ExpandingTextField.tsx (1)

55-63: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Migrate InputProps to slotProps.

InputProps was deprecated in MUI v6 and has been completely removed in MUI v7. Leaving this property intact will cause TextField to silently ignore the textOverflow styling and the data-testid.

Merge these configurations into the existing slotProps object below, using slotProps.input and slotProps.htmlInput.

🐛 Proposed fix
-        InputProps: {
-            style: {
-                textOverflow: 'ellipsis',
-                overflow: 'hidden', // disable scrolling
-                whiteSpace: 'pre',
-                resize: 'none', // or 'horizontal' for horizontal resizing
-            },
-            inputProps: { 'data-testid': 'DescriptionInputField' },
-        },
         helperText: <Typography variant="caption">{descriptionCounter}</Typography>,
         slotProps: {
+            input: {
+                style: {
+                    textOverflow: 'ellipsis',
+                    overflow: 'hidden', // disable scrolling
+                    whiteSpace: 'pre',
+                    resize: 'none', // or 'horizontal' for horizontal resizing
+                },
+            },
+            htmlInput: {
+                'data-testid': 'DescriptionInputField',
+            },
             formHelperText: {
                 sx: {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ui/reactHookForm/text/ExpandingTextField.tsx` around lines 55
- 63, Update the TextField configuration in ExpandingTextField to remove
deprecated InputProps and merge its styling into the existing slotProps.input
object. Move the data-testid configuration to slotProps.htmlInput, preserving
all current style values and the DescriptionInputField test identifier.
🧹 Nitpick comments (1)
src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx (1)

119-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use slotProps.htmlInput for native input attributes.

Nesting inputProps: { ... } inside slotProps.input applies those attributes to the underlying InputBase wrapper, where the inputProps prop is also deprecated in MUI v7. The recommended approach for setting native HTML element attributes (such as style, inputMode, pattern, or data-testid) on a TextField is to use the top-level slotProps.htmlInput slot instead.

  • src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx#L119-L132: Move this inputProps block to slotProps.htmlInput.
  • src/components/ui/reactHookForm/tableInputs/table-text-input.tsx#L45-L50: Move this inputProps block to slotProps.htmlInput.
  • src/components/ui/reactHookForm/text/UniqueNameInput.tsx#L105-L107: Move this inputProps block to slotProps.htmlInput.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx` around
lines 119 - 132, Native input attributes are incorrectly nested under the
deprecated inputProps within slotProps.input. In
src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx lines
119-132, src/components/ui/reactHookForm/tableInputs/table-text-input.tsx lines
45-50, and src/components/ui/reactHookForm/text/UniqueNameInput.tsx lines
105-107, move each inputProps block to the top-level slotProps.htmlInput while
preserving all existing attributes and behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@demo/src/equipment-search.tsx`:
- Around line 85-90: Update the Autocomplete input adornment in
demo/src/equipment-search.tsx#L85-L90 and demo/src/inline-search.tsx#L63-L68 to
retain params.InputProps.startAdornment while adding the Search icon, wrapping
the icon in MUI’s InputAdornment for correct spacing. Import InputAdornment from
`@mui/material` in both files as needed.

In `@src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx`:
- Around line 99-134: Deep-merge caller slotProps with each component’s local
slot configuration instead of allowing the local slotProps object to overwrite
it. Update
src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx:99-134 and
table-text-input.tsx:40-52 to preserve caller slotProps while merging local
input settings; update
src/components/ui/reactHookForm/text/ExpandingTextField.tsx:65-75 for
formHelperText, UniqueNameInput.tsx:101-109 for input, and
utils/TextFieldWithAdornment.tsx:88-95 for input, preserving nested htmlInput
and other caller-provided slots.

In `@src/features/parameters/dynamic-simulation/curve/common/grid-search.tsx`:
- Around line 68-78: Update the input slot configuration in the relevant
component so styles.searchSection is assigned directly to the slot’s sx
property, removing the nested input selector. Preserve the existing
startAdornment and disabled-dependent Search icon behavior.

---

Outside diff comments:
In `@src/components/ui/reactHookForm/text/ExpandingTextField.tsx`:
- Around line 55-63: Update the TextField configuration in ExpandingTextField to
remove deprecated InputProps and merge its styling into the existing
slotProps.input object. Move the data-testid configuration to
slotProps.htmlInput, preserving all current style values and the
DescriptionInputField test identifier.

---

Nitpick comments:
In `@src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx`:
- Around line 119-132: Native input attributes are incorrectly nested under the
deprecated inputProps within slotProps.input. In
src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx lines
119-132, src/components/ui/reactHookForm/tableInputs/table-text-input.tsx lines
45-50, and src/components/ui/reactHookForm/text/UniqueNameInput.tsx lines
105-107, move each inputProps block to the top-level slotProps.htmlInput while
preserving all existing attributes and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c8b20535-ef5e-48f2-861f-ae7e88efd9e9

📥 Commits

Reviewing files that changed from the base of the PR and between bc3e3ce and e02bfa0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (34)
  • demo/src/equipment-search.tsx
  • demo/src/inline-search.tsx
  • package.json
  • src/components/composite/agGridTable/BottomTableButtons.tsx
  • src/components/composite/customAGGrid/custom-aggrid-filters/custom-aggrid-text-filter.tsx
  • src/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.tsx
  • src/components/composite/flatParameters/FlatParameters.tsx
  • src/components/composite/report/QuickSearch.tsx
  • src/components/ui/inputs/SelectClearable.tsx
  • src/components/ui/reactHookForm/CheckboxNullableInput.tsx
  • src/components/ui/reactHookForm/autocompleteInputs/AutocompleteInput.tsx
  • src/components/ui/reactHookForm/chip-items-input.tsx
  • src/components/ui/reactHookForm/readOnly/ButtonReadOnlyInput.tsx
  • src/components/ui/reactHookForm/readOnly/ReadOnlyInput.tsx
  • src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx
  • src/components/ui/reactHookForm/tableInputs/table-text-input.tsx
  • src/components/ui/reactHookForm/text/ExpandingTextField.tsx
  • src/components/ui/reactHookForm/text/UniqueNameInput.tsx
  • src/components/ui/reactHookForm/utils/TextFieldWithAdornment.tsx
  • src/features/network-modification-table/renderers/name-cell.tsx
  • src/features/network-modifications/battery/modification/BatteryDialogHeader.tsx
  • src/features/network-modifications/battery/modification/BatteryDialogTabs.tsx
  • src/features/network-modifications/generator/modification/GeneratorDialogHeader.tsx
  • src/features/network-modifications/generator/modification/GeneratorDialogTabs.tsx
  • src/features/network-modifications/load/common/LoadDialogHeader.tsx
  • src/features/network-modifications/load/common/LoadDialogTabs.tsx
  • src/features/network-modifications/substation/modification/SubstationModificationForm.tsx
  • src/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.tsx
  • src/features/network-modifications/voltageLevel/modification/VoltageLevelModificationForm.tsx
  • src/features/parameters/common/parameters.tsx
  • src/features/parameters/dynamic-simulation/curve/common/grid-search.tsx
  • src/features/parameters/voltage-init/voltage-init-parameters-form.tsx
  • src/features/topBar/AboutDialog.tsx
  • src/features/topBar/UserSettingsDialog.tsx
💤 Files with no reviewable changes (1)
  • src/features/network-modification-table/renderers/name-cell.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/features/network-modifications/substation/modification/SubstationModificationForm.tsx
  • src/features/network-modifications/voltageLevel/creation/VoltageLevelCreationForm.tsx
  • src/features/network-modifications/battery/modification/BatteryDialogHeader.tsx
  • src/features/topBar/AboutDialog.tsx
  • src/components/composite/filter/explicitNaming/ExplicitNamingFilterForm.tsx
  • src/features/parameters/voltage-init/voltage-init-parameters-form.tsx
  • src/components/composite/flatParameters/FlatParameters.tsx
  • package.json
  • src/components/composite/agGridTable/BottomTableButtons.tsx

Comment on lines +85 to +90
slotProps={{
input: {
...params.InputProps,
startAdornment: <Search color="disabled" />,
},
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve params.InputProps.startAdornment and wrap the icon in InputAdornment.

Overriding startAdornment entirely will drop any tags or elements that Autocomplete might place there. Additionally, providing a raw <Search /> icon instead of wrapping it in <InputAdornment> can lead to misalignment in the input field.

Apply this fix to both sites to preserve Autocomplete's adornments and correct the layout spacing (ensure InputAdornment is imported from @mui/material):

  • demo/src/equipment-search.tsx#L85-L90: Use the proposed fix below.
  • demo/src/inline-search.tsx#L63-L68: Use the proposed fix below.
♻️ Proposed fix
                         slotProps={{
                             input: {
                                 ...params.InputProps,
-                                startAdornment: <Search color="disabled" />,
+                                startAdornment: (
+                                    <>
+                                        <InputAdornment position="start">
+                                            <Search color="disabled" />
+                                        </InputAdornment>
+                                        {params.InputProps.startAdornment}
+                                    </>
+                                ),
                             },
                         }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
slotProps={{
input: {
...params.InputProps,
startAdornment: <Search color="disabled" />,
},
}}
slotProps={{
input: {
...params.InputProps,
startAdornment: (
<>
<InputAdornment position="start">
<Search color="disabled" />
</InputAdornment>
{params.InputProps.startAdornment}
</>
),
},
}}
📍 Affects 2 files
  • demo/src/equipment-search.tsx#L85-L90 (this comment)
  • demo/src/inline-search.tsx#L63-L68
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@demo/src/equipment-search.tsx` around lines 85 - 90, Update the Autocomplete
input adornment in demo/src/equipment-search.tsx#L85-L90 and
demo/src/inline-search.tsx#L63-L68 to retain params.InputProps.startAdornment
while adding the Search icon, wrapping the icon in MUI’s InputAdornment for
correct spacing. Import InputAdornment from `@mui/material` in both files as
needed.

Comment on lines +99 to 134
{...(hideErrorMessage ? {} : genHelperError(error?.message))}
{...props}
slotProps={{
input: {
endAdornment: (
<InputAdornment position="end">
{transformedValue && adornment?.text}
{clearable && (
<IconButton
onClick={handleClearValue}
style={{
visibility: clearable ? 'visible' : 'hidden',
}}
>
<ClearIcon />
</IconButton>
)}
</InputAdornment>
),
disableInjectingGlobalStyles: true, // disable auto-fill animations and increase rendering perf
inputProps: {
style: {
fontSize: 'small',
color:
previousValue !== undefined && previousValue === parseFloat(value) && !valueModified
? 'grey'
: undefined, // grey out the value if it is the same as the previous one
textAlign: style?.textAlign ?? 'left',
},
inputMode: 'numeric',
pattern: '[0-9]*',
lang: 'en-US', // to have '.' as decimal separator
...inputProps,
},
inputMode: 'numeric',
pattern: '[0-9]*',
lang: 'en-US', // to have '.' as decimal separator
...inputProps,
},
}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Deep merge slotProps to prevent shallow overwrites.

Because MUI v7 nests all slot configurations (such as input, htmlInput, and formHelperText) under the single slotProps object, shallow spreading caller props (...props or ...formProps) on the same component where a local slotProps object is defined creates a collision. If a caller provides slotProps (e.g., to set maxLength via htmlInput), one of the slotProps objects will be completely overwritten and silently dropped.

Update the configuration to safely merge the caller's slotProps with the component's internal slotProps.

  • src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx#L99-L134: Merge props.slotProps with the local slotProps.input configuration.
  • src/components/ui/reactHookForm/tableInputs/table-text-input.tsx#L40-L52: Merge props.slotProps with the local slotProps.input configuration.
  • src/components/ui/reactHookForm/text/ExpandingTextField.tsx#L65-L75: Merge textFieldFormProps.slotProps with the local slotProps.formHelperText configuration.
  • src/components/ui/reactHookForm/text/UniqueNameInput.tsx#L101-L109: Merge formProps.slotProps with the local slotProps.input configuration.
  • src/components/ui/reactHookForm/utils/TextFieldWithAdornment.tsx#L88-L95: Merge otherProps.slotProps with the local slotProps.input configuration.

Example of a safe merge pattern:

slotProps={{
    ...props.slotProps,
    input: {
        ...props.slotProps?.input,
        // ... local input properties
    },
    htmlInput: {
        ...props.slotProps?.htmlInput,
        // ... local htmlInput properties
    }
}}
📍 Affects 5 files
  • src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx#L99-L134 (this comment)
  • src/components/ui/reactHookForm/tableInputs/table-text-input.tsx#L40-L52
  • src/components/ui/reactHookForm/text/ExpandingTextField.tsx#L65-L75
  • src/components/ui/reactHookForm/text/UniqueNameInput.tsx#L101-L109
  • src/components/ui/reactHookForm/utils/TextFieldWithAdornment.tsx#L88-L95
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx` around
lines 99 - 134, Deep-merge caller slotProps with each component’s local slot
configuration instead of allowing the local slotProps object to overwrite it.
Update
src/components/ui/reactHookForm/tableInputs/table-numerical-input.tsx:99-134 and
table-text-input.tsx:40-52 to preserve caller slotProps while merging local
input settings; update
src/components/ui/reactHookForm/text/ExpandingTextField.tsx:65-75 for
formHelperText, UniqueNameInput.tsx:101-109 for input, and
utils/TextFieldWithAdornment.tsx:88-95 for input, preserving nested htmlInput
and other caller-provided slots.

Comment on lines +68 to 78
slotProps={{
input: {
sx: {
input: styles.searchSection,
},
startAdornment: (
<InputAdornment position="start">
<Search color={disabled ? 'disabled' : 'inherit'} />
</InputAdornment>
),
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Apply sx directly to the input wrapper slot.

Nesting the styling under an input CSS selector (sx: { input: styles.searchSection }) targets the inner HTML <input> element instead of the wrapper component. Because <input> is not a flex container, properties like alignItems: 'center' from styles.searchSection will have no effect.

Apply the style object directly to the slot's sx prop.

🎨 Proposed fix
             slotProps={{
                 input: {
-                    sx: {
-                        input: styles.searchSection,
-                    },
+                    sx: styles.searchSection,
                     startAdornment: (
                         <InputAdornment position="start">
                             <Search color={disabled ? 'disabled' : 'inherit'} />
                         </InputAdornment>
                     ),
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
slotProps={{
input: {
sx: {
input: styles.searchSection,
},
startAdornment: (
<InputAdornment position="start">
<Search color={disabled ? 'disabled' : 'inherit'} />
</InputAdornment>
),
},
slotProps={{
input: {
sx: styles.searchSection,
startAdornment: (
<InputAdornment position="start">
<Search color={disabled ? 'disabled' : 'inherit'} />
</InputAdornment>
),
},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/parameters/dynamic-simulation/curve/common/grid-search.tsx`
around lines 68 - 78, Update the input slot configuration in the relevant
component so styles.searchSection is assigned directly to the slot’s sx
property, removing the nested input selector. Preserve the existing
startAdornment and disabled-dependent Search icon behavior.

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.

1 participant