Update system message to highlight verbs

This commit is contained in:
Andy Smith
2025-07-24 13:42:19 -05:00
parent 939d1b267c
commit 8e795f183d
4 changed files with 16 additions and 13 deletions
+3
View File
@@ -126,6 +126,9 @@
max-inline-size: var(--comment-max);
text-align: center;
strong {
font-weight: 600;
}
&::before {
/* Make up space for lack of avatar */
@@ -15,19 +15,19 @@ class Card::Eventable::SystemCommenter
def comment_body
case event.action
when "card_assigned"
"#{event.creator.name} assigned this to #{event.assignees.pluck(:name).to_sentence}."
"<strong>Assigned</strong> to #{event.assignees.pluck(:name).to_sentence} by #{event.creator.name}."
when "card_unassigned"
"#{event.creator.name} unassigned from #{event.assignees.pluck(:name).to_sentence}."
"<strong>Unassigned</strong> from #{event.assignees.pluck(:name).to_sentence} by #{event.creator.name}."
when "card_staged"
"#{event.creator.name} moved this to '#{event.stage_name}'."
"<strong>Moved to #{event.stage_name}</strong> by #{event.creator.name}."
when "card_closed"
"Closed as #{ card.closure.reason } by #{ event.creator.name }"
"<strong>Closed as #{ card.closure.reason }</strong> by #{ event.creator.name }"
when "card_reopened"
"Reopened by #{ event.creator.name }"
"<strong>Reopened</strong> by #{ event.creator.name }"
when "card_title_changed"
"#{event.creator.name} changed the title from '#{event.particulars.dig('particulars', 'old_title')}' to '#{event.particulars.dig('particulars', 'new_title')}'."
"<strong>Title changed</strong> from #{event.particulars.dig('particulars', 'old_title')} to #{event.particulars.dig('particulars', 'new_title')} by #{event.creator.name}."
when "card_collection_changed"
"#{event.creator.name} moved this from '#{event.particulars.dig('particulars', 'old_collection')}' to '#{event.particulars.dig('particulars', 'new_collection')}'."
"<strong>Moved</strong> from #{event.particulars.dig('particulars', 'old_collection')} to #{event.particulars.dig('particulars', 'new_collection')} by #{event.creator.name}."
end
end
end
+1 -1
View File
@@ -21,7 +21,7 @@
<%= link_to edit_card_comment_path(comment.card, comment),
class: "comment__edit btn btn--circle borderless translucent" do %>
<%= icon_tag "menu-dots-horizontal" %>
<%= icon_tag "menu-dots-horizontal" %>
<span class="for-screen-reader">Edit this comment</span>
<% end %>
@@ -7,7 +7,7 @@ class Card::Eventable::SystemCommenterTest < ActiveSupport::TestCase
end
test "card_assigned" do
assert_system_comment "David assigned this to Kevin." do
assert_system_comment "Assigned to Kevin by David." do
@card.toggle_assignment users(:kevin)
end
end
@@ -16,25 +16,25 @@ class Card::Eventable::SystemCommenterTest < ActiveSupport::TestCase
@card.toggle_assignment users(:kevin)
@card.comments.destroy_all # To skip deduplication logic
assert_system_comment "David unassigned from Kevin" do
assert_system_comment "Unassigned from Kevin by David" do
@card.toggle_assignment users(:kevin)
end
end
test "card_staged" do
assert_system_comment "David moved this to 'In progress'" do
assert_system_comment "Moved to In progress by David" do
@card.change_stage_to workflow_stages(:qa_in_progress)
end
end
test "card_closed" do
assert_system_comment "Closed as Done by David" do
assert_system_comment "Closed as Done by David" do
@card.close
end
end
test "card_title_changed" do
assert_system_comment "David changed the title from 'The text is too small' to 'Make text larger'." do
assert_system_comment "Title changed from The text is too small to Make text larger by David." do
@card.update! title: "Make text larger"
end
end