Skip to content

feat(tech-insights): migrate frontend plugins from MUI to BUI - #11473

Open
deiga wants to merge 18 commits into
backstage:mainfrom
F-Secure-web:mui-to-bui-tech-insights
Open

deiga wants to merge 18 commits into
backstage:mainfrom
F-Secure-web:mui-to-bui-tech-insights

Conversation

@deiga

@deiga deiga commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Hey, I just made a Pull Request!

Migrates @backstage-community/plugin-tech-insights and @backstage-community/plugin-tech-insights-react from Material UI to Backstage UI (@backstage/ui). Neither package has direct @material-ui/* imports or dependencies any more, and the public API is unchanged (API reports have no diff).

  • Scorecards use BUI Accordion, Alert, Text and Flex, and the check list is a plain list styled with CSS modules.
  • The checks filter is a searchable multi-select. The Yes/No filters are BUI Selects with the same defaults as before.
  • When check descriptions are hidden, they show in a tooltip that can be reached with the keyboard.
  • Check result links open in a keyboard-navigable menu inside a controlled BUI Popover anchored to the element passed to open(element), so ResultLinksMenuInfo and the component/componentProps props on ResultCheckIcon keep working. The menu is the react-aria Menu with BUI MenuItems, because BUI's Menu only opens inside a MenuTrigger, which cannot anchor to an element supplied at click time. This adds react-aria-components (same range as @backstage/ui) as a direct dependency. The alternative is to make the trigger a child of ResultLinksMenu and use BUI MenuTrigger + Menu, but that is a breaking change to the public ResultLinksMenuInfo contract, so it is left for a future major.
  • Passing boolean checks show a green icon instead of the primary colour.

Question for maintainers: tech-insights-react now depends directly on react-aria-components, pinned to BUI's range, with a yarn.config.cjs constraint and enableConstraintsChecks in .yarnrc.yml so yarn install fails if the two ranges drift. Is this acceptable, or would you rather wait for BUI's Menu to accept triggerRef/isOpen (backstage/backstage#36077) and keep the plain list until then?

Out of scope: the @backstage/core-components used here (Table with CSV export, Page, Header, InfoCard, Gauge) still use MUI internally and are left for a follow-up. The legacy-sidebar README example still uses an MUI icon, because SidebarItem expects one.

Adopters need @backstage/ui/css/styles.css imported in their app.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)
final-card final-filters card-open menu-keyboard-focus menu-open page3 badge5-hover gauge4

@backstage-service backstage-service added the workspace/tech-insights Used to tag tech-insights workspace issues and pull requests label Oct 7, 2026
@backstage-goalie

Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-tech-insights-react workspaces/tech-insights/plugins/tech-insights-react minor v1.7.0
@backstage-community/plugin-tech-insights workspaces/tech-insights/plugins/tech-insights minor v1.5.0

@deiga deiga changed the title mui to bui tech insights feat(tech-insights): migrate frontend plugins from MUI to BUI Oct 7, 2026
@deiga
deiga force-pushed the mui-to-bui-tech-insights branch from 739ed41 to e374334 Compare October 8, 2026 10:45
Timo Sand added 9 commits October 8, 2026 22:34
BUI's `Menu` only opens inside a `MenuTrigger`, which needs the trigger
as a child and cannot anchor to the element passed to `open(element)`.
Rendering the react-aria `Menu` with BUI `MenuItem`s inside the
controlled `Popover` keeps the public `ResultLinksMenuInfo` contract and
restores arrow-key navigation, first-item focus and close on select.
Adds `react-aria-components` at the same range as `@backstage/ui`.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
BUI `MenuItem`s read their collection context from the copy of
react-aria-components that `@backstage/ui` resolves. If this workspace
declares a different range, adopters can end up with two copies and the
check result links menu renders no items. The constraint reads the range
from `@backstage/ui/package.json`, and `enableConstraintsChecks` makes
`yarn install --immutable` in CI fail when the two drift. Run
`yarn constraints --fix` to follow a BUI bump.

The root ESLint config cannot parse a workspace-root `.cjs` file, so it
is listed in `.eslintignore` like `playwright.config.ts`.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Replace the hand-rolled ul/li/div markup and its CSS module with Flex
and Box, using BUI spacing and flex-item props. List semantics are kept
through explicit list and listitem roles so existing tests and screen
readers see the same structure.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
The badge hardcoded mediumseagreen and orangered backgrounds through an
inline style, ignoring the active theme. Render a BUI Badge with a
pass/fail icon coloured by the positive and negative foreground tokens.

The tooltip now lists check names and result icons directly instead of
nesting ScorecardsList: its per-check tooltip triggers hijacked the
outer tooltip's anchor, placing it in the top-left corner, and were
unreachable inside a tooltip anyway.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Use Alert for error states and Card for the gauge container, matching
what ScorecardContent already does. Gauge, Progress, MarkdownContent,
Table and the page header stay on core-components because BUI 0.17 has
no equivalent, and the BUI Header clashes with the themed legacy Page.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Express flex sizing and spacing through Flex and Box props instead of
style objects and CSS module classes. Only the accordion trigger border
remains in CSS, as BUI exposes no prop for it.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
@deiga
deiga force-pushed the mui-to-bui-tech-insights branch from e374334 to a7b9f72 Compare October 8, 2026 19:34
@deiga
deiga marked this pull request as ready for review October 8, 2026 20:08
@deiga
deiga requested review from a team, Xantier, kurtaking and punkle as code owners October 8, 2026 20:08
@deiga
deiga requested review from 04kash and a balanced review from Copilot October 8, 2026 20:08

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.

🟡 Changes recommended

Select options use unsupported identifiers, and the new icons reference undefined BUI color tokens.

3 open findings
What changed in this PR

Migrates the Tech Insights frontend plugins from MUI to Backstage UI while preserving their public APIs.

Changes:

  • Replaces MUI components, styling, and icons with BUI equivalents.
  • Adds accessible filters, tooltips, menus, and regression tests.
  • Adds dependency constraints, lockfile updates, and package changesets.
File Description
workspaces/​tech-insights/​yarn.lock Updates resolved dependencies.
workspaces/​tech-insights/​yarn.config.cjs Aligns React Aria versions with BUI.
plugins/​tech-insights/​src/​components/​ScorecardsPage/​ScorecardsPage.tsx Migrates page layout and alerts.
plugins/​tech-insights/​src/​components/​ScorecardsPage/​Filters.tsx Implements BUI filters.
plugins/​tech-insights/​src/​components/​ScorecardsPage/​Filters.test.tsx Tests filter interactions.
plugins/​tech-insights/​src/​components/​ScorecardsList/​ScorecardsList.tsx Migrates result list and tooltips.
plugins/​tech-insights/​src/​components/​ScorecardsList/​ScorecardsList.test.tsx Tests list accessibility.
plugins/​tech-insights/​src/​components/​ScorecardsInfo/​ScorecardInfo.tsx Migrates scorecard accordions.
plugins/​tech-insights/​src/​components/​ScorecardsInfo/​ScorecardInfo.test.tsx Tests accordion behavior.
plugins/​tech-insights/​src/​components/​ScorecardsInfo/​ScorecardInfo.module.css Styles accordion borders.
plugins/​tech-insights/​src/​components/​ScorecardsGauge/​ScorecardsGauge.tsx Migrates gauge cards.
plugins/​tech-insights/​src/​components/​ScorecardsContent/​ScorecardContent.tsx Migrates error alerts.
plugins/​tech-insights/​src/​components/​ScorecardsCard/​ScorecardsCard.tsx Migrates error alerts.
plugins/​tech-insights/​src/​components/​ScorecardsBadge/​ScorecardsBadge.tsx Migrates badges and tooltips.
plugins/​tech-insights/​src/​components/​ScorecardsBadge/​ScorecardsBadge.test.tsx Tests badge states.
plugins/​tech-insights/​src/​alpha/​pages.tsx Replaces the page icon.
plugins/​tech-insights/​package.json Updates runtime and test dependencies.
plugins/​tech-insights/​knip-report.md Refreshes dependency findings.
plugins/​tech-insights-react/​src/​components/​ResultLinksMenu/​ResultLinksMenu.tsx Implements the controlled BUI popover menu.
plugins/​tech-insights-react/​src/​components/​ResultLinksMenu/​ResultLinksMenu.module.css Styles menu content.
plugins/​tech-insights-react/​src/​components/​ResultCheckIcon/​ResultCheckIcon.tsx Migrates result icon buttons.
plugins/​tech-insights-react/​src/​components/​ResultCheckIcon/​ResultCheckIcon.test.tsx Tests menu and wrapper behavior.
plugins/​tech-insights-react/​src/​components/​BooleanCheck/​BooleanCheck.tsx Replaces boolean result icons.
plugins/​tech-insights-react/​package.json Adds BUI and React Aria dependencies.
plugins/​tech-insights-react/​knip-report.md Refreshes dependency findings.
.yarnrc.yml Enables constraint checks.
.eslintignore Excludes the Yarn constraint file.
.changeset/​bui-tech-insights.md Documents the main plugin migration.
.changeset/​bui-tech-insights-react.md Documents the React package migration.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Timo Sand added 6 commits October 11, 2026 10:56
A wrapping component that owns the onClick never opened the links
menu from the keyboard. Enter and Space on the ButtonIcon produce no
native click, so the wrapper's handler never ran. Trigger one click
per keyboard press so it behaves like a native button.

Also merge the menu and no-menu branches of wrapActions.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
The badge renders a plain span, and ARIA forbids naming a generic
element with aria-label. Hide the "1/2" fraction from assistive tech
and give screen readers a visually hidden "1 of 2 checks passed"
sentence instead.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Error alerts showed only the message as their title. Use the error
name as the title and the message as the description, so users can
tell, say, a network TypeError from an API error.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
searchable is deprecated in @backstage/ui in favour of search.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Timo Sand added 3 commits October 11, 2026 10:56
React Aria's Focusable needs an interactive or img role on its child,
otherwise screen readers may not announce the tooltip. Name the badge
as an image ("1 of 2 checks passed"), which replaces the hidden-text
workaround, and expose hidden-description check names as buttons.

Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Assisted-by: LLM
Signed-off-by: Timo Sand <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 08:05

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.

🟡 Changes recommended

The migrated controls introduce misleading or indistinguishable accessible names, and the searchable filter behavior remains untested.

2 open findings
3 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Give link buttons check-specific accessible names

workspaces/​tech-insights/​plugins/​tech-insights-react/​src/​components/​ResultCheckIcon/​ResultCheckIcon.tsx:131

Every check with links exposes a button named only “icon”, so screen-reader users cannot distinguish which check each control opens when several results are listed. Give the button a check-specific action label such as Links for ${result.check.name} and update the queries in the test accordingly.

🧠 Review effort: Balanced

<TooltipTrigger>
<Focusable>
{/* Focusable so keyboard users can reach the tooltip */}
<Text as="span" role="button" tabIndex={0}>
<Select
label="Checks"
selectionMode="multiple"
search
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

This branch has not been deployed

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

Labels

stale workspace/tech-insights Used to tag tech-insights workspace issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants