Merge pull request #1788 from basecamp/comments-refresh-edit

Fix: edit comment button disappears when morphing the page
This commit is contained in:
Jorge Manrubia
2025-12-02 09:06:34 +01:00
committed by GitHub
4 changed files with 3 additions and 33 deletions
-14
View File
@@ -45,10 +45,6 @@
.comment__avatar {
margin: calc(var(--comment-padding-block) * 0.75) calc(var(--comment-padding-inline) * -0.75);
z-index: 0;
.comment--mine_ & {
margin-inline: calc(var(--comment-padding-inline) * -0.75);
}
}
.comment__body {
@@ -82,16 +78,6 @@
.comment__edit {
background-color: var(--color-ink-lightest);
.comment:not(.comment--mine) & {
display: none;
}
}
.comment--mine {
.comment__reaction {
display: none;
}
}
.comment--system {
+1 -5
View File
@@ -3,10 +3,6 @@ module MessagesHelper
turbo_frame_tag dom_id(card, :messages),
class: "comments gap center",
style: "--card-color: #{card.color}",
role: "group", aria: { label: "Messages" },
data: {
controller: "created-by-current-user",
created_by_current_user_mine_class: "comment--mine"
}, &
role: "group", aria: { label: "Messages" }, &
end
end
@@ -1,12 +0,0 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [ "creation" ]
static classes = [ "mine" ]
creationTargetConnected(element) {
if (element.dataset.creatorId == Current.user.id) {
element.classList.add(this.mineClass)
}
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
<% cache comment do %>
<%= turbo_frame_tag comment, :container do %>
<%# Bump for CSS changes: 2025-06-30 -%>
<div id="<%= dom_id(comment) %>" class="comment flex align-start full-width <%= "comment--system" if comment.creator.system? %>" data-creator-id="<%= comment.creator_id %>" data-created-by-current-user-target="creation">
<div id="<%= dom_id(comment) %>" data-creator-id="<%= comment.creator_id %>" class="comment flex align-start full-width <%= "comment--system" if comment.creator.system? %>">
<figure class="comment__avatar flex-item-no-shrink" aria-hidden="true">
<%= avatar_tag comment.creator, hidden_for_screen_reader: true %>
</figure>
@@ -20,7 +20,7 @@
</h3>
<%= link_to edit_card_comment_path(comment.card, comment),
class: "comment__edit btn btn--circle borderless translucent" do %>
class: "comment__edit btn btn--circle borderless translucent", data: { only_visible_to_you: true } do %>
<%= icon_tag "menu-dots-horizontal" %>
<span class="for-screen-reader">Edit this comment</span>
<% end %>