Skip to content

Conversation

@debsmita1
Copy link
Member

@debsmita1 debsmita1 commented Dec 11, 2025

Hey, I just made a Pull Request!

Part of : https://issues.redhat.com/browse/RHIDP-9381
Fixes: https://issues.redhat.com/browse/RHDHBUGS-1215

Solution description:

With this change, users can provide their custom FAB component while still being able to configure properties such as priority and slot. When a custom FAB is provided, users only need to configure the slot and priority in the config, the custom fab can encapsulate it's own tooltip and onClick actions

Config for custom Component:

- mountPoint: global.floatingactionbutton/config
  importName: NullComponent
  config:
    Component: Chatbot
    priority: -1

Chatbot

export const Chatbot = () => {
  const { isOpen, togglePanel } = useChatPanel();

  return (
    <Tooltip title={isOpen ? 'Close Chat' : 'Open Chat'} placement="left">
      <Fab
        size="small"
        color={isOpen ? 'default' : 'primary'}
        onClick={togglePanel}
        aria-label={isOpen ? 'Close chat' : 'Open chat'}
        sx={{
          transition: 'all 0.3s ease',
        }}
      >
        {isOpen ? <CloseIcon /> : <ChatIcon />}
      </Fab>
    </Tooltip>
  );
};
Screen.Recording.2025-12-11.at.11.27.28.PM.mov

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

@rhdh-gh-app
Copy link

rhdh-gh-app bot commented Dec 11, 2025

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-global-floating-action-button workspaces/global-floating-action-button/plugins/global-floating-action-button patch v1.7.0

/**
* Custom FAB component
*/
Component?: ComponentType<any>;
Copy link
Member Author

Choose a reason for hiding this comment

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

I chose to add a Component in the config instead of using the mountPoint "importName" to render the custom Component, because the Components are lazy loaded and RHDH will not be able to determine if a component returns null or not. We need NullComponent as importName for actions with "to" config, as without an importName, the mountPoint is ignored.

FAB dynamicConfig:

- mountPoint: global.floatingactionbutton/config
  importName: NullComponent
  config:
    icon: github
    label: 'Git'
    showLabel: true
    toolTip: 'Github'
    to: https://github.com/redhat-developer/rhdh

@debsmita1 debsmita1 force-pushed the update-fab-apis branch 4 times, most recently from 2af46ec to a1c1e33 Compare December 16, 2025 07:34
@debsmita1 debsmita1 changed the title feat(fab): allow custom fab component fix(fab): allow custom fab component Dec 16, 2025
@sonarqubecloud
Copy link

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.

1 participant