From 535729deb186229c62a72d2fef9c72c2fb9facd4 Mon Sep 17 00:00:00 2001 From: king Date: Tue, 22 Sep 2026 11:13:48 +0900 Subject: [PATCH] =?UTF-8?q?fix(project):=20=ED=94=84=EB=A1=9C=EC=A0=9D?= =?UTF-8?q?=ED=8A=B8=20=ED=99=94=EB=A9=B4=20500=20=E2=80=94=20=EC=83=88=20?= =?UTF-8?q?=EC=BB=A8=ED=85=8D=EC=8A=A4=ED=8A=B8=20=EB=B3=80=EC=88=98?= =?UTF-8?q?=EA=B0=80=20=EC=97=89=EB=9A=B1=ED=95=9C=20=ED=95=A8=EC=88=98?= =?UTF-8?q?=EC=97=90=20=EB=93=A4=EC=96=B4=EA=B0=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 직전 커밋에서 두 값이 홈 화면 쪽에 들어가 프로젝트 화면이 터졌다. - router.py: my_open_total / mention_unread 를 index() 가 아니라 이 값들을 실제로 템플릿에 넘기는 project_page() 에서 계산하도록 이동 (project_page 가 NameError → Internal Server Error). - project.js: refreshMyTasksBadge() 호출이 홈의 syncMyTaskPanel 에 들어가 있었다. 이 함수는 initProject 스코프라 홈에서 부르면 ReferenceError — 프로젝트 화면의 syncProjectMyTaskPanel 로 옮겼다. 둘 다 같은 원인: 두 함수에 똑같이 생긴 코드 줄이 있어 치환이 첫 번째(홈)에 걸렸다. Co-Authored-By: Claude Opus 5 (1M context) --- app/modules/project/router.py | 4 ++-- app/static/project.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/modules/project/router.py b/app/modules/project/router.py index 4cd1b15..cf0b3b3 100644 --- a/app/modules/project/router.py +++ b/app/modules/project/router.py @@ -485,8 +485,6 @@ async def index(request: Request) -> HTMLResponse: t["due_label"] = _fmt_date_kr(t.get("due_date")) # 내 업무를 프로젝트별로 묶어 트리로 표시(전체/진행/완료 개수 포함) my_projects = _group_my_tasks(my_tasks) - my_open_total = sum(g["open"] for g in my_projects) - mention_unread = _safe_mention_unread(st, user["email"]) # 홈 화면 카드/내업무에 노출된 업무 전체(id→업무) — 클릭 시 페이지 이동 없이 # 팝업으로 편집하기 위해 필요한 원본 데이터를 그대로 클라이언트에 넘긴다. @@ -614,6 +612,8 @@ async def project_page(request: Request, project_id: int) -> HTMLResponse: t["start_label"] = _fmt_date_kr(t.get("start_date")) t["due_label"] = _fmt_date_kr(t.get("due_date")) my_projects = _group_my_tasks(my_tasks) + my_open_total = sum(g["open"] for g in my_projects) + mention_unread = _safe_mention_unread(st, user["email"]) # 달력(휴가식 월간 그리드) — ?y=&m= 로 월 이동, 기본 이번 달 today = today_kst() diff --git a/app/static/project.js b/app/static/project.js index eb82b4b..fedae88 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -1195,7 +1195,6 @@ if (cmt) cmt.wireBadge(newLi.querySelector(".pj-cmt-badge")); if (existingLi) existingLi.replaceWith(newLi); else group.appendChild(newLi); updateMyTreeCounts(groupEl); - refreshMyTasksBadge(); } @@ -1788,6 +1787,7 @@ if (cmt) cmt.wireBadge(newLi.querySelector(".pj-cmt-badge")); if (existingLi) existingLi.replaceWith(newLi); else group.appendChild(newLi); updateMyTreeCounts(groupEl); + refreshMyTasksBadge(); } // 내 업무 항목 우클릭 메뉴 — 열기(프로젝트 페이지로 이동)/업무 추가/수정 // (팝업 편집)/완료토글/삭제. "업무 추가"는 현재 열려 있는 프로젝트로만