members screen: Create, not Save, where the save makes the group
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186Ru2zvdWEwdwGhQ5V9z5X
diff --git a/lib/pro_tacts/admin/groups_members.rb b/lib/pro_tacts/admin/groups_members.rb
index b17eaaf..5f62934 100644
--- a/lib/pro_tacts/admin/groups_members.rb
+++ b/lib/pro_tacts/admin/groups_members.rb
@@ -68,7 +68,9 @@ module ProTacts
render Layout.new(title:, login: @login) do
form(action: group ? "/groups/#{group.id}/members" : "/groups", method: "post",
class: "member-picker", id: FORM, x_data: GroupFilter::STATE) do
- render RecordCard.new(back:, submit: "Save", form: FORM) do
+ # Create where the save makes the group, the verb the two
+ # create dialogs end on (GroupsIndex, ContactDialog).
+ render RecordCard.new(back:, submit: group ? "Save" : "Create", form: FORM) do
render GroupFilter.new(autofocus: true, in_form: true, placeholder: "Filter contacts")
end
div(class: "member-list") do
diff --git a/test/pro_tacts/admin/test_contacts_pages.rb b/test/pro_tacts/admin/test_contacts_pages.rb
index 1e2cb35..fa5ad3c 100644
--- a/test/pro_tacts/admin/test_contacts_pages.rb
+++ b/test/pro_tacts/admin/test_contacts_pages.rb
@@ -914,7 +914,7 @@ class AdminContactsPagesTest < Minitest::Test
end
# "new" makes nothing: it is the members screen with the contact
- # ticked, its Save the create and its Cancel the card again.
+ # ticked, its Create the create and its Cancel the card again.
def test_new_opens_the_members_screen_of_a_group_not_yet_made
with_contacts({"ada" => ADA}) do |store|
get "/contacts/ada/groups/new"
@@ -924,6 +924,7 @@ class AdminContactsPagesTest < Minitest::Test
assert_includes last_response.body, %(<form action="/groups" method="post")
assert_includes last_response.body, %(<input type="checkbox" name="members[]" value="ada" checked>)
assert_includes last_response.body, %(<a href="/contacts/ada" class="btn">Cancel</a>)
+ assert_includes last_response.body, %(data-variant="primary">Create</button>)
refute_includes last_response.body, %(name="was[]")
end
end