Skip to content

[frontend] Migrate Material UI v4 to MUI v5#12925

Open
jeffspahr wants to merge 4 commits intokubeflow:masterfrom
jeffspahr:codex/mui-v5-upgrade
Open

[frontend] Migrate Material UI v4 to MUI v5#12925
jeffspahr wants to merge 4 commits intokubeflow:masterfrom
jeffspahr:codex/mui-v5-upgrade

Conversation

@jeffspahr
Copy link
Contributor

Summary

  • migrate frontend dependencies from @material-ui/core / @material-ui/icons to MUI v5 (@mui/material, @mui/icons-material) with Emotion
  • apply codemod-driven import/API updates across the frontend app
  • migrate theme override structure to MUI v5 (components.styleOverrides) in the main and MLMD themes
  • fix MUI v5 transition compatibility in SidePanel and update related tests/selectors/snapshots for MUI v5 behavior
  • add migration checklist artifacts and lessons learned under tasks/

Verification

  • cd frontend && npm run test:ci
    • UI: 118 files / 1654 tests passed
    • server: 10 files / 163 tests passed
  • cd frontend && npm run build
  • guard checks
    • git diff -- frontend/src/apis frontend/src/apisv2beta1 frontend/src/third_party (empty)
    • rg -n "@material-ui/" frontend/src frontend/package.json (no matches)

Notes

- replace @material-ui/core/icons with @mui/material/icons-material + emotion

- migrate theme overrides/styles and update component APIs

- refresh tests/snapshots and fix migration regressions

- verify with npm run test:ci and npm run build

Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Copilot AI review requested due to automatic review settings February 27, 2026 00:31
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign james-jwu for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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 migrates the frontend from Material UI v4 to MUI v5 with Emotion as the styling engine. The migration updates all imports from @material-ui/core and @material-ui/icons to their v5 equivalents (@mui/material and @mui/icons-material), applies API changes across components, updates theme structure to use v5's components.styleOverrides pattern, and fixes transition compatibility issues in the SidePanel component.

Changes:

  • Updated package dependencies to MUI v5 (@mui/material, @mui/icons-material) and added Emotion dependencies
  • Applied codemod-driven import path updates and API changes throughout the codebase
  • Migrated theme override structure from v4's overrides to v5's components.styleOverrides pattern with proper nesting
  • Fixed MUI v5 Slide transition requirement by wrapping content in a div element
  • Updated test snapshots to reflect v5 CSS class naming and DOM structure changes

Reviewed changes

Copilot reviewed 117 out of 131 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/package.json Added MUI v5 and Emotion dependencies, removed v4 packages
frontend/src/index.tsx Added StyledEngineProvider to ensure proper CSS injection order
frontend/src/Css.tsx Migrated theme structure to v5 components.styleOverrides pattern
frontend/src/mlmd/Css.tsx Migrated MLMD theme structure to v5 components.styleOverrides pattern
frontend/src/components/SidePanel.tsx Wrapped Slide content in div to satisfy v5 transition requirements
Multiple component files Updated imports from @material-ui to @mui namespaces
Multiple test files Updated test selectors from 'button' to 'combobox' for Select components
Multiple snapshot files Updated to reflect v5 CSS class names and DOM structure

@jeffspahr
Copy link
Contributor Author

Follow-up note on UI visual comparison (Kind-backed smoke test against master):

Observed button-related deltas are small and cosmetic, primarily:

  • Top toolbar primary action button (e.g., Create experiment): minor icon/text alignment and font rasterization differences.
  • Tab-like buttons (e.g., Active/Archived, Default/Grouped): subtle border/text-weight/anti-aliasing changes.
  • A few button/icon affordances (e.g., caret/chevron glyph rendering) show slight pixel-level differences.

Root cause: expected rendering differences from MUI v4 -> MUI v5 internals (Button/Icon DOM/CSS behavior), not functional regressions.

Decision for this PR: accept the new visuals and avoid adding migration-specific styling hacks for pixel parity. This keeps scope focused on correctness/stability and reduces long-term maintenance risk.

- document SidePanel Slide wrapper requirement for MUI v5 ref handling

- make CardTooltip interactivity explicit with disableInteractive={false}

Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
Signed-off-by: Jeff Spahr <spahrj@gmail.com>
@jeffspahr
Copy link
Contributor Author

/ok-to-test

@jeffspahr
Copy link
Contributor Author

artifacts-1280x800 compare-seeded-1280x800 executions-1280x800 experiment-create-1280x800 experiments-1280x800 pipeline-create-1280x800 pipeline-details-seeded-1280x800 pipelines-1280x800 recurring-runs-1280x800 run-details-seeded-1280x800 runs-1280x800 runs-new-1280x800 runs-new-pipeline-dialog-1280x800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants