Remove 2 suffix for picker, feedback
Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
0ac8aae17b
commit
bcad3a5847
32 changed files with 410 additions and 1733 deletions
|
@ -1,13 +1,14 @@
|
|||
pub mod deploy_feedback_button;
|
||||
pub mod feedback_editor;
|
||||
pub mod feedback_info_text;
|
||||
pub mod submit_feedback_button;
|
||||
|
||||
mod system_specs;
|
||||
use gpui::{actions, platform::PromptLevel, AppContext, ClipboardItem, ViewContext};
|
||||
use gpui::{actions, AppContext, ClipboardItem, PromptLevel};
|
||||
use system_specs::SystemSpecs;
|
||||
use workspace::Workspace;
|
||||
|
||||
pub mod deploy_feedback_button;
|
||||
pub mod feedback_modal;
|
||||
|
||||
actions!(feedback, [GiveFeedback, SubmitFeedback]);
|
||||
|
||||
mod system_specs;
|
||||
|
||||
actions!(
|
||||
zed,
|
||||
[
|
||||
|
@ -19,44 +20,42 @@ actions!(
|
|||
);
|
||||
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
feedback_editor::init(cx);
|
||||
// TODO: a way to combine these two into one?
|
||||
cx.observe_new_views(feedback_modal::FeedbackModal::register)
|
||||
.detach();
|
||||
|
||||
cx.add_action(
|
||||
move |_: &mut Workspace,
|
||||
_: &CopySystemSpecsIntoClipboard,
|
||||
cx: &mut ViewContext<Workspace>| {
|
||||
let specs = SystemSpecs::new(&cx).to_string();
|
||||
cx.prompt(
|
||||
PromptLevel::Info,
|
||||
&format!("Copied into clipboard:\n\n{specs}"),
|
||||
&["OK"],
|
||||
);
|
||||
let item = ClipboardItem::new(specs.clone());
|
||||
cx.write_to_clipboard(item);
|
||||
},
|
||||
);
|
||||
cx.observe_new_views(|workspace: &mut Workspace, _| {
|
||||
workspace
|
||||
.register_action(|_, _: &CopySystemSpecsIntoClipboard, cx| {
|
||||
let specs = SystemSpecs::new(&cx).to_string();
|
||||
|
||||
cx.add_action(
|
||||
|_: &mut Workspace, _: &RequestFeature, cx: &mut ViewContext<Workspace>| {
|
||||
let url = "https://github.com/zed-industries/community/issues/new?assignees=&labels=enhancement%2Ctriage&template=0_feature_request.yml";
|
||||
cx.platform().open_url(url);
|
||||
},
|
||||
);
|
||||
|
||||
cx.add_action(
|
||||
move |_: &mut Workspace, _: &FileBugReport, cx: &mut ViewContext<Workspace>| {
|
||||
let url = format!(
|
||||
"https://github.com/zed-industries/community/issues/new?assignees=&labels=defect%2Ctriage&template=2_bug_report.yml&environment={}",
|
||||
urlencoding::encode(&SystemSpecs::new(&cx).to_string())
|
||||
);
|
||||
cx.platform().open_url(&url);
|
||||
},
|
||||
);
|
||||
|
||||
cx.add_global_action(open_zed_community_repo);
|
||||
}
|
||||
|
||||
pub fn open_zed_community_repo(_: &OpenZedCommunityRepo, cx: &mut AppContext) {
|
||||
let url = "https://github.com/zed-industries/community";
|
||||
cx.platform().open_url(&url);
|
||||
let prompt = cx.prompt(
|
||||
PromptLevel::Info,
|
||||
&format!("Copied into clipboard:\n\n{specs}"),
|
||||
&["OK"],
|
||||
);
|
||||
cx.spawn(|_, _cx| async move {
|
||||
prompt.await.ok();
|
||||
})
|
||||
.detach();
|
||||
let item = ClipboardItem::new(specs.clone());
|
||||
cx.write_to_clipboard(item);
|
||||
})
|
||||
.register_action(|_, _: &RequestFeature, cx| {
|
||||
let url = "https://github.com/zed-industries/community/issues/new?assignees=&labels=enhancement%2Ctriage&template=0_feature_request.yml";
|
||||
cx.open_url(url);
|
||||
})
|
||||
.register_action(move |_, _: &FileBugReport, cx| {
|
||||
let url = format!(
|
||||
"https://github.com/zed-industries/community/issues/new?assignees=&labels=defect%2Ctriage&template=2_bug_report.yml&environment={}",
|
||||
urlencoding::encode(&SystemSpecs::new(&cx).to_string())
|
||||
);
|
||||
cx.open_url(&url);
|
||||
})
|
||||
.register_action(move |_, _: &OpenZedCommunityRepo, cx| {
|
||||
let url = "https://github.com/zed-industries/community";
|
||||
cx.open_url(&url);
|
||||
});
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue