Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fab): update fab content #258

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

debsmita1
Copy link
Member

@debsmita1 debsmita1 commented Jan 8, 2025

Resolves:
https://issues.redhat.com/browse/RHIDP-5398

GIF/Screenshots:

Added slide transition
https://github.com/user-attachments/assets/1b27522e-c0db-48d4-8a4c-ab623b442552

The below screenshot shows the following:

  • Show an icon or an icon with a label, but not only a label
  • Truncating text longer than 20 characters
  • Have set default colors of the sub-menu buttons to be Secondary -pf-tglobalbackgroundcolorsecondary-default , text to be --pf-t--global--text--color--regular and icon color to be --pf-t--global--icon--color--regular
  • Kept 16px from the bottom and the left and right sides. Keep the button on the bottom-right or bottom left and remove middle alignment.
  • Buttons leading to external links has icon to indicate that the link opens externally

Screenshot 2025-01-08 at 8 31 23 PM

Added instructions to recommend users to use only filled icons from the Material Design library

✔️ 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 Jan 8, 2025

Changed Packages

Package Name Package Path Changeset Bump Current Version
app workspaces/global-floating-action-button/packages/app none v0.0.1
@red-hat-developer-hub/backstage-plugin-global-floating-action-button workspaces/global-floating-action-button/plugins/global-floating-action-button patch v0.0.2

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Thanks!

Some minor changes, but mostly I don't like to see the PatternFly dependency here.

Comment on lines +51 to +100
const getColor = () => {
if (actionButton.color) {
return actionButton.color;
}
if (!className) {
return 'info';
}
return undefined;
};
Copy link
Member

Choose a reason for hiding this comment

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

Just asking myself: Why are you mixing className and color here?

Couldn't we use info always as fallback?

Copy link
Member Author

Choose a reason for hiding this comment

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

@christoph-jerolimov As per the UX the sub-menu actions should have the secondary color (ref: --pf-t--global--background--color--secondary--default , https://www.patternfly.org/design-foundations/colors/#background-colors) by default if the color is not specified. And for the main FAB button the default color should be blue or 'info'

cc @ShiranHi

<Fab
{...(newWindow ? { target: '_blank', rel: 'noopener' } : {})}
style={{ color: 'var(--pf-t--global--icon--color--regular)' }}
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, but that isn't acceptable. We should respect the MUI theme.

If we really need other colors for this we should add that to the theme palette, but always fallback to a useful default.

With this code, we couldn't contribute that plugin to the Backstage community, and it's not reasonable to load PF CSS file for one color.

Copy link

Choose a reason for hiding this comment

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

I believe I caused some confusion, and I apologize for that. Since this is a new component, I requested the use of theme colors which is based on the PF color guidelines. How can we ensure it aligns well with our theme?

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 have used color: theme.palette.grey[500], for the default sub-menu actions color
and for the icon and text color I have used the hex codes to match the pf color

Copy link
Member

@christoph-jerolimov christoph-jerolimov left a comment

Choose a reason for hiding this comment

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

Thanks for removing the PatternFly dependency again! This is much cleaner now. 👍

Lgtm, feel free to merge whenever you want. :)

color: theme.palette.grey[500],
},
menuButtonStyle: {
color: '#1f1f1f',
Copy link
Member

Choose a reason for hiding this comment

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

This color shouldn't be hard coded when the background color comes from the theme.

I personally think we should just remove that to use the inverse color from the theme.

Anyway, we can go with that and improve that later. But I like to take a look together with @ShiranHi before we ship a 1.0. :)

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 have created this https://issues.redhat.com/browse/RHIDP-5482 to track it

</>
</Slide>
)}
<Collapse
Copy link
Member

Choose a reason for hiding this comment

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

I hoped that the buttons slides in from behind that button. But it looks much better then without any animation. So thanks for adding this.

Also here we might come back later when everything else works as expected. :)

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 have created this https://issues.redhat.com/browse/RHIDP-5482 to track it

@debsmita1 debsmita1 merged commit 3d2f8a3 into redhat-developer:main Jan 9, 2025
7 checks passed
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.

3 participants