Skip to content

migrate mui from v6 to v7#4480

Open
Forfold wants to merge 16 commits intomui-upgradefrom
mui-upgrade-v7
Open

migrate mui from v6 to v7#4480
Forfold wants to merge 16 commits intomui-upgradefrom
mui-upgrade-v7

Conversation

@Forfold
Copy link
Copy Markdown
Contributor

@Forfold Forfold commented Apr 24, 2026

  • Identified the issue which this PR solves.
  • Read the CONTRIBUTING document.
  • Code builds clean without any errors or warnings.
  • Added appropriate tests for any new functionality.
  • All new and existing tests passed.
  • Added comments in the code, where necessary.
  • Ran make check to catch common errors. Fixed any that came up.

Description:
Upgrades MUI (Material UI) from v6 to v7 across the entire frontend.

Package upgrades:

Package Old New
@mui/material 6.5.0 7.3.10
@mui/icons-material 6.5.0 7.3.10
@mui/system 6.5.0 7.3.10
@mui/x-data-grid 6.20.4 7.29.12
@mui/styles 6.5.0 removed

Key changes:

  • Removed @mui/styles / makeStyles entirely — all ~86 files using makeStyles have been migrated to the sx prop. This removes the dependency on the legacy JSS-based styling engine, which was dropped in MUI v7.
  • Dropped the Hidden component and deep/private imports as part of v7 prep (these were removed upstream).
  • Replaced JS-based transitions with CSS-based alternatives where needed (e.g., flat list slide transitions, alert count graph hover styles).
  • Net reduction of ~860 lines across 155 files (1,328 additions / 2,187 deletions) — the sx prop approach is more concise than the makeStyles pattern.

Which issue(s) this PR fixes:
Continues the MUI upgrade path started in the v5 → v6 PR. Resolves the remaining @mui/styles tech debt flagged during the v6 upgrade.

Out of Scope:

  • Migration to Pigment CSS or zero-runtime styling (future consideration)
  • MUI v8+ changes
  • Visual/behavioral changes — this is a like-for-like styling migration

Screenshots:
N/A — no visual changes intended. This is a dependency upgrade and styling engine migration.

Describe any introduced user-facing changes:
None. All styling changes are internal refactors producing the same visual output.

Describe any introduced API changes:
None.

Additional Info:
This PR is stacked on top of the v5 → v6 MUI upgrade branch (mui-upgrade). The migration was done incrementally:

  1. Prep: drop Hidden component and deep imports
  2. Migrate makeStylessx across all components (admin, alerts, lists, main, schedules, rotations, services, users, util, calendar, explore)
  3. Upgrade packages from v6 to v7
  4. Fix formatting (prettier/eslint) and make check issues

Forfold and others added 16 commits April 24, 2026 10:48
Replace <Hidden> with sx display rules (Hidden is removed in v7) and
collapse the @mui/material/styles/createPalette deep import into the
public entry point.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove @mui/styles makeStyles usage from Icons, CreateFAB, FlatList,
FlatListItem, ListHeader, PageControls, ClickableText, CopyText,
SkipToContentLink, SpeedDial, AlertCountLineGraph, and materialStyles.

Replace with inline sx props, local const classes objects, and a plain
CSS file for CSSTransition class names (flatListTransitions.css).
Remove @mui/styles makeStyles from AdminAPIKeys, AdminConfig,
AdminLimits, AdminSMSSend, AdminSection, AdminToolbox, SlackActions,
AdminAlertCounts, AlertCountTable, AdminAPIKeyDrawer,
AdminAPIKeyExpirationField, AdminMessageLogDrawer, and
AdminMessageLogsLayout.

Replace with inline sx props, Box components for theme-dependent
responsive styles, and slotProps for Dialog paper styling.
Remove @mui/styles makeStyles from AlertDetailLogs, AlertsList,
CreateAlertDialog, and AlertCountGraph.

Replace with inline sx props and a plain CSS file for the recharts
Bar hover cursor (AlertCountGraph.css).
- Update @mui/material, @mui/icons-material, @mui/system from 6.5.0 to 7.3.10
- Update @mui/x-data-grid from 6.20.4 to 7.29.12
- Remove @mui/styles package (no longer needed)
- Grid v2: remove 'item' prop, migrate xs/sm/md/lg/xl to 'size' prop
- DataGrid v7: update valueGetter/valueFormatter signatures, components to slots
- FormControlLabel: slotProps.label to slotProps.typography
- Fix theme.mixins.toolbar type cast
- Fix GridSortModel type usage
- Remove deprecated 'hide' column property
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