Skip to content

Shortcut plugin mig new#9416

Open
amitkumar489 wants to merge 6 commits into
backstage:mainfrom
Infosys:shortcut_plugin_mig_new
Open

Shortcut plugin mig new#9416
amitkumar489 wants to merge 6 commits into
backstage:mainfrom
Infosys:shortcut_plugin_mig_new

Conversation

@amitkumar489

Copy link
Copy Markdown

Hey, I just made a Pull Request!

The shortcuts plugin is now fully migrated to BUI with production-ready styling that automatically adapts to light and dark system themes, improved positioning, and modern Backstage UI components. All ESLint checks pass, and the plugin maintains backward compatibility with existing functionality.

✔️ 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)
image

Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Copilot AI review requested due to automatic review settings June 4, 2026 09:52
@amitkumar489 amitkumar489 requested a review from a team as a code owner June 4, 2026 09:52
@amitkumar489 amitkumar489 requested a review from vinzscam June 4, 2026 09:52
@backstage-goalie

Copy link
Copy Markdown
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-shortcuts workspaces/shortcuts/plugins/shortcuts minor v0.20.0

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

Note

Copilot was unable to run its full agentic suite in this review.

Migrates the shortcuts plugin UI away from Material-UI components/icons to Backstage UI (BUI) components with CSS modules, and updates dependencies accordingly.

Changes:

  • Replaces MUI icons/components with @backstage/ui and @remixicon/react.
  • Re-implements Add/Edit shortcut popovers and form styling using CSS modules + BUI components.
  • Replaces MUI Avatar-based shortcut icon with a CSS-module-backed avatar div and custom contrast calculation.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
workspaces/shortcuts/plugins/shortcuts/src/Shortcuts.tsx Switches the sidebar “Add Shortcuts” icon from MUI to Remixicon.
workspaces/shortcuts/plugins/shortcuts/src/ShortcutItem.tsx Replaces MUI edit button/tooltip styling with BUI components + CSS modules.
workspaces/shortcuts/plugins/shortcuts/src/ShortcutItem.module.css Adds CSS-module hover behavior for showing the edit button.
workspaces/shortcuts/plugins/shortcuts/src/ShortcutIcon.tsx Replaces MUI Avatar with a styled div and manual contrast color computation.
workspaces/shortcuts/plugins/shortcuts/src/ShortcutIcon.module.css Adds CSS-module styles for the new avatar div.
workspaces/shortcuts/plugins/shortcuts/src/ShortcutForm.tsx Migrates form UI to BUI components and custom CSS-module styling.
workspaces/shortcuts/plugins/shortcuts/src/ShortcutForm.module.css Adds CSS-module styles for fields/actions (borders, spacing, dark mode).
workspaces/shortcuts/plugins/shortcuts/src/EditShortcut.tsx Replaces MUI Popover/Card with a custom fixed-position container + click-outside handling.
workspaces/shortcuts/plugins/shortcuts/src/EditShortcut.module.css Adds CSS-module styles for the edit “popover” card/header.
workspaces/shortcuts/plugins/shortcuts/src/AddShortcut.tsx Replaces MUI Popover/Card with a custom fixed-position container + click-outside handling.
workspaces/shortcuts/plugins/shortcuts/src/AddShortcut.module.css Adds CSS-module styles for the add “popover” card/header.
workspaces/shortcuts/plugins/shortcuts/package.json Swaps MUI dependencies for @backstage/ui and @remixicon/react.
workspaces/shortcuts/.changeset/many-poems-tan.md Adds a changeset documenting the BUI migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +42
// Calculate contrast text color based on background color
const rgb = parseInt(props.color.substring(1), 16);
const r = (rgb >> 16) & 0xff;
const g = (rgb >> 8) & 0xff;
const b = (rgb >> 0) & 0xff;
const luma = 0.299 * r + 0.587 * g + 0.114 * b;
const contrastColor = luma > 128 ? '#000000' : '#ffffff';

return <Avatar className={classes.avatar}>{props.text}</Avatar>;
return (
<div
className={styles.avatar}
style={
{
'--avatar-bg-color': props.color,
'--avatar-contrast-text': contrastColor,
} as React.CSSProperties
}
>
Comment on lines 52 to 56
const handleClick = () => {
if (buttonRef.current) {
setAnchorEl(buttonRef.current);
}
};
Comment on lines +74 to +78
<ButtonIcon
ref={buttonRef}
id="edit"
data-testid="edit"
className={styles.button}
Comment on lines +2 to +4
.root:hover #edit {
visibility: visible;
}
Comment on lines +104 to 114
<div
ref={popoverRef}
style={{
position: 'fixed',
zIndex: 1300,
top: anchorEl ? (anchorEl as any).getBoundingClientRect().top : 0,
left: anchorEl
? (anchorEl as any).getBoundingClientRect().right + 10
: 0,
}}
>

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Anchor button is in stable Backstage sidebar (not scrolling)
User interactions confined to sidebar area
Form closes on outside click (handles visibility concerns)
Lightweight implementation improves bundle size
Acceptable UX for this specific use case
✅ Future Improvements Listed:
Option to add @floating-ui/react if scroll/viewport collisions become an issue
Path to integrate Popper/Floating UI if panel flipping is needed
✅ Trade-offs Explicitly Stated:

✓ Simpler, lighter implementation
✓ Fewer dependencies
✗ No auto viewport collision detection (not needed in sidebar)
✗ No auto reposition on scroll (sidebar typically fixed)

Comment on lines +121 to 131
<div
ref={popoverRef}
style={{
position: 'fixed',
zIndex: 1300,
top: anchorEl ? (anchorEl as any).getBoundingClientRect().top : 0,
left: anchorEl
? (anchorEl as any).getBoundingClientRect().right + 10
: 0,
}}
>
Comment on lines +82 to +87
<div
style={{
padding: 'var(--bui-space-4)',
backgroundColor: 'light-dark(#ffffff, #424242)',
}}
>
Comment on lines +6 to +9
.field :global(input) {
border: 1px solid #cccccc !important;
border-radius: 4px !important;
}
<SidebarScrollWrapper>
<SidebarItem
icon={props.icon ?? PlayListAddIcon}
icon={props.icon ?? (() => <RiPlayList2Line size={24} />)}
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
Signed-off-by: amitkumar489 <amit.kumar489@infosys.com>
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.

3 participants