Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Remove welcome experience action Make logo switch between light and dark
Mikayla Makif62e0b502ab2
diff --git a/Cargo.lock b/Cargo.lockindex 9d950712a89..ac4cbb37615 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.pngdeleted file mode 100644index 17f92d2c1af..00000000000Binary files a/assets/images/zed-logo-90x90.png and /dev/null differdiff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rsindex a95a8b2deb5..08a83fbc435 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.tomlindex d3b0e09697c..3da90deb2d1 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.rsindex 246ff267171..a2386b8d280 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<AppState>, 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.rsindex 13a44fef106..9982b4114aa 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<AppState>, 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.rsindex 3b48632265d..3c093836f20 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<AppState>, 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.tsindex 2601a126916..80cb884c489 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 },