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

🪟 🐛 Truncate Displayed External Message for Failure/Partial Failure Jobs #15633

Merged
merged 4 commits into from
Aug 16, 2022

Conversation

teallarson
Copy link
Contributor

@teallarson teallarson commented Aug 13, 2022

What

Limit error message to not overflow the default cell size on the Jobs Log page.

Note: this does not guarantee a useful error message (see example).

I imagine we may want to approach this on the back end to parse the body of the external message as something more useful.

BEFORE:
Screen Shot 2022-08-13 at 11 05 17 AM

AFTER:
Screen Shot 2022-08-15 at 3 11 13 PM

How

Use CSS to truncate the message at the width of the cell it's within.

@teallarson teallarson requested a review from a team as a code owner August 13, 2022 15:09
@github-actions github-actions bot added area/platform issues related to the platform area/frontend Related to the Airbyte webapp labels Aug 13, 2022
@teallarson teallarson changed the title truncate error message 🪟 🐛 Truncate Displayed External Message for Failure/Partial Failure Jobs Aug 13, 2022
@timroes
Copy link
Contributor

timroes commented Aug 14, 2022

I think it would be better if we'd try using CSS text truncation to truncate this line here, instead of cutting it off after some specific amount of characters. That would also help having the text actually still in the DOM for accessibility purposes and it's just cut design wise. Given how much nesting we have in this form, cutting that inner line of might require to change some parent components width/flex properties to properly get styled. Could we give this a try?

@teallarson
Copy link
Contributor Author

Updated AFTER screenshot with new implementation.

@teallarson teallarson force-pushed the teal/truncate-log-error-message branch from de5b4ce to 21d4334 Compare August 15, 2022 19:21
@@ -8,12 +8,14 @@
.titleCell {
display: flex;
color: colors.$dark-blue;
min-width: 0;
Copy link
Contributor Author

@teallarson teallarson Aug 15, 2022

Choose a reason for hiding this comment

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

In order to keep this item from growing to overflow its parents. Same thing below in .justification


.statusIcon {
display: flex;
align-items: center;
justify-content: center;
width: 75px;
min-width: 75px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flexbox handles min-width in an odd way. This prevents it from resizing the statusIcon and messing up the flow when the content of the title cell is very long.

Copy link
Contributor Author

@teallarson teallarson Aug 15, 2022

Choose a reason for hiding this comment

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

Found this thread helpful if anyone is curious on why min-width is somehow the secret sauce here and above: https://stackoverflow.com/questions/36230944/prevent-flex-items-from-overflowing-a-container

Copy link
Contributor

@krishnaglick krishnaglick left a comment

Choose a reason for hiding this comment

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

Tested locally, LGTM

@teallarson teallarson merged commit bcc698c into master Aug 16, 2022
@teallarson teallarson deleted the teal/truncate-log-error-message branch August 16, 2022 15:17
rodireich pushed a commit that referenced this pull request Aug 20, 2022
…obs (#15633)

* truncate error message

* add ellipses if truncated

* trim to 136 to prevent extra wrap

* use flexbox to truncate message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend Related to the Airbyte webapp area/platform issues related to the platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants