From f62e0b502ab20c77a5e8296e0853fcfcbf2e9faa Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 8 Mar 2023 12:12:27 -0800 Subject: [PATCH] Remove welcome experience action Make logo switch between light and dark co-authored-by: Nathan --- Cargo.lock | 1 + assets/images/zed-logo-90x90.png | Bin 12413 -> 0 bytes crates/project_panel/src/project_panel.rs | 2 +- crates/welcome/Cargo.toml | 1 + crates/welcome/src/welcome.rs | 25 ++++++++++++-- crates/zed/src/main.rs | 21 ++++++------ crates/zed/src/zed.rs | 29 +--------------- styles/src/styleTree/projectPanel.ts | 39 ++++++++-------------- 8 files changed, 51 insertions(+), 67 deletions(-) delete mode 100644 assets/images/zed-logo-90x90.png diff --git a/Cargo.lock b/Cargo.lock index 9d950712a8..ac4cbb3761 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8029,6 +8029,7 @@ name = "welcome" version = "0.1.0" dependencies = [ "anyhow", + "db", "editor", "fuzzy", "gpui", diff --git a/assets/images/zed-logo-90x90.png b/assets/images/zed-logo-90x90.png deleted file mode 100644 index 17f92d2c1afbb8459fd31bfdc7ace50a412ce0a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12413 zcmZ{K2UJthvUcbK0tyP!QKU%;5G2%qq9P(iKza!!v;dLNds7hU9i${k@6x4%C^hsF ziZp=$0i^f#)R72F8#@>P@G>+ZiA+m#jn;o!IEK4qcc*AV4ML7baKs)<>J$9SJV?=iDbt)KYzEuONsoZlqIlq7V-#d zsY1oPtmVj|mZI1n#t3_(D!6 z8X|uyi1-MKDU@s6dxmE;>C zc0pX`J@smE(jXZ-6!7F0?Nh~jABD``Cv(<(r2GD&F$VDPX6RGe7>kEgF&q>Y_bYDl zJ$V&FVIi#%!SXEffmO8fOKBwg+B46X+AfAWA;aq2w*LBPx;NrIPZWmkIg@@4?tij3 z_|*BXex!Eh*&yluO;3`h2v;<4$d_ea>)n)uc^YeE#NzMoj!NIO(r(t?(+THqf4gAo z*!N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fCp3we!^!eCVEMbhpvM{lh9F>Pt0ic{gBS}pdyu~Q7s z6_7I7ulN0MC3C&R&efaA^>^9a-B0VYRgL|8^qnzz9}$~hOLU7Exe*? zIj@f`KJ&PCe;nJ{SkQ?ZF1`7@vrhDd@h5hEnEMg*W`plkLS?hK+44cr-q>}+8scp` zDZ^OSKRsnQtbaA259L-`zpiNBr1@3<8kIBHXfWrZ;mYY|dg-#*qb^>qS#JgryikAW zhqPWj2zZ>wIvwjFB^hBgiGKDV@Tj4>b_S;l*?P!8fz%IEHFg(^ zm$JyI;>lfw6{fHu)d)-uWN~y2ZgN#}@6x7iVbWPQMKD(4bXq=aY+@pTk+}0D8(%RI*J~{vZ3keWzBIJX13$QJd7g$ehp{AC~i3 z&N*F|ekkFa4?;}E@+4ii&U3EI(Yi{W#q1wkD34JEy%aLZgR7>lt41iTyqZwZi*$hRI~_R>ox+>?(i5&%|Hm>`3j(&)_rv WubU>a9)CZGQhKiXtn?`~@c#k#=|!0U diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index a95a8b2deb..08a83fbc43 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -1329,7 +1329,7 @@ impl View for ProjectPanel { keystroke_label( parent_view_id, - "Open project", + "Open a project", &button_style, context_menu_item.keystroke, workspace::Open, diff --git a/crates/welcome/Cargo.toml b/crates/welcome/Cargo.toml index d3b0e09697..3da90deb2d 100644 --- a/crates/welcome/Cargo.toml +++ b/crates/welcome/Cargo.toml @@ -16,6 +16,7 @@ log = "0.4" editor = { path = "../editor" } fuzzy = { path = "../fuzzy" } gpui = { path = "../gpui" } +db = { path = "../db" } install_cli = { path = "../install_cli" } project = { path = "../project" } settings = { path = "../settings" } diff --git a/crates/welcome/src/welcome.rs b/crates/welcome/src/welcome.rs index 246ff26717..a2386b8d28 100644 --- a/crates/welcome/src/welcome.rs +++ b/crates/welcome/src/welcome.rs @@ -1,7 +1,8 @@ mod base_keymap_picker; -use std::borrow::Cow; +use std::{borrow::Cow, sync::Arc}; +use db::kvp::KEY_VALUE_STORE; use gpui::{ elements::{Empty, Flex, Label, MouseEventHandler, ParentElement, Svg}, Action, Element, ElementBox, Entity, MouseButton, MutableAppContext, RenderContext, @@ -9,10 +10,15 @@ use gpui::{ }; use settings::{settings_file::SettingsFile, Settings, SettingsFileContent}; use theme::CheckboxStyle; -use workspace::{item::Item, PaneBackdrop, Welcome, Workspace, WorkspaceId}; +use workspace::{ + item::Item, open_new, sidebar::SidebarSide, AppState, PaneBackdrop, Welcome, Workspace, + WorkspaceId, +}; use crate::base_keymap_picker::ToggleBaseKeymapSelector; +pub const FIRST_OPEN: &str = "first_open"; + pub fn init(cx: &mut MutableAppContext) { cx.add_action(|workspace: &mut Workspace, _: &Welcome, cx| { let welcome_page = cx.add_view(WelcomePage::new); @@ -22,6 +28,21 @@ pub fn init(cx: &mut MutableAppContext) { base_keymap_picker::init(cx); } +pub fn show_welcome_experience(app_state: &Arc, cx: &mut MutableAppContext) { + open_new(&app_state, cx, |workspace, cx| { + workspace.toggle_sidebar(SidebarSide::Left, cx); + let welcome_page = cx.add_view(|cx| WelcomePage::new(cx)); + workspace.add_item_to_center(Box::new(welcome_page.clone()), cx); + cx.focus(welcome_page); + cx.notify(); + }) + .detach(); + + db::write_and_log(cx, || { + KEY_VALUE_STORE.write_kvp(FIRST_OPEN.to_string(), "false".to_string()) + }); +} + pub struct WelcomePage { _settings_subscription: Subscription, } diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 13a44fef10..9982b4114a 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -36,6 +36,7 @@ use std::{ path::PathBuf, sync::Arc, thread, time::Duration, }; use terminal_view::{get_working_directory, TerminalView}; +use welcome::{show_welcome_experience, FIRST_OPEN}; use fs::RealFs; use settings::watched_json::WatchedJsonFile; @@ -46,10 +47,7 @@ use util::{channel::RELEASE_CHANNEL, paths, ResultExt, TryFutureExt}; use workspace::{ self, item::ItemHandle, notifications::NotifyResultExt, AppState, NewFile, OpenPaths, Workspace, }; -use zed::{ - self, build_window_options, initialize_workspace, languages, menus, WelcomeExperience, - FIRST_OPEN, -}; +use zed::{self, build_window_options, initialize_workspace, languages, menus}; fn main() { let http = http::client(); @@ -206,7 +204,7 @@ fn main() { cx.platform().activate(true); let paths = collect_path_args(); if paths.is_empty() { - cx.spawn(|cx| async move { restore_or_create_workspace(cx).await }) + cx.spawn(|cx| async move { restore_or_create_workspace(&app_state, cx).await }) .detach() } else { cx.dispatch_global_action(OpenPaths { paths }); @@ -219,8 +217,11 @@ fn main() { cx.update(|cx| workspace::open_paths(&paths, &app_state, None, cx)) .detach(); } else { - cx.spawn(|cx| async move { restore_or_create_workspace(cx).await }) - .detach() + cx.spawn({ + let app_state = app_state.clone(); + |cx| async move { restore_or_create_workspace(&app_state, cx).await } + }) + .detach() } cx.spawn(|cx| { @@ -259,7 +260,7 @@ fn main() { }); } -async fn restore_or_create_workspace(mut cx: AsyncAppContext) { +async fn restore_or_create_workspace(app_state: &Arc, mut cx: AsyncAppContext) { if let Some(location) = workspace::last_opened_workspace_paths().await { cx.update(|cx| { cx.dispatch_global_action(OpenPaths { @@ -267,9 +268,7 @@ async fn restore_or_create_workspace(mut cx: AsyncAppContext) { }) }); } else if matches!(KEY_VALUE_STORE.read_kvp(FIRST_OPEN), Ok(None)) { - cx.update(|cx| { - cx.dispatch_global_action(WelcomeExperience); - }); + cx.update(|cx| show_welcome_experience(app_state, cx)); } else { cx.update(|cx| { cx.dispatch_global_action(NewFile); diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index 3b48632265..3c093836f2 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -8,7 +8,6 @@ use breadcrumbs::Breadcrumbs; pub use client; use collab_ui::{CollabTitlebarItem, ToggleContactsMenu}; use collections::VecDeque; -use db::kvp::KEY_VALUE_STORE; pub use editor; use editor::{Editor, MultiBuffer}; @@ -35,9 +34,7 @@ use std::{borrow::Cow, env, path::Path, str, sync::Arc}; use util::{channel::ReleaseChannel, paths, ResultExt, StaffMode}; use uuid::Uuid; pub use workspace; -use workspace::{open_new, sidebar::SidebarSide, AppState, Restart, Workspace}; - -pub const FIRST_OPEN: &str = "first_open"; +use workspace::{sidebar::SidebarSide, AppState, Restart, Workspace}; #[derive(Deserialize, Clone, PartialEq)] pub struct OpenBrowser { @@ -69,7 +66,6 @@ actions!( DecreaseBufferFontSize, ResetBufferFontSize, ResetDatabase, - WelcomeExperience ] ); @@ -258,29 +254,6 @@ pub fn init(app_state: &Arc, cx: &mut gpui::MutableAppContext) { workspace.toggle_sidebar_item_focus(SidebarSide::Left, 0, cx); }, ); - - cx.add_global_action({ - let app_state = app_state.clone(); - move |_: &WelcomeExperience, cx| { - if !matches!(KEY_VALUE_STORE.read_kvp(FIRST_OPEN), Ok(None)) { - return; //noop, in case someone fires this from the command palette - } - - open_new(&app_state, cx, |workspace, cx| { - workspace.toggle_sidebar(SidebarSide::Left, cx); - let welcome_page = cx.add_view(|cx| welcome::WelcomePage::new(cx)); - workspace.add_item_to_center(Box::new(welcome_page.clone()), cx); - cx.focus(welcome_page); - cx.notify(); - }) - .detach(); - - db::write_and_log(cx, || { - KEY_VALUE_STORE.write_kvp(FIRST_OPEN.to_string(), "false".to_string()) - }); - } - }); - activity_indicator::init(cx); call::init(app_state.client.clone(), app_state.user_store.clone(), cx); settings::KeymapFileContent::load_defaults(cx); diff --git a/styles/src/styleTree/projectPanel.ts b/styles/src/styleTree/projectPanel.ts index 2601a12691..80cb884c48 100644 --- a/styles/src/styleTree/projectPanel.ts +++ b/styles/src/styleTree/projectPanel.ts @@ -30,37 +30,26 @@ export default function projectPanel(colorScheme: ColorScheme) { return { openProjectButton: { - ...text(layer, "mono", "active", { size: "sm" }), - background: background(layer, "on"), - cornerRadius: 6, - border: border(layer, "on"), + background: background(layer), + border: border(layer, "active"), + cornerRadius: 4, margin: { - top: 20, - left: 10, - right: 10 + top: 16, + left: 16, + right: 16, }, padding: { - bottom: 2, - left: 10, - right: 10, - top: 2, - }, - active: { - ...text(layer, "mono", "on", "inverted"), - background: background(layer, "on", "inverted"), - border: border(layer, "on", "inverted"), - }, - clicked: { - ...text(layer, "mono", "on", "pressed"), - background: background(layer, "on", "pressed"), - border: border(layer, "on", "pressed"), + top: 3, + bottom: 3, + left: 7, + right: 7, }, + ...text(layer, "sans", "default", { size: "sm" }), hover: { - ...text(layer, "mono", "on", "hovered"), - background: background(layer, "on", "hovered"), - border: border(layer, "on", "hovered"), + ...text(layer, "sans", "default", { size: "sm" }), + background: background(layer, "hovered"), + border: border(layer, "active"), }, - }, background: background(layer), padding: { left: 12, right: 12, top: 6, bottom: 6 },