Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Implement vertical scrolling for extended keymap load error information (#42542)
ihavecoke684a58fc8449
diff --git a/crates/workspace/src/notifications.rs b/crates/workspace/src/notifications.rsindex 6c1156b8339..75c35cda22d 100644--- a/crates/workspace/src/notifications.rs+++ b/crates/workspace/src/notifications.rs@@ -593,9 +593,9 @@ pub mod simple_message_notification {use gpui::{AnyElement, DismissEvent, EventEmitter, FocusHandle, Focusable, ParentElement, Render,- SharedString, Styled,+ ScrollHandle, SharedString, Styled,};- use ui::prelude::*;+ use ui::{WithScrollbar, prelude::*};use crate::notifications::NotificationFrame;@@ -617,6 +617,7 @@ pub mod simple_message_notification {show_close_button: bool,show_suppress_button: bool,title: Option<SharedString>,+ scroll_handle: ScrollHandle,}impl Focusable for MessageNotification {@@ -661,6 +662,7 @@ pub mod simple_message_notification {show_suppress_button: true,title: None,focus_handle: cx.focus_handle(),+ scroll_handle: ScrollHandle::new(),}}@@ -777,7 +779,18 @@ pub mod simple_message_notification {fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {NotificationFrame::new().with_title(self.title.clone())- .with_content((self.build_content)(window, cx))+ .with_content(+ div()+ .child(+ div()+ .id("message-notification-content")+ .max_h(vh(0.6, window))+ .overflow_y_scroll()+ .track_scroll(&self.scroll_handle.clone())+ .child((self.build_content)(window, cx)),+ )+ .vertical_scrollbar_for(self.scroll_handle.clone(), window, cx),+ ).show_close_button(self.show_close_button).show_suppress_button(self.show_suppress_button).on_close(cx.listener(|_, suppress, _, cx| {