Add panic if version is 0.91

This commit is contained in:
Mikayla Maki 2023-05-31 14:06:36 -07:00
parent ef80b539d1
commit ed0b9acb0a
No known key found for this signature in database
3 changed files with 9 additions and 17 deletions

View file

@ -163,9 +163,10 @@ pub mod simple_message_notification {
use gpui::{ use gpui::{
actions, actions,
elements::{Flex, MouseEventHandler, Padding, ParentElement, Svg, Text}, elements::{Flex, MouseEventHandler, Padding, ParentElement, Svg, Text},
fonts::TextStyle,
impl_actions, impl_actions,
platform::{CursorStyle, MouseButton}, platform::{CursorStyle, MouseButton},
AnyElement, AppContext, Element, Entity, View, ViewContext, fonts::TextStyle, AnyElement, AppContext, Element, Entity, View, ViewContext,
}; };
use menu::Cancel; use menu::Cancel;
use serde::Deserialize; use serde::Deserialize;
@ -224,8 +225,9 @@ pub mod simple_message_notification {
} }
} }
pub fn new_element(message: fn(TextStyle, &AppContext) -> AnyElement<MessageNotification>) -> MessageNotification pub fn new_element(
{ message: fn(TextStyle, &AppContext) -> AnyElement<MessageNotification>,
) -> MessageNotification {
Self { Self {
message: NotificationMessage::Element(message), message: NotificationMessage::Element(message),
on_click: None, on_click: None,
@ -279,7 +281,8 @@ pub mod simple_message_notification {
.with_child( .with_child(
Flex::row() Flex::row()
.with_child( .with_child(
message.contained() message
.contained()
.with_style(theme.message.container) .with_style(theme.message.container)
.aligned() .aligned()
.top() .top()

View file

@ -541,7 +541,6 @@ impl Pane {
cx.spawn(|_, mut cx| async move { notify_of_new_dock(&workspace_handle, &mut cx) }) cx.spawn(|_, mut cx| async move { notify_of_new_dock(&workspace_handle, &mut cx) })
.detach(); .detach();
if self.zoomed { if self.zoomed {
cx.emit(Event::ZoomOut); cx.emit(Event::ZoomOut);
} else if !self.items.is_empty() { } else if !self.items.is_empty() {

View file

@ -3198,13 +3198,8 @@ fn notify_of_new_dock(workspace: &WeakViewHandle<Workspace>, cx: &mut AsyncAppCo
if workspace if workspace
.read_with(cx, |workspace, cx| { .read_with(cx, |workspace, cx| {
let version = cx.global::<ZedVersion>().0; let version = cx.global::<ZedVersion>().0;
if !version.contains("0.88") if version.contains("0.91") {
&& !version.contains("0.89") panic!("Please remove the dock key binding change notification");
&& !version.contains("0.90")
&& !version.contains("0.91")
&& !version.contains("0.92")
{
return true;
} }
workspace.has_shown_notification_once::<MessageNotification>(MESSAGE_ID, cx) workspace.has_shown_notification_once::<MessageNotification>(MESSAGE_ID, cx)
}) })
@ -3251,8 +3246,6 @@ fn notify_of_new_dock(workspace: &WeakViewHandle<Workspace>, cx: &mut AsyncAppCo
workspace workspace
.update(cx, |workspace, cx| { .update(cx, |workspace, cx| {
workspace.show_notification_once(2, cx, |cx| { workspace.show_notification_once(2, cx, |cx| {
cx.add_view(|_| { cx.add_view(|_| {
MessageNotification::new_element(|text, _| { MessageNotification::new_element(|text, _| {
Text::new( Text::new(
@ -3274,9 +3267,6 @@ fn notify_of_new_dock(workspace: &WeakViewHandle<Workspace>, cx: &mut AsyncAppCo
}) })
.into_any() .into_any()
}) })
// MessageNotification::new_(
// "Looking for the dock? Try 'ctrl-`'!\n'shift-escape' now zooms your pane",
// )
.with_click_message("Read more about the new panel system") .with_click_message("Read more about the new panel system")
.on_click(|cx| cx.platform().open_url(NEW_PANEL_BLOG_POST)) .on_click(|cx| cx.platform().open_url(NEW_PANEL_BLOG_POST))
}) })