fix(project): 목표 표 영역·줄 도구 막대를 마우스 커서 오른쪽에

- 이름 칸 아래 가운데(왼쪽 고정 열이라 잘림) 대신 커서 오른쪽에 — 들어온 자리 기준 가로 고정, 세로는 커서를 따라감
  (가로까지 따라가면 막대를 누르러 갈 때 도망감), 커서가 막대 위면 그대로, 화면 배율 보정
- 캐시 버전 20261001n, 문서 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 14:10:01 +09:00
parent 75b82024de
commit 58dbb7ef3e
10 changed files with 41 additions and 13 deletions
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -246,5 +246,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001m" defer></script>
<script src="/static/project.js?v=20261001n" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -210,5 +210,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001m" defer></script>
<script src="/static/project.js?v=20261001n" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<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=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261001m" defer></script>
<script src="/static/project.js?v=20261001n" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<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=20261001m" defer></script>
<script src="/static/project.js?v=20261001n" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -496,5 +496,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261001m" defer></script>
<script src="/static/project.js?v=20261001n" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261001m" />
<link rel="stylesheet" href="/static/project.css?v=20261001n" />
<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=20261001m" defer></script>
<script src="/static/project.js?v=20261001n" defer></script>
{% endblock %}
+2
View File
@@ -2091,6 +2091,8 @@ input.pj-goal-num:focus { outline: 2px solid var(--pj-accent); outline-offset: -
border-radius: 10px; box-shadow: 0 4px 12px rgba(16, 24, 40, .14); /* 파스텔 주황 */
opacity: 0; pointer-events: none; transition: opacity .12s;
}
/* 커서 오른쪽에(initGoals placeTools 가 left/top 을 넣는다) — 가운데 맞춤 해제, 칸 밖으로 나가도 보이게 */
.pj-goal-tools.is-at-cursor { transform: none; white-space: nowrap; }
.pj-goal-area-name:hover .pj-goal-tools, .pj-goal-row-label:hover .pj-goal-tools,
.pj-goal-tools:focus-within { opacity: 1; pointer-events: auto; }
.pj-goal-tools .pj-icon-btn { width: 30px; height: 30px; font-size: 20px; color: #8a4b14; border-radius: 7px; }
+24
View File
@@ -8547,6 +8547,30 @@
});
}
// ── 영역·줄 도구 막대(↑ ↓ + ×) — 마우스 커서 오른쪽에. 칸에 들어온 자리의 오른쪽(가로 고정)에 나타나 커서를 위아래로만
// 따라간다(가로까지 따라가면 막대를 누르러 오른쪽으로 갈 때 막대가 계속 도망간다). 커서가 막대 위에 있으면 그대로.
// 막대는 이름 칸 안에 있어 칸 → 막대로 옮겨도 사라지지 않는다. 화면 배율(uiZoom) 안이라 거리는 배율로 나눈다.
const TOOL_HOSTS = "th.pj-goal-area-name, th.pj-goal-row-label";
let toolEntryX = 0;
function placeTools(th, e) {
const tools = th.querySelector(".pj-goal-tools");
if (!tools || (e.target && e.target.closest && e.target.closest(".pj-goal-tools"))) return;
const r = th.getBoundingClientRect(), z = uiZoom();
tools.classList.add("is-at-cursor");
tools.style.left = Math.round((toolEntryX - r.left) / z + 14) + "px";
tools.style.top = Math.round((e.clientY - r.top) / z - tools.offsetHeight / 2) + "px";
}
table.addEventListener("mouseover", function (e) {
const th = e.target.closest(TOOL_HOSTS);
if (!th || (e.relatedTarget && th.contains(e.relatedTarget))) return; // 칸에 막 들어왔을 때만
toolEntryX = e.clientX;
placeTools(th, e);
});
table.addEventListener("mousemove", function (e) {
const th = e.target.closest(TOOL_HOSTS);
if (th) placeTools(th, e);
});
// ── 영역·줄 이름 — 눌러서 그 자리에서 수정(Enter·칸 떠남 = 저장, Esc = 취소). 서식 없이 글자만. ──
function startNameEdit(span) {
if (span.isContentEditable) return;
+2
View File
@@ -536,6 +536,8 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
- **영역·줄 이름 바로 수정**(관리자) — 이름(`[data-goal-edit="area|row"]`)을 누르면 contenteditable(`startNameEdit`) —
Enter·칸 떠남 = 저장, Esc = 취소, 붙여넣기는 글자만. 영역 이름 빈 값은 되돌림(서버도 400), 줄 이름은 빈 값 허용(빈 줄 이름은
마우스를 올리면 "줄 이름" 자리 표시). 예전 ✎(prompt) 버튼은 없앴고 도구 막대는 색·↑·↓·+·× 만.
- **도구 막대 위치**(2026-10-01) — 영역·줄 이름 칸에 마우스를 올리면 막대가 **커서 오른쪽**에 나타난다(칸에 들어온 자리 기준 가로 고정,
세로는 커서를 따라감 — 가로까지 따라가면 막대를 누르러 갈 때 도망간다, `placeTools`·`.is-at-cursor`). 커서가 막대 위면 그대로.
- **줄 추가·삭제(항목 칸)**(관리자) — 줄 이름 칸 도구 막대: ↑·↓(줄 2개 이상)·**+ = 이 줄 아래에 줄 추가**·×(줄 2개 이상). 항목 칸 **우클릭 메뉴**: 위에 줄 추가 / 아래에 줄 추가 / 줄 삭제(영역의 마지막 한 줄이면 없음). 추가는 이름을 묻고(비워도 됨) `db.add_goal_row(ref_row_id, place)` 가 영역 줄 순서를 다시 매긴다(영역 FOR UPDATE). 영역 이름 칸의 + 는 예전처럼 맨 끝에 추가.
- **칸 병합 — 엑셀식**(관리자, 014 + 015, 2026-10-01에 예전 Shift+클릭·떠 있는 병합 버튼·오른쪽/왼쪽 칸과 병합 메뉴를 대체)
— `goal_cell_merges(row_id, start_month, span, row_span)`. 시작 칸 = **왼쪽 위**(row_id = 맨 위 줄, start_month = 왼쪽 칸 번호).