feat(project): 보드 카드에 마우스를 올리면 협업자 추가 아이콘(담당자 오른쪽)

- 누르면 협업자를 받아 멤버 메뉴, 고르면 바로 저장하고 카드에 표시(담당자는 후보에서 뺌)
- 테스트: 메뉴의 문서 Esc 처리기가 붙기 전에 Esc 를 보내던 타이밍 문제 수정(wait 후 Esc)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 14:48:49 +09:00
parent eab6b836d2
commit 9a8aea6435
13 changed files with 99 additions and 23 deletions
@@ -2,7 +2,7 @@
{% block head_extra %}
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
{% endblock %}
@@ -64,7 +64,7 @@
</section>
</div>
<script>window.NTC_PEOPLE = {{ people | tojson }};</script>
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
<script src="/static/erp-notice-admin.js?v=20261012b" defer></script>
{% endif %}
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -298,5 +298,5 @@
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -102,5 +102,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -470,5 +470,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013f" />
<link rel="stylesheet" href="/static/project.css?v=20261013g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261013f" defer></script>
<script src="/static/project.js?v=20261013g" defer></script>
{% endblock %}
+8
View File
@@ -491,6 +491,14 @@ html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important;
.pj-card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pj-card.has-cover .pj-card-head { border-radius: 0; }
.pj-card-meta .pj-card-assignee.is-empty svg, .pj-card-meta .pj-card-due.is-empty svg { width: 24px; height: 24px; }
/* 카드 협업자(담당자 오른쪽) — 비어 있으면 카드에 마우스를 올릴 때만 점선 원 두 사람 아이콘 */
.pj-card-meta .pj-card-fol { display: inline-flex; align-items: center; gap: 1px; min-height: 24px; color: #6d6e6f; }
.pj-card-meta .pj-card-fol.is-empty { justify-content: center; width: 26px; height: 26px; padding: 0; margin: -2px 0; border-radius: 50%; }
.pj-card-meta .pj-card-fol > svg { width: 24px; height: 24px; }
.pj-card-meta .pj-card-fol img.pj-person-ic { width: 20px; height: 20px; border-radius: 50%; }
.pj-card-meta .pj-card-fol .pj-gicon { font-size: 22px; }
.pj-card:hover .pj-card-meta .pj-card-fol.is-empty { opacity: 1; }
.pj-card-meta .pj-card-fol.is-empty:hover { color: #1e1f21; background: #eceef0; }
.pj-pri { padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.pj-pri-high { background: #fbe3df; color: #c22b10; }
.pj-pri-low { background: #e6eef0; color: #4a6066; }
+46
View File
@@ -5295,6 +5295,43 @@
} catch (e) { showToast(failMsg + ": " + e.message, "error"); }
}
// 보드 카드 협업자 — taskId → 협업자 목록(받았거나 고친 것만). 업무 창을 닫으면 비운다(창에서 바꿨을 수 있다).
const cardFollowers = {};
function cardFolHtml(list) {
const has = !!(list && list.length);
return '<span class="pj-card-edit-hit pj-card-fol' + (has ? "" : " is-empty") + '" title="' +
escapeHtml(followerTip(list || [])) + '">' + followerIconHtml(list || []) + "</span>";
}
function paintCardFol(anchor, list) {
if (!anchor.isConnected) return;
anchor.classList.toggle("is-empty", !(list && list.length));
anchor.innerHTML = followerIconHtml(list || []);
anchor.title = followerTip(list || []);
}
async function openCardFollowers(t, anchor) {
let emails;
try {
const got = await Promise.all([
membersOfProject(t.project_id),
api("GET", "/project/api/tasks/" + t.id + "/followers"),
]);
emails = got[0].map(function (m) { return m.user_email; });
cardFollowers[t.id] = got[1].followers || [];
} catch (e) {
showToast(e.status === 503 ? "협업자 기능은 DB 마이그레이션 008 후 사용할 수 있습니다." : "협업자 조회 실패: " + e.message, "error");
return;
}
paintCardFol(anchor, cardFollowers[t.id]);
if (!anchor.isConnected) return;
openFollowerMenu(anchor, emails, function () { return cardFollowers[t.id]; }, async function (em, on) {
try {
cardFollowers[t.id] = await setTaskFollower(t.id, em, on);
paintCardFol(anchor, cardFollowers[t.id]);
return true;
} catch (err) { showToast("협업자 변경 실패: " + err.message, "error"); return false; }
}, function () { return t.assignee_email; });
}
async function openAssigneePicker(t, x, y) {
let list;
try { list = await membersOfProject(t.project_id); }
@@ -5302,6 +5339,9 @@
showContextMenu(x, y, assigneeMenuItems(
list.map(function (m) { return m.user_email; }), t.assignee_email,
function (email) {
if (email && cardFollowers[t.id]) { // 담당자는 협업자가 아니다(서버도 뺀다)
cardFollowers[t.id] = cardFollowers[t.id].filter(function (x) { return String(x).toLowerCase() !== String(email).toLowerCase(); });
}
applyTaskPatch(t, { assignee_email: email, assignee_name: email ? idOf(email) : "" }, "담당자 변경 실패");
}
));
@@ -5862,6 +5902,9 @@
avatarHtml(t.assignee_email, "pj-gicon-sm") + escapeHtml(idOf(t.assignee_email)) + "</span>"
: '<span class="pj-assignee pj-card-edit-hit pj-card-assignee is-empty" title="담당자 지정">' +
ASSIGN_EMPTY_ICON_SVG + "</span>") +
// 협업자(2026-10-13) — 담당자 오른쪽. 카드 목록엔 협업자가 없어 비어 있으면 마우스를 올릴 때만 보이고,
// 누르면 서버에서 받아 멤버 메뉴. 한 번 받은(고른) 협업자는 이 화면에 머무는 동안 카드에 보인다(cardFollowers).
(canManage ? cardFolHtml(cardFollowers[t.id]) : "") +
(function () {
const di = dueInfo(t.due_date, !!t.completed_at);
return '<span class="pj-card-due pj-card-edit-hit' + (di ? " " + di.cls : " is-empty") +
@@ -5942,6 +5985,8 @@
if (hitAssignee) { e.stopPropagation(); openAssigneePicker(t, e.clientX, e.clientY); return; }
const hitDue = e.target.closest(".pj-card-due");
if (hitDue) { e.stopPropagation(); openDuePicker(t, hitDue); return; }
const hitFol = e.target.closest(".pj-card-fol");
if (hitFol) { e.stopPropagation(); openCardFollowers(t, hitFol); return; }
openTaskModal(t);
});
// 댓글 말풍선 한 번 클릭 → 채팅형 댓글 팝업(공용 구현, 안 읽음 표시만 여기서 연결).
@@ -7776,6 +7821,7 @@
return;
}
Object.keys(subsCache).forEach(function (k) { delete subsCache[k]; });
Object.keys(cardFollowers).forEach(function (k) { delete cardFollowers[k]; }); // 창에서 협업자를 바꿨을 수 있다
// 펼친 카드의 세부 작업을 먼저 다 받아 온 뒤 한 번에 다시 그린다 — "불러오는 중"으로
// 짧아진 채 그리면 섹션 스크롤을 되돌릴 자리가 모자라 위로 밀려 올라간다.
if (expandedSubs.size && currentView === "board") {