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

Modal notification does not render newlines or have a max-width #8071

Closed
tetchel opened this issue Jun 22, 2020 · 7 comments · Fixed by #8080
Closed

Modal notification does not render newlines or have a max-width #8071

tetchel opened this issue Jun 22, 2020 · 7 comments · Fixed by #8080
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help messaging issues related to messaging

Comments

@tetchel
Copy link
Contributor

tetchel commented Jun 22, 2020

Bug Description:

A modal dialog shown using

vscode.window.showWarningMessage(<msg>, { modal: true })

does not render newlines or have a max-width, which makes long messages stretch the dialog the width of the viewport, which looks weird.

Steps to Reproduce:

Have a modal notification with a long message in it and newlines. In VS Code, the text is wrapped, and newlines are rendered.
image

But in Theia, the newlines are ignored, and the dialog stretches.
image

Additional Information

  • Operating System: all
  • Theia Version: 0.15.0
@vince-fugnitto vince-fugnitto added the messaging issues related to messaging label Jun 22, 2020
@vince-fugnitto
Copy link
Member

@tetchel would you like to prepare a pull-request to address the issue?

@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help labels Jun 23, 2020
@kittaakos
Copy link
Contributor

Known limitation: #7283 (comment)?

@vince-fugnitto
Copy link
Member

Known limitation: #7283 (comment)?

The limitation is only for notification messages (toasts) similarly to vscode.
For notifications which are present in a dialog window, the explicit newlines are respected:

aaa

The issue I believe is that we likely do not handle template literal newlines and we don't have a max-width to the dialog to look consistent.

@kittaakos
Copy link
Contributor

The limitation is only for notification messages (toasts) similarly to vscode.

Yes, that was clear. vscode.window.showWarningMessage uses the notification messages.

@vince-fugnitto
Copy link
Member

The limitation is only for notification messages (toasts) similarly to vscode.

Yes, that was clear. vscode.window.showWarningMessage uses the notification messages.

Unless we use modal: true as an option (then it is rendered as a modal and not a toast):

vscode.window.showWarningMessage(<msg>, { modal: true })

@kittaakos
Copy link
Contributor

Unless we use modal: true as an option (then it is rendered as a modal and not a toast):

I see your point. Is it a missing feature? So when modal is true, we should open a Dialog instead of a notification popup?

@vince-fugnitto
Copy link
Member

Unless we use modal: true as an option (then it is rendered as a modal and not a toast):

I see your point. Is it a missing feature? So when modal is true, we should open a Dialog instead of a notification popup?

The custom dialog that I sent a screenshot of is the modal implementation that we currently have (we do not use the browser modal). The issue is that we probably do not support string literals with newlines (which is what the codewind extension uses), and we likely do not have any max-width to force wrapping of the textual content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help messaging issues related to messaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants