Update actions to open GitHub issue templates (#23747)

Release Notes:

- N/A
This commit is contained in:
Joseph T. Lyons 2025-01-27 18:17:43 -05:00 committed by GitHub
parent 15933d478f
commit 06424c9608
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,25 +21,18 @@ const fn zed_repo_url() -> &'static str {
"https://github.com/zed-industries/zed" "https://github.com/zed-industries/zed"
} }
fn request_feature_url(specs: &SystemSpecs) -> String { fn request_feature_url() -> String {
format!( "https://github.com/zed-industries/zed/issues/new?template=0_feature_request.yml".to_string()
concat!(
"https://github.com/zed-industries/zed/issues/new",
"?labels=admin+read%2Ctriage%2Cenhancement",
"&template=0_feature_request.yml",
"&environment={}"
),
urlencoding::encode(&specs.to_string())
)
} }
fn file_bug_report_url(specs: &SystemSpecs) -> String { fn file_bug_report_url(specs: &SystemSpecs) -> String {
format!( format!(
concat!( concat!(
"https://github.com/zed-industries/zed/issues/new", "https://github.com/zed-industries/zed/issues/new",
"?labels=admin+read%2Ctriage%2Cbug", "?",
"&template=1_bug_report.yml", "template=1_bug_report.yml",
"&environment={}" "&",
"environment={}"
), ),
urlencoding::encode(&specs.to_string()) urlencoding::encode(&specs.to_string())
) )
@ -74,11 +67,9 @@ pub fn init(cx: &mut App) {
.detach(); .detach();
}) })
.register_action(|_, _: &RequestFeature, window, cx| { .register_action(|_, _: &RequestFeature, window, cx| {
let specs = SystemSpecs::new(window, cx);
cx.spawn_in(window, |_, mut cx| async move { cx.spawn_in(window, |_, mut cx| async move {
let specs = specs.await;
cx.update(|_, cx| { cx.update(|_, cx| {
cx.open_url(&request_feature_url(&specs)); cx.open_url(&request_feature_url());
}) })
.log_err(); .log_err();
}) })