fix(project): 댓글칸 멤버 태그 목록을 @ 아이콘 윗부분에 띄움

@ 버튼이 있는 입력칸은 멤버 목록을 그 버튼 위쪽(오른쪽 끝 맞춤)에 띄우고,
위 공간이 없을 때만 아래로. 설명란 태그 목록은 기존대로 커서 아래.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-28 21:19:43 +09:00
parent 60265f0cf6
commit 8119859189
6 changed files with 24 additions and 16 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260928i" /> <link rel="stylesheet" href="/static/project.css?v=20260928j" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" /> <link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260928i" /> <link rel="stylesheet" href="/static/project.css?v=20260928j" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %} {% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %} {% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260928i" defer></script> <script src="/static/project.js?v=20260928j" defer></script>
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260928i" /> <link rel="stylesheet" href="/static/project.css?v=20260928j" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }} "today": {{ today | tojson }}
} }
</script> </script>
<script src="/static/project.js?v=20260928i" defer></script> <script src="/static/project.js?v=20260928j" defer></script>
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260928i" /> <link rel="stylesheet" href="/static/project.css?v=20260928j" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host --> <!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host --> <!-- 타임라인 vis-timeline — self-host -->
@@ -491,5 +491,5 @@
</script> </script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script> <script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260928i" defer></script> <script src="/static/project.js?v=20260928j" defer></script>
{% endblock %} {% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %} {% extends "erp_base.html" %}
{% block head_extra %} {% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260928i" /> <link rel="stylesheet" href="/static/project.css?v=20260928j" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" /> <link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %} {% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %} {% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %} {% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260928i" defer></script> <script src="/static/project.js?v=20260928j" defer></script>
{% endblock %} {% endblock %}
+15 -7
View File
@@ -1613,7 +1613,8 @@
window.addEventListener("resize", closeMentionMenu); window.addEventListener("resize", closeMentionMenu);
return mentionMenuEl; return mentionMenuEl;
} }
function renderMentionMenu(users, rect, onPick) { // opts.above — 기준(rect) 위쪽에 우선 띄우고 오른쪽 끝을 기준에 맞춘다(댓글칸 @ 버튼).
function renderMentionMenu(users, rect, onPick, opts) {
const menu = ensureMentionMenu(); const menu = ensureMentionMenu();
menu.innerHTML = ""; menu.innerHTML = "";
if (!users.length) { if (!users.length) {
@@ -1633,12 +1634,16 @@
}); });
} }
menu.hidden = false; menu.hidden = false;
// 커서/입력칸 바로 아래. 화면 밖으로 나가면 위쪽으로 뒤집는다. // 기본: 커서/입력칸 바로 아래, 화면 밖으로 나가면 위쪽으로 뒤집는다.
// opts.above: 기준 위쪽(아이콘 윗부분), 위 공간이 없으면 아래로.
const above = !!(opts && opts.above);
let top = window.scrollY + rect.bottom + 4; let top = window.scrollY + rect.bottom + 4;
let left = window.scrollX + rect.left; let left = window.scrollX + (above ? rect.right - menu.offsetWidth : rect.left);
left = Math.min(left, window.scrollX + document.documentElement.clientWidth - menu.offsetWidth - 8); left = Math.min(left, window.scrollX + document.documentElement.clientWidth - menu.offsetWidth - 8);
if (rect.bottom + menu.offsetHeight + 8 > document.documentElement.clientHeight) { if (above
top = window.scrollY + rect.top - menu.offsetHeight - 4; ? rect.top - menu.offsetHeight - 6 >= 8
: rect.bottom + menu.offsetHeight + 8 > document.documentElement.clientHeight) {
top = window.scrollY + rect.top - menu.offsetHeight - (above ? 6 : 4);
} }
menu.style.left = Math.max(8, left) + "px"; menu.style.left = Math.max(8, left) + "px";
menu.style.top = Math.max(8, top) + "px"; menu.style.top = Math.max(8, top) + "px";
@@ -1705,7 +1710,10 @@
const ctx = caretQuery(); const ctx = caretQuery();
if (!ctx) { closeMentionMenu(); return; } if (!ctx) { closeMentionMenu(); return; }
const users = filterMentionUsers(await mentionUsers(), ctx.query); const users = filterMentionUsers(await mentionUsers(), ctx.query);
renderMentionMenu(users, input.getBoundingClientRect(), function (u) { // 옆에 @ 버튼이 있는 댓글칸이면 멤버 목록은 그 아이콘 윗부분에 띄운다.
const atBtn = input.parentNode && input.parentNode.querySelector(".pj-mention-btn");
const anchorRect = atBtn ? atBtn.getBoundingClientRect() : input.getBoundingClientRect();
renderMentionMenu(users, anchorRect, function (u) {
const token = "@" + capName(u.id || u.email.split("@")[0]); const token = "@" + capName(u.id || u.email.split("@")[0]);
input.value = input.value.slice(0, ctx.start) + token + " " + input.value.slice(ctx.end); input.value = input.value.slice(0, ctx.start) + token + " " + input.value.slice(ctx.end);
input._pjMentions[token] = u.email; input._pjMentions[token] = u.email;
@@ -1713,7 +1721,7 @@
input.focus(); input.focus();
input.setSelectionRange(caret, caret); input.setSelectionRange(caret, caret);
closeMentionMenu(); closeMentionMenu();
}); }, { above: !!atBtn });
} }
input.addEventListener("input", maybeOpen); input.addEventListener("input", maybeOpen);
input.addEventListener("blur", function () { setTimeout(closeMentionMenu, 120); }); input.addEventListener("blur", function () { setTimeout(closeMentionMenu, 120); });