fix(project): 아이콘버튼 호버 중앙정렬·댓글팝업 본인댓글 삭제 지원

- .pj-icon-btn 기본 스타일에 flex 중앙정렬 추가(닫기 버튼 등 호버 음영이
  아이콘 기준 중앙에 오지 않던 문제, 버튼 UA 기본 패딩이 원인)
- 댓글 팝업(카톡형)에서 본인이 작성한 댓글에만 삭제 버튼 노출
  (서버는 이미 본인/관리자만 삭제 허용하도록 검증 중)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:28:02 +09:00
parent b3c98995c9
commit fee2765905
5 changed files with 27 additions and 8 deletions
+14 -1
View File
@@ -453,8 +453,21 @@
li.innerHTML =
(mine ? "" : '<span class="pj-chat-name">' + escapeHtml(idOf(c.author_email)) + "</span>") +
'<div class="pj-chat-bubble"></div>' +
'<span class="pj-chat-time">' + (c.created_at || "").slice(0, 16).replace("T", " ") + "</span>";
'<span class="pj-chat-meta">' +
(mine ? '<button type="button" class="pj-icon-btn pj-chat-del" title="삭제"><span class="material-symbols-outlined">close</span></button>' : "") +
'<span class="pj-chat-time">' + (c.created_at || "").slice(0, 16).replace("T", " ") + "</span>" +
"</span>";
li.querySelector(".pj-chat-bubble").textContent = c.body;
if (mine) {
li.querySelector(".pj-chat-del").addEventListener("click", async function () {
if (!confirm("이 댓글을 삭제할까요?")) return;
try {
await api("DELETE", "/project/api/comments/" + c.id);
const n = await renderChat(taskId);
if (n !== null) { markSeen(taskId, n); syncBadge(taskId, n); }
} catch (e) { alert("삭제 실패: " + e.message); }
});
}
list.appendChild(li);
});
list.scrollTop = list.scrollHeight;