Fix the buttons not working in key context view (#28910)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-04-16 15:02:37 -06:00 committed by GitHub
parent 3fef3cc392
commit 602ae84542
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -206,12 +206,12 @@ impl Render for KeyContextView {
.mt_4() .mt_4()
.gap_4() .gap_4()
.child( .child(
Button::new("default", "Open Documentation") Button::new("open_documentation", "Open Documentation")
.style(ButtonStyle::Filled) .style(ButtonStyle::Filled)
.on_click(|_, _, cx| cx.open_url("https://zed.dev/docs/key-bindings")), .on_click(|_, _, cx| cx.open_url("https://zed.dev/docs/key-bindings")),
) )
.child( .child(
Button::new("default", "View default keymap") Button::new("view_default_keymap", "View default keymap")
.style(ButtonStyle::Filled) .style(ButtonStyle::Filled)
.key_binding(ui::KeyBinding::for_action( .key_binding(ui::KeyBinding::for_action(
&zed_actions::OpenDefaultKeymap, &zed_actions::OpenDefaultKeymap,
@ -219,16 +219,14 @@ impl Render for KeyContextView {
cx cx
)) ))
.on_click(|_, window, cx| { .on_click(|_, window, cx| {
window.dispatch_action(workspace::SplitRight.boxed_clone(), cx);
window.dispatch_action(zed_actions::OpenDefaultKeymap.boxed_clone(), cx); window.dispatch_action(zed_actions::OpenDefaultKeymap.boxed_clone(), cx);
}), }),
) )
.child( .child(
Button::new("default", "Edit your keymap") Button::new("edit_your_keymap", "Edit your keymap")
.style(ButtonStyle::Filled) .style(ButtonStyle::Filled)
.key_binding(ui::KeyBinding::for_action(&zed_actions::OpenKeymap, window, cx)) .key_binding(ui::KeyBinding::for_action(&zed_actions::OpenKeymap, window, cx))
.on_click(|_, window, cx| { .on_click(|_, window, cx| {
window.dispatch_action(workspace::SplitRight.boxed_clone(), cx);
window.dispatch_action(zed_actions::OpenKeymap.boxed_clone(), cx); window.dispatch_action(zed_actions::OpenKeymap.boxed_clone(), cx);
}), }),
), ),