From c057484dfbff973f70c485f9021c3bf25f08b954 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sun, 4 Oct 2026 20:06:53 -0400 Subject: [PATCH] Wire the inline boost link to the soft keyboard link_to passed `action: "soft-keyboard#open"` as a plain option, so it rendered as an `action` attribute, which Stimulus never reads. The link in messages/_actions.html.erb already passes it under `data:`; this one now does too, so tapping "Add a boost" on a touch device opens the keyboard for the boost form as the menu's link does. Co-Authored-By: Claude Opus 5.5 --- app/views/messages/boosts/_boosts.html.erb | 2 +- test/controllers/messages/boosts_controller_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/messages/boosts/_boosts.html.erb b/app/views/messages/boosts/_boosts.html.erb index 4d0d06f..d1a340a 100644 --- a/app/views/messages/boosts/_boosts.html.erb +++ b/app/views/messages/boosts/_boosts.html.erb @@ -7,7 +7,7 @@ <%= turbo_frame_tag message, :new_boost do %>
- <%= link_to new_message_boost_path(message), class: "boost__action txt-small btn", action: "soft-keyboard#open" do %> + <%= link_to new_message_boost_path(message), class: "boost__action txt-small btn", data: { action: "soft-keyboard#open" } do %> <%= image_tag "boost.svg", size: 20, aria: { hidden: "true" } %> Add a boost <% end %> diff --git a/test/controllers/messages/boosts_controller_test.rb b/test/controllers/messages/boosts_controller_test.rb index c04cd55..8cc7de9 100644 --- a/test/controllers/messages/boosts_controller_test.rb +++ b/test/controllers/messages/boosts_controller_test.rb @@ -6,6 +6,13 @@ class Messages::BoostsControllerTest < ActionDispatch::IntegrationTest @message = messages(:first) end + test "index wires the new boost link to the soft keyboard" do + get message_boosts_url(@message) + + assert_response :success + assert_select ".message__boost-inline a.boost__action[data-action='soft-keyboard#open']" + end + test "create" do assert_turbo_stream_broadcasts [ @message.room, :messages ], count: 1 do assert_difference -> { @message.boosts.count }, 1 do