feat(project): 댓글 말풍선을 한 번 클릭하면 댓글 대화창(더블클릭 → 클릭)

- 문서 캡처 단계 클릭 처리로 .pj-cmt-badge[data-task-id] 를 받아 카드·행·
  캘린더 막대의 클릭(작업 열기)보다 먼저 대화창을 연다
- 캘린더 막대·목록 행의 말풍선도 눌리는 배지로(data-task-id)
- 정적 파일 버전 20260925i

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 20:02:30 +09:00
parent d9fba4ad1f
commit b324a9c413
7 changed files with 40 additions and 18 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -99,5 +99,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925h" defer></script>
<script src="/static/project.js?v=20260925i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -68,7 +68,7 @@
{% include "project/_side_modals.html" %}
<!-- 댓글만 보는 채팅형 팝업 — 업무 행의 말풍선 아이콘 더블클릭 -->
<!-- 댓글만 보는 채팅형 팝업 — 작업 행의 말풍선 아이콘 한 번 클릭 -->
<div class="pj-modal" id="pj-modal-comments" hidden>
<div class="pj-modal-card pj-modal-chat">
<div class="pj-chat-head">
@@ -98,5 +98,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20260925h" defer></script>
<script src="/static/project.js?v=20260925i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -465,5 +465,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260925h" defer></script>
<script src="/static/project.js?v=20260925i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925h" />
<link rel="stylesheet" href="/static/project.css?v=20260925i" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -68,5 +68,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925h" defer></script>
<script src="/static/project.js?v=20260925i" defer></script>
{% endblock %}
+2
View File
@@ -654,6 +654,8 @@
.pj-cmt-n { font-size: 11px; font-weight: 700; vertical-align: middle; margin-left: 1px; }
.pj-card-cmt { display: inline-flex; align-items: center; color: #6b7280; }
.pj-cmt-badge { display: inline-flex; align-items: center; flex: 0 0 auto; color: #6b7280; cursor: pointer; }
/* 캘린더 막대·목록 행 안의 말풍선 — 색은 그 자리 글자색을 따른다(막대=흰색) */
.pj-cmt-badge.pj-cmt-inline { color: inherit; }
/* 새 댓글이 등록된 뒤 아직 확인 안 한 업무 — 살짝 커지며 반짝임. 확인하면(더블클릭) 원래대로. */
@keyframes pj-cmt-pulse {
0%, 100% { transform: scale(1); opacity: 1; }
+24 -9
View File
@@ -827,7 +827,7 @@
// 화면 우측 "내 업무" 패널 전부 공용(마크업 id 는 두 페이지가 같은 걸 씀).
// 페이지당 한 번 initCommentsChat() 으로 활성화하고, 이후 동적으로 새로
// 만들어지는 말풍선 배지는 반환된 wireBadge() 로 개별 등록한다(안 하면
// patch 로 새로 그려진 배지는 더블클릭이 죽는다 — 실제 있었던 버그).
// patch 로 새로 그려진 배지는 안 읽음 표시가 빠진다). 여는 건 한 번 클릭(문서 캡처).
// getTaskTitle(taskId) — 채팅창 제목에 쓸 업무 제목을 페이지별 데이터에서
// 찾아 돌려주는 콜백(각 화면이 이미 들고 있는 업무 목록에서 찾는다).
// ── 새 프로젝트 모달 (#pj-modal-project) — 좌측 사이드바 "+" 버튼 ──
@@ -1350,13 +1350,21 @@
const n = parseInt(b.dataset.count, 10) || 0;
const seenN = loadSeenComments()[b.dataset.taskId] || 0;
if (n > seenN) b.classList.add("is-unread");
b.addEventListener("click", function (e) { e.preventDefault(); e.stopPropagation(); });
b.addEventListener("dblclick", function (e) {
e.preventDefault(); e.stopPropagation();
open(b.dataset.taskId);
});
}
document.querySelectorAll(".pj-cmt-badge").forEach(wireBadge);
// 말풍선은 한 번 클릭으로 댓글 대화창(예전엔 더블클릭). 문서 전체에서 캡처
// 단계로 받아 카드·행·캘린더 막대의 클릭(작업 열기)보다 먼저 처리하고 막는다
// — 나중에 다시 그려진 말풍선도 따로 연결할 필요가 없다.
document.addEventListener("click", function (e) {
const b = e.target.closest && e.target.closest(".pj-cmt-badge[data-task-id]");
if (!b) return;
e.preventDefault(); e.stopPropagation();
open(b.dataset.taskId);
}, true);
// 빠르게 두 번 눌러도 밑의 카드/막대 더블클릭(작업 열기)이 같이 돌지 않게.
document.addEventListener("dblclick", function (e) {
if (e.target.closest && e.target.closest(".pj-cmt-badge[data-task-id]")) { e.preventDefault(); e.stopPropagation(); }
}, true);
el("pj-cm-send").addEventListener("click", async function () {
const taskId = el("pj-cm-task-id").value;
@@ -2026,12 +2034,19 @@
}
const DELETE_DENIED = "삭제는 만든 사람만 할 수 있습니다.";
// 댓글 있으면 말풍선 아이콘(+개수). 색은 currentColor 상속(막대=흰, 카드/리스트=진회색).
function cmtBadge(t, cls) {
function cmtBadgeInner(t, cls) {
const n = t.comment_count || 0;
if (!n) return "";
return '<span class="pj-cmt-ic ' + (cls || "") +
'" title="댓글 ' + n + '개">💬</span><span class="pj-cmt-n">' + n + "</span>";
}
// 누르면 댓글 대화창(initCommentsChat 의 문서 클릭 처리) — 캘린더 막대·목록 행용.
function cmtBadge(t, cls) {
const inner = cmtBadgeInner(t, cls);
if (!inner) return "";
return '<span class="pj-cmt-badge pj-cmt-inline" data-task-id="' + t.id + '" data-count="' +
(t.comment_count || 0) + '">' + inner + "</span>";
}
const dataEl = el("pj-data");
const data = JSON.parse(dataEl.textContent);
@@ -3528,7 +3543,7 @@
: "") +
(t.comment_count
? '<span class="pj-card-cmt pj-cmt-badge" data-task-id="' + t.id + '" data-count="' + t.comment_count +
'" title="댓글 ' + t.comment_count + '개">' + cmtBadge(t) + "</span>"
'" title="댓글 ' + t.comment_count + '개">' + cmtBadgeInner(t) + "</span>"
: "") +
"</div>" +
// 펼침 영역 — 바깥(.pj-card-subs-wrap)이 grid 0fr↔1fr 로 높이를
@@ -3558,7 +3573,7 @@
if (hitDue) { e.stopPropagation(); openDuePicker(t, hitDue); return; }
openTaskModal(t);
});
// 댓글 말풍선 더블클릭 → 채팅형 댓글 팝업(내 업무 패널과 동일 구현 공용).
// 댓글 말풍선 한 번 클릭 → 채팅형 댓글 팝업(공용 구현, 안 읽음 표시만 여기서 연결).
if (cmt) cmt.wireBadge(card.querySelector(".pj-cmt-badge"));
if (canManage) {
card.addEventListener("dragstart", function (e) {
+5
View File
@@ -114,6 +114,11 @@
> 된다(`title` 은 마우스를 올리는 순간 `data-tip` 으로 옮겨져 브라우저 기본 말풍선이 안 뜬다).
> 별도 툴팁 구현 금지 — 부득이하면(대시보드 막대처럼 요소에 붙는 것) 같은 색·꼬리 모양으로.
>
> **댓글 말풍선(💬 N) 규칙** — 보드 카드·목록 행·캘린더 막대·내 작업 어디서든 **한 번 클릭**으로 댓글
> 대화창(`#pj-modal-comments`, `initCommentsChat`)이 열린다. `.pj-cmt-badge[data-task-id]` 만 달면
> 문서 캡처 단계 클릭 처리가 카드/행 클릭(작업 열기)보다 먼저 받아 막으므로 따로 연결할 필요 없다
> (`wireBadge` 는 안 읽음 표시만).
>
> **담당자 고르기 규칙 — 모든 화면·앞으로 추가하는 기능 공통.** 담당자를 고르는 곳은 항상 "아이콘 + 이름".
> 팝업 메뉴는 `assigneeMenuItems(emails, cur, onPick)` + `showContextMenu`(항목 `icon`/`checked` 지원), 폼의
> `<select>` 는 `enhanceAssigneeSelect(sel)` 로 감싼다(select 는 숨겨 값 저장소로 유지). 미지정 = 점선 원 사람 아이콘.