From 8e795f183d4e63ad3fe8a19c543233cfdfe805b0 Mon Sep 17 00:00:00 2001 From: Andy Smith Date: Thu, 24 Jul 2025 13:42:19 -0500 Subject: [PATCH] Update system message to highlight verbs --- app/assets/stylesheets/comments.css | 3 +++ app/models/card/eventable/system_commenter.rb | 14 +++++++------- app/views/cards/comments/_comment.html.erb | 2 +- .../models/card/eventable/system_commenter_test.rb | 10 +++++----- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/comments.css b/app/assets/stylesheets/comments.css index 5ac852793..e2e838fc7 100644 --- a/app/assets/stylesheets/comments.css +++ b/app/assets/stylesheets/comments.css @@ -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 */ diff --git a/app/models/card/eventable/system_commenter.rb b/app/models/card/eventable/system_commenter.rb index f07c702c0..b4e0ed417 100644 --- a/app/models/card/eventable/system_commenter.rb +++ b/app/models/card/eventable/system_commenter.rb @@ -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}." + "Assigned 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}." + "Unassigned from #{event.assignees.pluck(:name).to_sentence} by #{event.creator.name}." when "card_staged" - "#{event.creator.name} moved this to '#{event.stage_name}'." + "Moved to ‘#{event.stage_name}’ by #{event.creator.name}." when "card_closed" - "Closed as “#{ card.closure.reason }” by #{ event.creator.name }" + "Closed as ‘#{ card.closure.reason }’ by #{ event.creator.name }" when "card_reopened" - "Reopened by #{ event.creator.name }" + "Reopened 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')}'." + "Title changed 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')}'." + "Moved from ‘#{event.particulars.dig('particulars', 'old_collection')}’ to ‘#{event.particulars.dig('particulars', 'new_collection')}’ by #{event.creator.name}." end end end diff --git a/app/views/cards/comments/_comment.html.erb b/app/views/cards/comments/_comment.html.erb index 3bb9a177a..1f7f748de 100644 --- a/app/views/cards/comments/_comment.html.erb +++ b/app/views/cards/comments/_comment.html.erb @@ -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" %> Edit this comment <% end %> diff --git a/test/models/card/eventable/system_commenter_test.rb b/test/models/card/eventable/system_commenter_test.rb index 67678d32e..343ed2716 100644 --- a/test/models/card/eventable/system_commenter_test.rb +++ b/test/models/card/eventable/system_commenter_test.rb @@ -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