From 7c5a62ecc13cc18381a3b9236f1e969d2cd5af4a Mon Sep 17 00:00:00 2001 From: king Date: Thu, 25 Jun 2026 17:20:46 +0900 Subject: [PATCH] =?UTF-8?q?fix(project):=20=ED=83=80=EC=9E=84=EB=9D=BC?= =?UTF-8?q?=EC=9D=B8=20=EB=8C=93=EA=B8=80=20=EC=95=84=EC=9D=B4=EC=BD=98(?= =?UTF-8?q?=EC=9D=B4=EB=AA=A8=EC=A7=80)=20+=20=ED=99=95=EB=8C=80=EA=B5=AC?= =?UTF-8?q?=EA=B0=84=20=EC=A0=80=EC=9E=A5=20=EC=95=88=EB=90=98=EB=8D=98=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - vis 가 HTML 정화 → 아이콘 폰트 대신 💬 이모지로 댓글 수 표시 - 저장된 구간을 생성 옵션 start/end 로 주입해 autofit 덮어쓰기 방지, rangechanged 는 byUser 일 때만 저장 Co-Authored-By: Claude Opus 4.8 --- .../project/templates/project/index.html | 4 ++-- .../project/templates/project/project.html | 4 ++-- app/static/project.js | 20 +++++++++++-------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/app/modules/project/templates/project/index.html b/app/modules/project/templates/project/index.html index c636196..b564646 100644 --- a/app/modules/project/templates/project/index.html +++ b/app/modules/project/templates/project/index.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -167,5 +167,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 84c3be8..0a6f638 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -290,5 +290,5 @@ - + {% endblock %} diff --git a/app/static/project.js b/app/static/project.js index 01b90ca..f9594bf 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -491,7 +491,9 @@ const endISO = e + (t.due_time ? "T" + t.due_time : ""); const isRange = (e !== s) || (!!t.start_time && !!t.due_time && t.start_time !== t.due_time); items.push({ - id: t.id, group: grp, content: escapeHtml(t.title || "") + cmtBadge(t, "pj-cmt-ic-tl"), + // vis 가 HTML 을 정화(sanitize)하므로 아이콘 폰트 대신 이모지로 댓글 표시. + id: t.id, group: grp, + content: (t.title || "") + (t.comment_count ? " 💬" + t.comment_count : ""), start: startISO, end: isRange ? endISO : undefined, type: isRange ? "range" : "point", style: "background-color:" + (t.completed_at ? "#9aa5b1" : projColor) + ";color:#fff;border:none;", @@ -518,7 +520,10 @@ const koWd = function (d) { return ["일", "월", "화", "수", "목", "금", "토"][d.getDay()]; }; const pad2 = function (n) { return ("0" + n).slice(-2); }; - timeline = new vis.Timeline(node, new vis.DataSet(items), groups, { + // 저장된 보던 구간이 있으면 생성 옵션에 start/end 로 넣어 자동맞춤(autofit)을 막는다. + // (setWindow 로 나중에 바꾸면 초기 autofit 이 rangechanged 로 덮어써 초기화됨) + const saved = loadTLWindow(); + const opts = { stack: true, height: "520px", horizontalScroll: true, // 마우스 휠 = 좌우 이동(패닝) verticalScroll: false, @@ -549,17 +554,16 @@ } }, }, - }); + }; + if (saved) { opts.start = new Date(saved.start); opts.end = new Date(saved.end); } + timeline = new vis.Timeline(node, new vis.DataSet(items), groups, opts); timeline.on("select", function (props) { if (!canManage || !props.items.length) return; const t = tasks.find(function (x) { return x.id === props.items[0]; }); if (t) openTaskModal(t); }); - - // 확대/이동(보던 구간) 기억 — 저장된 창이 있으면 복원, 사용자가 바꾸면 저장. - const saved = loadTLWindow(); - if (saved) timeline.setWindow(new Date(saved.start), new Date(saved.end), { animation: false }); - timeline.on("rangechanged", function (p) { saveTLWindow(p.start, p.end); }); + // 사용자가 직접 확대/이동했을 때만 저장(autofit 등 프로그램 변경은 무시). + timeline.on("rangechanged", function (p) { if (p.byUser) saveTLWindow(p.start, p.end); }); } function loadTLWindow() { try {