Skip to content

Commit

Permalink
title_bar: Remove dependency on feedback (zed-industries#21013)
Browse files Browse the repository at this point in the history
This PR removes the `title_bar` crate's dependency on the `feedback`
crate.

The `feedback::GiveFeedback` action now resides at
`zed_actions::feedback::GiveFeedback`.

`title_bar` now no longer depends on `editor` 🥳 

Release Notes:

- N/A
  • Loading branch information
maxdeviant authored Nov 21, 2024
1 parent 614b3b9 commit 2868b67
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion crates/feedback/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ db.workspace = true
editor.workspace = true
futures.workspace = true
gpui.workspace = true
human_bytes = "0.4.1"
http_client.workspace = true
human_bytes = "0.4.1"
language.workspace = true
log.workspace = true
menu.workspace = true
Expand All @@ -39,6 +39,7 @@ ui.workspace = true
urlencoding = "2.1.2"
util.workspace = true
workspace.workspace = true
zed_actions.workspace = true

[dev-dependencies]
editor = { workspace = true, features = ["test-support"] }
2 changes: 0 additions & 2 deletions crates/feedback/src/feedback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use workspace::Workspace;

pub mod feedback_modal;

actions!(feedback, [GiveFeedback, SubmitFeedback]);

mod system_specs;

actions!(
Expand Down
3 changes: 2 additions & 1 deletion crates/feedback/src/feedback_modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ use serde_derive::Serialize;
use ui::{prelude::*, Button, ButtonStyle, IconPosition, Tooltip};
use util::ResultExt;
use workspace::{DismissDecision, ModalView, Workspace};
use zed_actions::feedback::GiveFeedback;

use crate::{system_specs::SystemSpecs, GiveFeedback, OpenZedRepo};
use crate::{system_specs::SystemSpecs, OpenZedRepo};

// For UI testing purposes
const SEND_SUCCESS_IN_DEV_MODE: bool = true;
Expand Down
3 changes: 0 additions & 3 deletions crates/title_bar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test-support = [
"call/test-support",
"client/test-support",
"collections/test-support",
"editor/test-support",
"gpui/test-support",
"http_client/test-support",
"project/test-support",
Expand All @@ -31,7 +30,6 @@ test-support = [
auto_update.workspace = true
call.workspace = true
client.workspace = true
feedback.workspace = true
feature_flags.workspace = true
gpui.workspace = true
notifications.workspace = true
Expand All @@ -54,7 +52,6 @@ windows.workspace = true
call = { workspace = true, features = ["test-support"] }
client = { workspace = true, features = ["test-support"] }
collections = { workspace = true, features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }
gpui = { workspace = true, features = ["test-support"] }
http_client = { workspace = true, features = ["test-support"] }
notifications = { workspace = true, features = ["test-support"] }
Expand Down
5 changes: 4 additions & 1 deletion crates/title_bar/src/application_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ impl Render for ApplicationMenu {
url: "https://zed.dev/docs".into(),
}),
)
.action("Give Feedback", Box::new(feedback::GiveFeedback))
.action(
"Give Feedback",
Box::new(zed_actions::feedback::GiveFeedback),
)
.action("Check for Updates", Box::new(auto_update::Check))
.action("View Telemetry", Box::new(zed_actions::OpenTelemetryLog))
.action(
Expand Down
2 changes: 1 addition & 1 deletion crates/zed/src/zed/app_menus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub fn app_menus() -> Vec<Menu> {
MenuItem::action("View Telemetry", zed_actions::OpenTelemetryLog),
MenuItem::action("View Dependency Licenses", zed_actions::OpenLicenses),
MenuItem::action("Show Welcome", workspace::Welcome),
MenuItem::action("Give Feedback...", feedback::GiveFeedback),
MenuItem::action("Give Feedback...", zed_actions::feedback::GiveFeedback),
MenuItem::separator(),
MenuItem::action(
"Documentation",
Expand Down
6 changes: 6 additions & 0 deletions crates/zed_actions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ pub mod command_palette {
actions!(command_palette, [Toggle]);
}

pub mod feedback {
use gpui::actions;

actions!(feedback, [GiveFeedback]);
}

pub mod theme_selector {
use gpui::impl_actions;
use serde::Deserialize;
Expand Down

0 comments on commit 2868b67

Please sign in to comment.