You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(tech-insights): migrate frontend plugins from MUI to BUI - #11473
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)
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]>
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]>
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]>
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]>
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.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I just made a Pull Request!
Migrates
@backstage-community/plugin-tech-insightsand@backstage-community/plugin-tech-insights-reactfrom 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).Accordion,Alert,TextandFlex, and the check list is a plain list styled with CSS modules.Selects with the same defaults as before.Popoveranchored to the element passed toopen(element), soResultLinksMenuInfoand thecomponent/componentPropsprops onResultCheckIconkeep working. The menu is the react-ariaMenuwith BUIMenuItems, because BUI'sMenuonly opens inside aMenuTrigger, which cannot anchor to an element supplied at click time. This addsreact-aria-components(same range as@backstage/ui) as a direct dependency. The alternative is to make the trigger a child ofResultLinksMenuand use BUIMenuTrigger+Menu, but that is a breaking change to the publicResultLinksMenuInfocontract, so it is left for a future major.Question for maintainers:
tech-insights-reactnow depends directly onreact-aria-components, pinned to BUI's range, with ayarn.config.cjsconstraint andenableConstraintsChecksin.yarnrc.ymlsoyarn installfails if the two ranges drift. Is this acceptable, or would you rather wait for BUI'sMenuto accepttriggerRef/isOpen(backstage/backstage#36077) and keep the plain list until then?Out of scope: the
@backstage/core-componentsused here (Tablewith 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, becauseSidebarItemexpects one.Adopters need
@backstage/ui/css/styles.cssimported in their app.✔️ Checklist
Signed-off-byline in the message. (more info)