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(app): toast styling fixes #12708

Merged
merged 3 commits into from
May 18, 2023
Merged

fix(app): toast styling fixes #12708

merged 3 commits into from
May 18, 2023

Conversation

ewagoner
Copy link
Contributor

@ewagoner ewagoner commented May 16, 2023

Overview

This PR fixes text overflow and alignment issues in the desktop and ODD toasts

Closes both RAUT-412 and RAUT-379

Test Plan

Manually verified close text placement and styling and long message overflow truncation in storybook

Changelog

  • Fixed close text vertical alignment
  • Added underline to close text on desktop
  • Truncate message with ellipses
  • Keep icon from resizing by setting both max and min size the same
  • Constrain the ToasterOven to 100% of the screen width.

Review requests

In storybook, set the toast message and optional header to be absurdly long. Verify it is truncated and not stretching the toast off the edge of the screen. Verify the close text is centered vertically. Verify close text is underlined on desktop.

Risk assessment

None.

@ewagoner ewagoner requested review from koji and a team May 16, 2023 15:08
@ewagoner ewagoner requested a review from a team as a code owner May 16, 2023 15:08
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #12708 (e2b2110) into edge (7f205c5) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #12708      +/-   ##
==========================================
+ Coverage   73.35%   73.39%   +0.04%     
==========================================
  Files        2261     2264       +3     
  Lines       61480    61690     +210     
  Branches     6782     6858      +76     
==========================================
+ Hits        45098    45277     +179     
- Misses      14763    14773      +10     
- Partials     1619     1640      +21     
Flag Coverage Δ
app 71.85% <100.00%> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
app/src/organisms/ToasterOven/ToasterOven.tsx 25.00% <ø> (ø)
app/src/atoms/Toast/index.tsx 77.77% <100.00%> (+0.63%) ⬆️

... and 12 files with indirect coverage changes

@@ -215,7 +215,8 @@ export function Toast(props: ToastProps): JSX.Element {
<Icon
name={icon?.name ?? toastStyleByType[type].iconName}
color={toastStyleByType[type].color}
width={showODDStyle ? SPACING.spacing32 : SPACING.spacing16}
maxWidth={showODDStyle ? SPACING.spacing32 : SPACING.spacing16}
minWidth={showODDStyle ? SPACING.spacing32 : SPACING.spacing16}
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess using the same value for min/max is the same as the previous code.
Do they behave differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Surprisingly, they do. Long text would squish the icon, shrinking it to just a few pixels wide. Rather than figuring out the max length of the text area for both desktop and ODD and enforcing it there, it was cleaner to just lock the icon size by setting the min and max size.

@ewagoner ewagoner force-pushed the RAUT-412-toast-tweaks branch from 5842d82 to 087e367 Compare May 16, 2023 19:10
@koji
Copy link
Contributor

koji commented May 16, 2023

maybe including the style updating for a long name case too?

Screen.Recording.2023-05-16.at.5.12.34.PM.mov

@ewagoner
Copy link
Contributor Author

maybe including the style updating for a long name case too?

Thanks for posting that! I couldn't reproduce this in storybook, so it's good to have a real-world example.

@ewagoner ewagoner requested review from koji and a team May 17, 2023 15:30
@ewagoner
Copy link
Contributor Author

@koji Found the width issue in the ToasterOven and fixed it there.

@ewagoner ewagoner merged commit bb13cab into edge May 18, 2023
@ewagoner ewagoner deleted the RAUT-412-toast-tweaks branch May 18, 2023 15:31
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.

2 participants