Skip to content

[Hierarchies-react]: move to MUI#1425

Open
MartynasStrazdas wants to merge 26 commits into
nextfrom
mast/move-to-MUI
Open

[Hierarchies-react]: move to MUI#1425
MartynasStrazdas wants to merge 26 commits into
nextfrom
mast/move-to-MUI

Conversation

@MartynasStrazdas

@MartynasStrazdas MartynasStrazdas commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d3ff108

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@itwin/presentation-hierarchies-react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@MartynasStrazdas MartynasStrazdas changed the title initial [Hierarchies-react]: move to MUI Jul 2, 2026
@grigasp grigasp linked an issue Jul 3, 2026 that may be closed by this pull request
@MartynasStrazdas MartynasStrazdas marked this pull request as ready for review July 9, 2026 08:35
@MartynasStrazdas MartynasStrazdas requested a review from a team as a code owner July 9, 2026 08:35
Copilot AI review requested due to automatic review settings July 9, 2026 08:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 @itwin/presentation-hierarchies-react’s StrataKit-based renderers from @stratakit/bricks / @stratakit/foundations UI primitives to MUI (@mui/material) via @stratakit/mui, and updates the monorepo dependency graph and tests accordingly.

Changes:

  • Add MUI / @stratakit/mui dependencies and update pnpm catalogs/lockfile to new StrataKit versions.
  • Replace several StrataKit UI primitives (buttons, text, inputs, menus, spinner) with MUI equivalents in the Stratakit renderers.
  • Adjust component tests and Vitest browser config for the new UI stack.

Reviewed changes

Copilot reviewed 11 out of 30 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Bumps Stratakit catalog versions and adds @stratakit/mui to the catalog.
pnpm-lock.yaml Lockfile refresh reflecting the new MUI + Stratakit dependency graph.
packages/hierarchies-react/vitest.config.ts Ensures Vitest browser pre-bundles @mui/material for component tests.
packages/hierarchies-react/src/test/components/TreeRenderer.test.tsx Tweaks rendering/viewport sizing for context-menu visibility assertions.
packages/hierarchies-react/src/test/components/RenderUtils.tsx Switches test theme root provider from @stratakit/foundations to @stratakit/mui.
packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/TreeNodeRenderer.tsx Replaces dropdown/context menu and label editor UI with MUI components.
packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/TreeAction.tsx Renders context-menu actions using MUI MenuItem + @stratakit/mui Icon.
packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/RootErrorRenderer.tsx Replaces error UI primitives with MUI equivalents.
packages/hierarchies-react/src/presentation-hierarchies-react/stratakit/ErrorItemRenderer.tsx Replaces link/text primitives with MUI Link/Typography.
packages/hierarchies-react/package.json Updates dependencies/peers to MUI + @stratakit/mui and drops old optional peers.
apps/test-app/frontend/package.json Adds MUI + @stratakit/mui so the test app can consume the updated renderers.
.changeset/early-facts-hide.md Adds a changeset documenting the migration and peer dependency changes.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread .changeset/early-facts-hide.md
Comment thread .changeset/early-facts-hide.md
Comment thread packages/hierarchies-react/package.json Outdated
Comment thread apps/test-app/frontend/src/components/app/App.tsx Outdated
MartynasStrazdas and others added 4 commits July 9, 2026 15:31
MartynasStrazdas and others added 3 commits July 10, 2026 11:37
Co-authored-by: MartynasStrazdas <43886789+MartynasStrazdas@users.noreply.github.com>
@saskliutas

Copy link
Copy Markdown
Member

Looks like config for TypeScript is missing https://github.com/iTwin/stratakit/tree/main/packages/mui#typescript

@MartynasStrazdas

MartynasStrazdas commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Looks like config for TypeScript is missing https://github.com/iTwin/stratakit/tree/main/packages/mui#typescript

Added, did not seem to affect anything it deprecated component properties replaced them with render.

@grigasp grigasp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just to clarify, this has no breaking changes besides peer deps?

@MartynasStrazdas

Copy link
Copy Markdown
Contributor Author

Just to clarify, this has no breaking changes besides peer deps?

Because we still use the tree from structures and have primarily replaced the stratakit/bricks components to MUI, there was no need for any api changes.

@MartynasStrazdas

Copy link
Copy Markdown
Contributor Author

/update-screenshots

Co-authored-by: MartynasStrazdas <43886789+MartynasStrazdas@users.noreply.github.com>
// `aria-required-children` is being triggered because anchor element of context menu is rendered next to `treeitem` under `tree` and
// it expects that `tree` contains only `treeitem` children.
await expect.element(page.getByText("Context Action 2")).toBeVisible();
await validateSnapshot(locator, { skipA11y: ["aria-hidden-focus", "aria-required-children"] });

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you check if we still need skipA11y?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Seems to no longer be needed, removed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There're a couple more usages of skipA11y in this test file - are they required?

@grigasp grigasp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The initial load view lacks some spacing between the spinner and "Loading" text:

Image

@MartynasStrazdas

Copy link
Copy Markdown
Contributor Author

The initial load view lacks some spacing between the spinner and "Loading" text:

Image

Quite interesting situation we had there where spinner was rendered in one component and loading text was in a sibling component (renderContent and renderLoadingOverlay), i don't think we need the renderLoadingOverlay so i removed it moving the spinner next to loading text. Also removed all itwinUI components in statelessTree, to remove can't remove the itwinUI entirely as some other packages still rely on it, will remove from other parts where possible in a different pr (talking about test-app) to have hierarchies-react version with MUI faster

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.

Migrate to @mui/material + @stratakit/mui

5 participants