From 1c85b315385953c7e546c74de9a0a8db2d80bf37 Mon Sep 17 00:00:00 2001 From: Hunter Smith <1946720+hunternet93@users.noreply.github.com> Date: Tue, 30 Dec 2025 13:38:03 -0800 Subject: [PATCH 1/5] AO3-7246 Add Parent link to reply comments --- app/views/comments/_comment_actions.html.erb | 7 ++++--- features/comments_and_kudos/add_comment.feature | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/views/comments/_comment_actions.html.erb b/app/views/comments/_comment_actions.html.erb index 766bbe9e29c..f755149f73f 100644 --- a/app/views/comments/_comment_actions.html.erb +++ b/app/views/comments/_comment_actions.html.erb @@ -11,12 +11,13 @@ <% if can_reply_to_comment?(comment) %> <% end %> - <% unless comment.unreviewed? %> -
  • <%= link_to ts("Thread"), comment %>
  • - <% end %> <% if comment.depth > 0 %> +
  • <%= link_to ts("Parent"), comment_path(id: comment.commentable) %>
  • <%= link_to ts("Parent Thread"), comment_path(id: comment.thread) %>
  • <% end %> + <% unless comment.unreviewed? %> +
  • <%= link_to ts("Thread"), comment %>
  • + <% end %> <% if can_freeze_comment?(comment) %>
  • <%= freeze_comment_button(comment) %>
  • <% end %> diff --git a/features/comments_and_kudos/add_comment.feature b/features/comments_and_kudos/add_comment.feature index 383f5771de6..5326d274872 100644 --- a/features/comments_and_kudos/add_comment.feature +++ b/features/comments_and_kudos/add_comment.feature @@ -186,6 +186,20 @@ Scenario: Comment threading, comment editing Then I should see "must be less than" And I should see "Now, we can devour the gods, together!" +Scenario: I can see "Parent" and "Parent Thread" links on reply comments but not on top-level comments + + Given the work "Random Work" + When I am logged in as "commenter" + And I post the comment "This is the top-level comment" on the work "Random Work" + Then I should not see "Parent" + And I should not see "Parent Thread" + + When I reply to a comment with "This is the reply comment" + Then I should not see "Parent" within ".odd" + And I should not see "Parent Thread" within ".odd" + And I should see "Parent" within ".even" + And I should see "Parent Thread" within ".even" + Scenario: Don't receive comment notifications of your own comments by default When I am logged in as "author" From a91fd1688932e1a4dff5b32acd858a364c7f4552 Mon Sep 17 00:00:00 2001 From: Hunter Smith <1946720+hunternet93@users.noreply.github.com> Date: Tue, 30 Dec 2025 15:57:52 -0800 Subject: [PATCH 2/5] Skipped extraneous query by using ID field directly --- app/views/comments/_comment_actions.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/comments/_comment_actions.html.erb b/app/views/comments/_comment_actions.html.erb index f755149f73f..b58a986bf5a 100644 --- a/app/views/comments/_comment_actions.html.erb +++ b/app/views/comments/_comment_actions.html.erb @@ -12,7 +12,7 @@ <% end %> <% if comment.depth > 0 %> -
  • <%= link_to ts("Parent"), comment_path(id: comment.commentable) %>
  • +
  • <%= link_to ts("Parent"), comment_path(id: comment.commentable_id) %>
  • <%= link_to ts("Parent Thread"), comment_path(id: comment.thread) %>
  • <% end %> <% unless comment.unreviewed? %> From 1740d78978e711348c29d576da988a04d4f0c751 Mon Sep 17 00:00:00 2001 From: Hunter Smith <1946720+hunternet93@users.noreply.github.com> Date: Wed, 31 Dec 2025 10:44:46 -0800 Subject: [PATCH 3/5] Refactored comment_actions template to use correct translation method and pass erblint --- app/views/comments/_comment_actions.html.erb | 20 ++++++++++---------- config/locales/views/en.yml | 8 ++++++++ 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/views/comments/_comment_actions.html.erb b/app/views/comments/_comment_actions.html.erb index b58a986bf5a..c4f477c2f05 100644 --- a/app/views/comments/_comment_actions.html.erb +++ b/app/views/comments/_comment_actions.html.erb @@ -1,4 +1,4 @@ -
    <%= ts("Comment Actions") %>
    +
    <%= t(".comment_actions") %>