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

Limit the size of the dialog box and let the message overflow #209840

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

werat
Copy link
Contributor

@werat werat commented Apr 8, 2024

In case the error message is too large the dialog box can be too big and not fit into the screen. Add a height limit for the details message and let it overflow with scrollbars.

In case the error message is too large the dialog box can be too big and not fit into the screen. Add a height limit for the details message and let it overflow with scrollbars.
@werat
Copy link
Contributor Author

werat commented Apr 25, 2024

Friendly ping

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

The dialog can still overflow if the message is very large:

image

I would think that a fix here should also consider message and not just detail.

Interestingly a native macOS dialog also explodes:

image

@bpasero
Copy link
Member

bpasero commented Apr 29, 2024

I actually wonder if we should address this for both custom and native dialogs (see #87266) and simply cut the message and the detail off when it becomes very large. We could cut it of in the middle and add a "..." ellipsis. Then, this fix becomes something to be changed here, rather than CSS:

export abstract class AbstractDialogHandler implements IDialogHandler {

This is the abstract dialog handler used for both web and desktop (custom and native) and it could massage the options to reduce their length.

@werat
Copy link
Contributor Author

werat commented Apr 29, 2024

Thank you for the review and comments!

I would think that a fix here should also consider message and not just detail.

I made the whole message container scrollable, this should fix the problem of a very large message too.

I actually wonder if we should address this for both custom and native dialogs (see #87266) and simply cut the message and the detail off when it becomes very large.

This was my initial approach actually, but in the end I've decided against it:

  • Very long error messages are rare and it should be a real shame to cut out the important information
  • Since it's rare, the "prettiness" of the UI is not super important and being able to see the whole error might be worth having a slighly uglier dialog.

I did not think of the native dialogs though. Is it possible to make them scrollable too?

@werat
Copy link
Contributor Author

werat commented May 28, 2024

@bpasero do you think my updated fix is fine or would you still prefer to truncate the message in the base dialog handler?

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.

None yet

5 participants