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

fix: [M3-8342] - Toast Notifications for Images #10664

Conversation

bnussman-akamai
Copy link
Contributor

@bnussman-akamai bnussman-akamai commented Jul 10, 2024

Description πŸ“

  • Removes some unnecessary styles for our Toast implementation πŸ—‘οΈ
  • Fixes flaw with useToastNotifications that caused toasts to show up with no message πŸ”§
  • Improves how content wraps inside of toast notifications 🎨
  • Adds a maxWidth to Toast Notifications on larger screens so that they don't take up the full width of the screen
    • See the WithLongMessage Storybook story πŸ“–

Preview πŸ“·

Before After
before-cancel-upload-toast.mov
after-cancel-upload-toast.mov
before-capture-error-toast.mov
after-capture-error-toast.mov

How to test πŸ§ͺ

  • Use yarn storybook and verify that all Toast variants look correct in both light 🌞 and dark mode 🌚
  • Test canceling an uploaded image that is the "processing" state ⛔️
  • Test the error toast that shows when an Image fails to capture from a Linode πŸ‘€
    • I'm currently able to reproduce this in dev when trying to capture an image from a powered on Alpine Linux Linode, but your milage may vary

As an Author I have considered πŸ€”

  • πŸ‘€ Doing a self review
  • ❔ Our contribution guidelines
  • 🀏 Splitting feature into small PRs
  • βž• Adding a changeset
  • πŸ§ͺ Providing/Improving test coverage
  • πŸ” Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • πŸ‘£ Providing comprehensive reproduction steps
  • πŸ“‘ Providing or updating our documentation
  • πŸ•› Scheduling a pair reviewing session
  • πŸ“± Providing mobile support
  • β™Ώ Providing accessibility support

@bnussman-akamai bnussman-akamai added the Bug Fixes for regressions or bugs label Jul 10, 2024
@bnussman-akamai bnussman-akamai self-assigned this Jul 10, 2024
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner July 10, 2024 14:13
@bnussman-akamai bnussman-akamai requested review from hana-linode and carrillo-erik and removed request for a team July 10, 2024 14:13
link,
hasSupportLink
);
if (failureMessage) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added if statements to ensure we only call enqueueSnackbar if the message is defined

Comment on lines 13 to 15
'&.notistack-MuiContent': {
flexWrap: 'unset',
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Snackbar container defaults to flexWrap: 'wrap'. We don't want the close button to wrap, so I added this to disable flex wrap.

Copy link

github-actions bot commented Jul 10, 2024

Coverage Report: βœ…
Base Coverage: 82.31%
Current Coverage: 82.34%

Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Thanks - looks good and the wrapping issue is now fixed βœ…

Copy link
Contributor

@hana-linode hana-linode left a comment

Choose a reason for hiding this comment

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

Changes LGTM

Semi-related, is it expected that the toast background in light mode now matches the variant instead of being white? (Personally, I am not a fan of the colored background)

Screen.Recording.2024-07-10.at.1.57.28.PM.mov

@hana-linode hana-linode added the Approved Multiple approvals and ready to merge! label Jul 10, 2024
@jaalah-akamai
Copy link
Contributor

Semi-related, is it expected that the toast background in light mode now matches the variant instead of being white? (Personally, I am not a fan of the colored background)

Yea it's part of CDS 2.0

@bnussman-akamai bnussman-akamai merged commit 97fba8c into linode:develop Jul 10, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved Multiple approvals and ready to merge! Bug Fixes for regressions or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants