-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Restyle block warnings #5383
Restyle block warnings #5383
Conversation
If the block has less than 500px, should we apply this? |
@bordoni I think it's still applicable for blocks that don't exceed 500px -- it'll keep the warning position consistent across different blocks. Otherwise, short blocks would have centered warnings and taller ones wouldn't. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work here 👍I'd prefer if the gitignore
changes were not included here though.
@aduth I went ahead and removed swap files from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code-wise this looks great, nice work 👍
I'm going to flag for design review because I'm curious if, after applying the max-height
, it's necessary/ideal to still move the warning to the top of the block, or if the original issue is resolved by the application of a max-height alone.
I think it's fine to apply a max-height. I'm more curious what happens if the block is shorter than the warning itself. If the warning just expands the block to fit, then I think it's fine 👍 👍 |
@jasmussen Here's what happens when the block is shorter than the warning itself: The block expands to the |
Interesting. This min-height, where's that from? Is that from the block or something that the error wrapper adds? If it's from the block then I think it's fine. If it's from the wrapper then there shouldn't be a min-height. |
It's applied to the block when a warning is present to avoid the case where the block itself is too short to display the warning (e.g. single line paragraph). But it was optimized for (a) when the prompt had more lines of text in it and (b) was vertically centered. |
I think we can probably reduce that min-height to 150 for now, merge this in, and then we can always look at additional improvements in the future. Perfect should not be the enemy of improvements here and now. |
@jasmussen I think the 250px min-height was to also account for smaller viewports. With a 150px min-height, warnings gets cut off like the screenshot below: |
Oh indeed, then keepit as is and we'll look at improvements separately. |
cc @aduth |
Two ideas for (separate) enhancements:
|
Description
This PR is to address #5201, where large blocks that throw a warning make the warning hard to find and interact with. The change shortens blocks with warnings with a
max-height
, and warnings hug the top of the blocks.How Has This Been Tested?
<alskdjfl
Screenshots (jpeg or gifs if applicable):
Checklist: