Add a way to clear activity indicator (#30156)

Follow-up of https://github.com/zed-industries/zed/pull/30015

* Restyles the dismiss and close buttons a bit: change the dismiss icon
and add tooltips with the bindings to both
* Allows ESC to clear any status that's in the activity indicator now,
if all notifications are cleared: this won't suppress any further status
additions though, so statuses may resurface later

Release Notes:

- Added a way to clear activity indicator
This commit is contained in:
Kirill Bulatov 2025-05-07 20:50:52 +03:00 committed by GitHub
parent 77ac82587a
commit 6e19c9b141
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 88 additions and 19 deletions

View file

@ -22,6 +22,7 @@ use ui::{
Avatar, Button, Icon, IconButton, IconName, Label, Tab, Tooltip, h_flex, prelude::*, v_flex,
};
use util::{ResultExt, TryFutureExt};
use workspace::SuppressNotification;
use workspace::notifications::{
Notification as WorkspaceNotification, NotificationId, SuppressEvent,
};
@ -823,11 +824,19 @@ impl Render for NotificationToast {
.child(Label::new(self.text.clone()))
.child(
IconButton::new("close", IconName::Close)
.tooltip(|window, cx| Tooltip::for_action("Close", &menu::Cancel, window, cx))
.on_click(cx.listener(|_, _, _, cx| cx.emit(DismissEvent))),
)
.child(
IconButton::new("suppress", IconName::XCircle)
.tooltip(Tooltip::text("Do not show until restart"))
IconButton::new("suppress", IconName::SquareMinus)
.tooltip(|window, cx| {
Tooltip::for_action(
"Do not show until restart",
&SuppressNotification,
window,
cx,
)
})
.on_click(cx.listener(|_, _, _, cx| cx.emit(SuppressEvent))),
)
.on_click(cx.listener(|this, _, window, cx| {