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

Always resolve existing before showing new notification #13668

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

msujew
Copy link
Member

@msujew msujew commented Apr 29, 2024

What it does

Closes #13661

Using the vscode.window.show<Severity>Message API in VSCode behaves differently in Theia compared to VSCode when calling the method multiple times. Calling the method again with the same arguments will first off always resolve the previous call with undefined. Additionally, the newest message will always appear first in the toasts and notification center.

This change aligns Theia to this behavior.

How to test

  1. Download and install this text extension (a modified notification extension sample).
  2. Run the Show Info Notification and then the Show Warning Notification command. Both notifications should appear as expected
  3. Run the Show Info Notification again. The initial call should resolve with undefined (this is indicated in the backend console). The notification should appear as the first notification in the toasts/notification center.

Review checklist

Reminder for reviewers

@msujew msujew added notifications issues related to notifications vscode issues related to VSCode compatibility labels Apr 29, 2024
Copy link
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

Code looks good to me.
Tested with the provided extension and existing messages are now properly resolved before displaying a new notification. 👍🏼

@tortmayr tortmayr merged commit c2be137 into master Jun 20, 2024
14 checks passed
@github-actions github-actions bot added this to the 1.51.0 milestone Jun 20, 2024
@msujew msujew deleted the msujew/notification-vscode-alignment branch June 20, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notifications issues related to notifications vscode issues related to VSCode compatibility
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add the same message. This message is not displayed at the top of the notification window.
2 participants