feat(project): 내 업무 개수 배지 - 마우스 따라다니는 툴팁으로 진행/완료 표시

네이티브 title 대신 커서를 따라 움직이는 작은 말풍선(공용 [data-tip]
유틸, initHoverTips). 헤드리스 크롬에서 synthetic mouse event로 동작
검증(진행/완료 텍스트 + 좌표 갱신 확인).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 15:36:45 +09:00
parent a82d54574f
commit 8cc466dd17
5 changed files with 46 additions and 12 deletions
+26
View File
@@ -4427,6 +4427,31 @@
.forEach(attachScrollIndicator);
}
// ── 마우스를 따라다니는 작은 툴팁 — [data-tip] 달린 요소 아무데나 공용.
// 지금은 "내 업무" 개수 배지(진행/완료)에 쓴다. 배지는 서버가 한 번
// 렌더한 뒤 텍스트만 바뀌고 재생성되지 않으므로(updateMyTreeCounts),
// 페이지 로드 시 한 번만 wiring 하면 된다(동적으로 새로 생기는 요소 없음).
function initHoverTips() {
let tipEl = null;
function show(text, x, y) {
if (!tipEl) {
tipEl = document.createElement("div");
tipEl.className = "pj-hovertip";
document.body.appendChild(tipEl);
}
tipEl.textContent = text;
tipEl.style.left = (x + 14) + "px";
tipEl.style.top = (y + 18) + "px";
tipEl.hidden = false;
}
function hide() { if (tipEl) tipEl.hidden = true; }
document.querySelectorAll("[data-tip]").forEach(function (el) {
el.addEventListener("mouseenter", function (e) { show(el.dataset.tip, e.clientX, e.clientY); });
el.addEventListener("mousemove", function (e) { show(el.dataset.tip, e.clientX, e.clientY); });
el.addEventListener("mouseleave", hide);
});
}
document.addEventListener("DOMContentLoaded", function () {
initHome();
initProject();
@@ -4435,5 +4460,6 @@
initLiveRefresh();
wireMyTreeToggles();
initScrollIndicators();
initHoverTips();
});
})();