From 521351da16b2fa74b4e592ab59892fcc58148457 Mon Sep 17 00:00:00 2001 From: Jason Zimdars Date: Tue, 6 May 2025 16:15:19 -0500 Subject: [PATCH] Add a keyboard shortcut --- app/views/commands/_form.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/commands/_form.html.erb b/app/views/commands/_form.html.erb index 50228b24f..b8ad7401e 100644 --- a/app/views/commands/_form.html.erb +++ b/app/views/commands/_form.html.erb @@ -3,7 +3,7 @@ <%= form_tag commands_path, id: "commands_form", class: [ "flex align-center gap-half", { "has-error" => has_error } ], - data: { controller: "form", action: "turbo:submit-end->form#reset turbo:submit-end->commands#focus" } do %> + data: { controller: "form", action: "turbo:submit-end->form#reset turbo:submit-end->commands#focus keydown.meta+k@document->commands#focus" } do %> <%= text_field_tag "command", has_error ? params[:command] : nil, @@ -16,6 +16,6 @@ action: "keydown.up->toggle-class#add:prevent keydown.down->toggle-class#remove:prevent", turbo_permanent: true }, - placeholder: "Search or type commands…" %> + placeholder: "Press ⌘+K to search or type commands…" %> <% end %>