feat(project): 실시간 저장·댓글 답글/반응·완료 이력·수신함 오른쪽 작업 창·화면 배율 토글

- 작업 창 저장 버튼 제거 → 칸별 실시간 저장(새 작업은 제목 입력 시 생성)
- 댓글 답글·이모티콘 반응(마이그레이션 012), @태그 아이콘+이름 칩, 이모티콘 선택기
- 작업 완료 시 댓글 사이에 "OO 님이 이 작업을 완료했습니다" 이력 표시
- 수신함 "확인" → 페이지 이동 없이 오른쪽 패널(iframe embed)에 작업 창
- 프로젝트 제목 클릭 수정, 긴 작업 제목 자동 줄바꿈
- 상단 바 화면 배율 토글(2880x1620·200%용, .erp-app zoom .75)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-28 18:11:34 +09:00
parent 3882dd7ad3
commit 4fb8b37d9c
13 changed files with 1337 additions and 144 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ Claude Code는 이 저장소에서 작업을 시작하기 전에 **반드시 아
- 말레이시아 창고 재고관리 (`app/modules/malaysia/`, `malaysia_stock_db`) — 낱개(MT/MX/MZ) 입출고·조정, 세트(MY) BOM, 일일 재고조사(세트→낱개 자동 분해), 현재고 현황. 뚜껑(MD-)은 재고 집계 제외 — 단, 창고 랙에는 위치 확인용으로 배치 가능(`store.LID_ITEMS`). 상품은 `itemcode_db` 읽기 전용. 권한키 `malaysia`
- 말레이시아 배송 (`app/modules/dispatch/`, `dispatch_db`) — TikTok·Shopee 출고관리. 플랫폼별 데이터 엑셀 업로드(TikTok=03_TikTok_Order_Export.xlsx, Shopee=Packing List.Doorstep Delivery.xlsx) → 1상자=1카드 출고 작업 리스트·SKU 피킹 요약·Kagayaku 전달표 자동 생성. 1상자 묶음 기준 Package ID > Tracking ID > Order ID, 같은 상자 같은 SKU 합산. 작업 상태 토글(`dispatch_logs` 기록). 받는 사람 이름/전화/주소는 상자 단위로 저장(작업 카드 표시 + 출고 엑셀 생성용 — 개인정보). 배치 다운로드 zip 에 업로드 원본 + 취합 출고 엑셀(`YYYY.MM.DD(Ddd)_tictoc|shopee.xlsx`) 포함. 엑셀은 openpyxl 파싱/생성. 권한키 `dispatch`. 상세는 `docs/DISPATCH_MODULE.md`
- 카페24 상품관리 (`app/modules/cafe24/`, `cafe24_db`) — 카페24 관리자에 들어가지 않고 상품 상세페이지(description HTML) 조회·편집·즉시적용·예약적용·버전 이력. 3분할 화면(목록 | HTML 편집기 | 상품 정보 패널). 정보 패널(`routes_product_info.py`, `_side.html`)에서 상품명·판매가·공급가·소비자가, 대표이미지(`POST /admin/products/{no}/images` 에 base64 data URI + `image_upload_type=A` — NNEditor 업로드 경로를 PUT `detail_image` 에 넣는 방식은 적용 안 됨), 옵션(생성/이름·썸네일·표시방식 수정/삭제)·품목(자체코드·추가금액·진열·판매)을 수정. 카페24 OAuth/API 클라이언트는 향후 주문관리와 공유하기 위해 **공통 계층 `app/integrations/cafe24/`** 에 둔다 — 라우터에서 `httpx`/`requests` 직접 호출 금지. 토큰은 Fernet 암호화 저장(`CAFE24_TOKEN_SECRET`), 로그/화면에 토큰·시크릿 절대 미출력. 쓰기 직전 항상 카페24 현재 HTML 을 다시 읽어 `BACKUP` revision 생성(로컬 값을 현재값으로 가정 금지). **카페24 관리자 API 는 PUT 뒤 한동안 GET 에서 예전 값을 돌려준다(읽기 지연)** — 우리 캐시 문제가 아니다. 그래서 "마지막 쓰기가 권위": 상세설명은 카페24 값이 최근 revision 중 하나와 같으면 지연으로 보고 마지막 MANUAL/SCHEDULED 를 표시·지문 기준으로 쓰고(`store.resolve_description`), 스칼라(상품명·가격·이미지·진열/판매)는 PUT 응답 스냅샷(`cafe24_products.last_write_snapshot`, 마이그레이션 004)과 GET 의 `updated_date` 를 비교해 덮어씌운다(`store.overlay_recent_write`). 유예시간 `CAFE24_READ_LAG_GRACE_MIN`(기본 360분). 쓰기 후 화면은 PUT 응답으로 그리고 다시 GET 하지 않는다. 예약은 DB 저장 + 별도 worker(`app/modules/cafe24/worker.py`, compose 서비스 `dbx-cafe24-worker`)가 처리 — 웹 프로세스에서 대기하지 않는다. 권한키 `cafe24`(연결/해제는 admin 전용). 상세는 `docs/CAFE24_MODULE.md`
- 프로젝트 관리 (`app/modules/project/`, `project_db`) — 아사나식. 프로젝트/서브프로젝트(self-FK `parent_id`, CASCADE)·프로젝트 색상(아사나 16색)·아이콘(`projects.icon`, Material Symbols 42종, 마이그레이션 011)·작업(`tasks`: 담당자·우선순위·시작/마감)·진행단계(`project_stages` 칸반, 생성시 기본 4단계 seed, 섹션 기본 담당자 `default_assignee_email` — 담당자 빈 작업을 그 섹션에 만들거나 옮기면 자동 배정, 마이그레이션 009)·멤버 배정(`project_members`)·활동이력(`project_activity`). 첫 화면(`/project/`)은 **내 작업 목록**(프로젝트 홈 카드 화면은 폐지). 프로젝트 화면은 캘린더(FullCalendar)/타임라인(vis-timeline)/보드/목록/대시보드 뷰 토글. 좌측 사이드바는 수신함·내 작업·휴지통·프로젝트 화면 공용(`templates/project/_side.html` + 프로젝트 목록 동작 `initSideTree`, 새 프로젝트/수정 모달 `_side_modals.html`) — 프로젝트 목록(순서 변경·✎·×)은 어느 화면에서나 같다. 보드는 아사나처럼 섹션이 가로로 계속 늘어나고(넘치면 가로 스크롤) 카드의 담당자·마감일을 클릭해 그 자리에서 바꾼다. 좌측 사이드바에 수신함·내 작업(접이식) 메뉴. 설명란은 주소 붙여넣기 시 자동 링크, 설명란·댓글에서 @로 멤버를 태그하면 (`task_mentions`, 마이그레이션 006) 수신함에 그 작업이 쌓인다. 진입 권한키 `project`(관리자 페이지 토글로 직원별 부여, admin 자동). 프로젝트 생성은 `project` 권한자 누구나(만든 사람이 owner), 삭제는 만든 사람만(슈퍼관리자 예외), 사용자 배정은 `is_admin` 만. 배정 멤버(또는 owner/admin)만 그 프로젝트를 조회(화면·API 모두, 비멤버 403)하고 서브프로젝트/작업/단계 CRUD — URL 의 섹션·부모 작업이 그 프로젝트 것인지 서버가 검증. 실시간 반영은 `project_live_version` 카운터(마이그레이션 007, 미적용 시 MAX 폴백). 사이드바 전체 검색(`/api/search`, 제목·설명·댓글, pg_trgm) + 프로젝트/내 작업 필터 바(찾기·상태·담당자·마감·우선순위·정렬, 클라이언트 필터). 협업자(`task_followers`, 자동 팔로우: 만든 사람·담당자·댓글·@태그) — 완료·댓글 알림은 담당자+협업자에게만. 작업 삭제는 휴지통(`project_trash`, 마이그레이션 010) — 삭제 직전 스냅샷 3개월 보관, 관리자만 보기·복구(`/project/trash`). 마감 알림(`reminders.py` 데몬 스레드, 영업일 09시, D-1/당일/지연, `task_reminders` 로 중복 방지, `PROJECT_REMINDER_*` env) — 마이그레이션 008. 라우터 핸들러는 동기 DB 라 `def` 로 둔다(`async def` 금지). 말풍선은 전부 아사나식 공용 말풍선(`.pj-hovertip`) — 새 기능도 `title=`/`data-tip=` 만 달고 별도 툴팁 구현 금지. 멤버 배정 후보는 `project` 권한 보유 등록 사용자에서 자동 목록(`GET /project/api/assignable-users`). 작업 배정·완료 시 관리자에게 메일(`app/mail.py` stdlib smtplib, `SMTP_*`+`PROJECT_NOTIFY_EMAIL` env, 미설정 시 조용히 skip, `BackgroundTasks` 비동기). 상세는 `docs/PROJECT_MODULE.md`
- 프로젝트 관리 (`app/modules/project/`, `project_db`) — 아사나식. 프로젝트/서브프로젝트(self-FK `parent_id`, CASCADE)·프로젝트 색상(아사나 16색)·아이콘(`projects.icon`, Material Symbols 42종, 마이그레이션 011)·작업(`tasks`: 담당자·우선순위·시작/마감)·진행단계(`project_stages` 칸반, 생성시 기본 4단계 seed, 섹션 기본 담당자 `default_assignee_email` — 담당자 빈 작업을 그 섹션에 만들거나 옮기면 자동 배정, 마이그레이션 009)·멤버 배정(`project_members`)·활동이력(`project_activity`). 첫 화면(`/project/`)은 **내 작업 목록**(프로젝트 홈 카드 화면은 폐지). 프로젝트 화면은 캘린더(FullCalendar)/타임라인(vis-timeline)/보드/목록/대시보드 뷰 토글. 좌측 사이드바는 수신함·내 작업·휴지통·프로젝트 화면 공용(`templates/project/_side.html` + 프로젝트 목록 동작 `initSideTree`, 새 프로젝트/수정 모달 `_side_modals.html`) — 프로젝트 목록(순서 변경·✎·×)은 어느 화면에서나 같다. 보드는 아사나처럼 섹션이 가로로 계속 늘어나고(넘치면 가로 스크롤) 카드의 담당자·마감일을 클릭해 그 자리에서 바꾼다. 좌측 사이드바에 수신함·내 작업(접이식) 메뉴. 설명란은 주소 붙여넣기 시 자동 링크, 설명란·댓글에서 @로 멤버를 태그하면 (`task_mentions`, 마이그레이션 006) 수신함에 그 작업이 쌓인다. 진입 권한키 `project`(관리자 페이지 토글로 직원별 부여, admin 자동). 프로젝트 생성은 `project` 권한자 누구나(만든 사람이 owner), 삭제는 만든 사람만(슈퍼관리자 예외), 사용자 배정은 `is_admin` 만. 배정 멤버(또는 owner/admin)만 그 프로젝트를 조회(화면·API 모두, 비멤버 403)하고 서브프로젝트/작업/단계 CRUD — URL 의 섹션·부모 작업이 그 프로젝트 것인지 서버가 검증. 실시간 반영은 `project_live_version` 카운터(마이그레이션 007, 미적용 시 MAX 폴백). 사이드바 전체 검색(`/api/search`, 제목·설명·댓글, pg_trgm) + 프로젝트/내 작업 필터 바(찾기·상태·담당자·마감·우선순위·정렬, 클라이언트 필터). 협업자(`task_followers`, 자동 팔로우: 만든 사람·담당자·댓글·@태그) — 완료·댓글 알림은 담당자+협업자에게만. 작업 삭제는 휴지통(`project_trash`, 마이그레이션 010) — 삭제 직전 스냅샷 3개월 보관, 관리자만 보기·복구(`/project/trash`). 마감 알림(`reminders.py` 데몬 스레드, 영업일 09시, D-1/당일/지연, `task_reminders` 로 중복 방지, `PROJECT_REMINDER_*` env) — 마이그레이션 008. 라우터 핸들러는 동기 DB 라 `def` 로 둔다(`async def` 금지). 말풍선은 전부 아사나식 공용 말풍선(`.pj-hovertip`) — 새 기능도 `title=`/`data-tip=` 만 달고 별도 툴팁 구현 금지. 멤버 배정 후보는 `project` 권한 보유 등록 사용자에서 자동 목록(`GET /project/api/assignable-users`). 작업 배정·완료 시 관리자에게 메일(`app/mail.py` stdlib smtplib, `SMTP_*`+`PROJECT_NOTIFY_EMAIL` env, 미설정 시 조용히 skip, `BackgroundTasks` 비동기). 작업 창은 **저장 버튼 없이 실시간 저장**(칸별 PUT, `saveField`/`saveChain`, 새 작업은 제목이 생기는 순간 생성). 댓글 답글·이모티콘 반응(마이그레이션 012 `task_comments.parent_id`·`task_comment_reactions`, 미적용 시 버튼 숨김·API 503), 완료 이력 줄은 `project_activity` completed 를 댓글 사이에 표시(댓글 수 제외), 댓글 `@아이디` 는 아이콘+이름 칩. 수신함 "확인"은 페이지 이동 없이 오른쪽 iframe 패널(`/project/p/{pid}?task=&embed=1`, `html.pj-embed`). 상단 바 화면 배율 토글(`html.pj-ui-scale` → `.erp-app` zoom .75, 2880×1620·200%용) — **팝업은 반드시 `document.body` 에 붙인다**(배율 안의 fixed 좌표는 어긋남). 상세는 `docs/PROJECT_MODULE.md`
상세는 `docs/PROJECT_OVERVIEW.md`.
+113 -11
View File
@@ -832,7 +832,7 @@ class ProjectStore:
# task_mentions·task_attachments 의 comment_id 가 댓글을 가리키므로 댓글 먼저.
# 알림(project_notifications)은 되살리면 수신함에 옛 알림이 다시 쌓여 제외.
TRASH_CHILD_TABLES = (
"task_comments", "task_followers", "task_mentions", "task_attachments",
"task_comments", "task_comment_reactions", "task_followers", "task_mentions", "task_attachments",
"task_project_links", "project_activity", "task_reminders",
)
@@ -1087,15 +1087,94 @@ class ProjectStore:
# ════════════════════════════════════════════════════════════
# 댓글 (task_comments)
# ════════════════════════════════════════════════════════════
def comment_features(self) -> dict[str, bool]:
"""답글(parent_id)·반응 테이블이 있는지(마이그레이션 012). 한 번 켜지면 기억."""
cached = getattr(self, "_comment_features", None)
if cached and cached["replies"] and cached["reactions"]:
return cached
with self._pool.connection() as conn:
col = conn.execute(
"SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' "
"AND table_name = 'task_comments' AND column_name = 'parent_id'"
).fetchone()
feats = {
"replies": bool(col),
"reactions": self._table_exists(conn, "task_comment_reactions"),
}
self._comment_features = feats
return feats
def list_comments(self, *, task_id: int) -> list[dict[str, Any]]:
"""댓글(작성순). 012 가 있으면 각 댓글에 reactions=[{emoji, users}] 를 붙인다."""
feats = self.comment_features()
with self._pool.connection() as conn:
rows = conn.execute(
"SELECT * FROM task_comments WHERE task_id = %s "
"ORDER BY created_at ASC, id ASC",
(task_id,),
).fetchall()
reacts: list[dict[str, Any]] = []
if feats["reactions"]:
reacts = conn.execute(
"SELECT comment_id, emoji, array_agg(user_email ORDER BY created_at) AS users "
"FROM task_comment_reactions WHERE task_id = %s "
"GROUP BY comment_id, emoji ORDER BY MIN(created_at)",
(task_id,),
).fetchall()
by_comment: dict[int, list[dict[str, Any]]] = {}
for r in reacts:
by_comment.setdefault(int(r["comment_id"]), []).append(
{"emoji": r["emoji"], "users": list(r["users"] or [])}
)
out = []
for r in rows:
c = self._serialize(r)
c.setdefault("parent_id", None)
c["reactions"] = by_comment.get(int(c["id"]), [])
out.append(c)
return out
def list_completion_events(self, *, task_id: int) -> list[dict[str, Any]]:
"""이 작업의 '완료' 이력 — 댓글 목록에 "OO 님이 이 작업을 완료했습니다"로 끼워 보인다."""
with self._pool.connection() as conn:
rows = conn.execute(
"SELECT actor_email, created_at FROM project_activity "
"WHERE task_id = %s AND action = %s ORDER BY created_at ASC, id ASC",
(task_id, store.ACTION_COMPLETED),
).fetchall()
return [self._serialize(r) for r in rows]
def toggle_reaction(
self, *, comment_id: int, user_email: str, emoji: str
) -> list[dict[str, Any]]:
"""반응 켜기/끄기 → 그 댓글의 반응 목록. 댓글이 없으면 KeyError."""
email = store.norm_str(user_email, lower=True)
with self._pool.connection() as conn:
with conn.transaction():
c = conn.execute(
"SELECT task_id FROM task_comments WHERE id = %s", (comment_id,)
).fetchone()
if not c:
raise KeyError(comment_id)
gone = conn.execute(
"DELETE FROM task_comment_reactions "
"WHERE comment_id = %s AND user_email = %s AND emoji = %s RETURNING 1",
(comment_id, email, emoji),
).fetchone()
if not gone:
conn.execute(
"INSERT INTO task_comment_reactions (comment_id, task_id, user_email, emoji) "
"VALUES (%s,%s,%s,%s) ON CONFLICT DO NOTHING",
(comment_id, c["task_id"], email, emoji),
)
rows = conn.execute(
"SELECT emoji, array_agg(user_email ORDER BY created_at) AS users "
"FROM task_comment_reactions WHERE comment_id = %s "
"GROUP BY emoji ORDER BY MIN(created_at)",
(comment_id,),
).fetchall()
return [{"emoji": r["emoji"], "users": list(r["users"] or [])} for r in rows]
def get_comment(self, *, comment_id: int) -> dict[str, Any] | None:
with self._pool.connection() as conn:
row = conn.execute(
@@ -1105,20 +1184,37 @@ class ProjectStore:
def add_comment(
self, *, task_id: int, author_email: str, author_name: str, body: str,
allow_empty: bool = False,
allow_empty: bool = False, parent_id: int | None = None,
) -> dict[str, Any]:
"""allow_empty — 채팅 팝업에서 파일/이미지만 보내는 메시지(본문 없음)를
허용할 때 True. 일반 댓글 입력은 여전히 빈 값을 막는다."""
허용할 때 True. 일반 댓글 입력은 여전히 빈 값을 막는다.
parent_id — 답글(012). 같은 작업의 댓글이어야 하고, 답글에 단 답글은
원 댓글에 붙인다(한 단계). 없는 댓글이면 ValueError."""
text = store.norm_str(body)
if not text and not allow_empty:
raise ValueError("댓글 내용이 비었습니다.")
with self._pool.connection() as conn:
row = conn.execute(
"INSERT INTO task_comments (task_id, author_email, author_name, body) "
"VALUES (%s,%s,%s,%s) RETURNING *",
(task_id, store.norm_str(author_email, lower=True),
store.norm_str(author_name), text),
).fetchone()
if parent_id:
p = conn.execute(
"SELECT id, task_id, parent_id FROM task_comments WHERE id = %s", (parent_id,)
).fetchone()
if not p or int(p["task_id"]) != int(task_id):
raise ValueError("답글을 달 댓글을 찾을 수 없습니다.")
root = int(p["parent_id"] or p["id"])
row = conn.execute(
"INSERT INTO task_comments (task_id, author_email, author_name, body, parent_id) "
"VALUES (%s,%s,%s,%s,%s) RETURNING *",
(task_id, store.norm_str(author_email, lower=True),
store.norm_str(author_name), text, root),
).fetchone()
else:
row = conn.execute(
"INSERT INTO task_comments (task_id, author_email, author_name, body) "
"VALUES (%s,%s,%s,%s) RETURNING *",
(task_id, store.norm_str(author_email, lower=True),
store.norm_str(author_name), text),
).fetchone()
return self._serialize(row)
def update_comment(
@@ -1155,9 +1251,15 @@ class ProjectStore:
raise KeyError(comment_id)
if not is_admin and row["author_email"] != store.norm_str(requester, lower=True):
raise PermissionError("본인 댓글만 삭제할 수 있습니다.")
# 답글(012)도 CASCADE 로 같이 지워지므로 답글의 첨부 파일도 모은다.
reply_clause = (
" OR comment_id IN (SELECT id FROM task_comments WHERE parent_id = %s)"
if self.comment_features()["replies"] else ""
)
files = conn.execute(
"SELECT task_id, stored_name FROM task_attachments WHERE comment_id = %s",
(comment_id,),
"SELECT task_id, stored_name FROM task_attachments WHERE comment_id = %s"
+ reply_clause,
(comment_id, comment_id) if reply_clause else (comment_id,),
).fetchall()
conn.execute("DELETE FROM task_comments WHERE id = %s", (comment_id,))
return [dict(f) for f in files]
+55 -1
View File
@@ -1620,7 +1620,17 @@ def api_list_comments(request: Request, task_id: int) -> JSONResponse:
if task is None:
raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"])
return JSONResponse({"comments": st.list_comments(task_id=task_id)})
try:
events = st.list_completion_events(task_id=task_id)
except Exception: # noqa: BLE001 - 완료 표시는 부가 정보
logger.warning("완료 이력 조회 실패: task=%s", task_id)
events = []
return JSONResponse({
"comments": st.list_comments(task_id=task_id),
# "OO 님이 이 작업을 완료했습니다" — 댓글 사이에 시간순으로 끼워 보인다.
"events": [{"type": "completed", **e} for e in events],
"features": st.comment_features(),
})
@router.post("/api/tasks/{task_id}/comments")
@@ -1633,6 +1643,14 @@ def api_add_comment(
if task is None:
raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"])
parent_id = payload.get("parent_id")
if parent_id:
try:
parent_id = int(parent_id)
except (TypeError, ValueError):
raise HTTPException(status_code=400, detail="parent_id 가 올바르지 않습니다.")
if not st.comment_features()["replies"]:
raise HTTPException(status_code=503, detail=_COMMENT_012_MSG)
try:
comment = st.add_comment(
task_id=task_id,
@@ -1640,9 +1658,12 @@ def api_add_comment(
author_name=user.get("name") or user["email"].split("@")[0],
body=payload.get("body", ""),
allow_empty=bool(payload.get("has_attachment")),
parent_id=parent_id or None,
)
except ValueError as exc:
raise HTTPException(status_code=400, detail=str(exc))
comment.setdefault("parent_id", None)
comment["reactions"] = []
_follow(st, task_id, [user["email"]]) # 댓글 단 사람은 이후 소식도 받는다
project = st.get_project(project_id=task["project_id"]) or {"id": task["project_id"], "name": task.get("project_name", "")}
_inbox(
@@ -1661,6 +1682,39 @@ def api_add_comment(
return JSONResponse({"comment": comment}, status_code=201)
_COMMENT_012_MSG = (
"댓글 답글·반응 기능은 DB 마이그레이션 012 적용 후 사용할 수 있습니다 "
"(scripts/sql/project_db_012_comment_replies_reactions.sql)."
)
_REACTION_MAX_LEN = 16 # 이모티콘 1개(ZWJ 조합·국기 포함)면 충분한 길이
@router.post("/api/comments/{comment_id}/reactions")
def api_toggle_reaction(
request: Request, comment_id: int, payload: dict[str, Any] = Body(...)
) -> JSONResponse:
"""댓글 이모티콘 반응 켜기/끄기(아사나식). body: {"emoji": "👍"} → {"reactions": [...]}"""
user = _require_user(request)
st = _db_or_503(request)
emoji = str(payload.get("emoji") or "").strip()
if not emoji or len(emoji) > _REACTION_MAX_LEN or any(ch.isalnum() or ch in "<>&\"'" for ch in emoji):
raise HTTPException(status_code=400, detail="이모티콘이 올바르지 않습니다.")
comment = st.get_comment(comment_id=comment_id)
if comment is None:
raise HTTPException(status_code=404, detail="댓글을 찾을 수 없습니다.")
task = st.get_task(task_id=comment["task_id"])
if task is None:
raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, task["project_id"])
if not st.comment_features()["reactions"]:
raise HTTPException(status_code=503, detail=_COMMENT_012_MSG)
try:
reactions = st.toggle_reaction(comment_id=comment_id, user_email=user["email"], emoji=emoji)
except KeyError:
raise HTTPException(status_code=404, detail="댓글을 찾을 수 없습니다.")
return JSONResponse({"reactions": reactions})
@router.put("/api/comments/{comment_id}")
def api_update_comment(
request: Request, comment_id: int, payload: dict[str, Any] = Body(...)
@@ -1,3 +1,33 @@
{# 화면 배율 토글 — 2880×1620·200%(CSS 화면 폭 1440px)에서도 1920×1080 기준 화면처럼
보이도록 앱 화면을 0.75 로 줄인다(project.css html.pj-ui-scale, project.js initUiScaleToggle).
선택은 브라우저별로 기억(localStorage) — 그리기 전에 바로 적용해 깜빡임을 줄인다. #}
<script>
try { if (localStorage.getItem("pj_ui_scale") === "1") document.documentElement.classList.add("pj-ui-scale"); } catch (_) {}
</script>
<button type="button" class="pj-help-btn pj-ui-scale-btn" id="pj-ui-scale-btn" aria-label="화면 배율 전환">
<span class="material-symbols-outlined">fit_screen</span>
</button>
<script>
(function () {
var root = document.documentElement;
var btn = document.getElementById("pj-ui-scale-btn");
function sync() {
var on = root.classList.contains("pj-ui-scale");
btn.classList.toggle("is-on", on);
btn.title = on
? "화면 배율: 고해상도(2880×1620·200%)용 — 누르면 기본(1920×1080)"
: "화면 배율: 기본(1920×1080) — 누르면 고해상도(2880×1620·200%)용";
}
btn.addEventListener("click", function () {
var on = !root.classList.contains("pj-ui-scale");
root.classList.toggle("pj-ui-scale", on);
try { localStorage.setItem("pj_ui_scale", on ? "1" : "0"); } catch (_) {}
sync();
window.dispatchEvent(new Event("resize")); // 보드·타임라인 등 크기 다시 재기
});
sync();
})();
</script>
{# 프로젝트 관리 도움말 — 상단 바 로그아웃 오른쪽의 ? 아이콘(erp_base 의 topbar_after_logout).
새 탭으로 열어 하던 작업이 끊기지 않게 한다. #}
<a class="pj-help-btn" href="/project/help" target="_blank" rel="noopener"
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260926v" />
<link rel="stylesheet" href="/static/project.css?v=20260928c" />
<link rel="stylesheet" href="/static/project-help.css?v=20260926v" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -94,8 +94,11 @@
<h3>위쪽 바</h3>
<ul>
<li><span class="pjh-ui"><span class="material-symbols-outlined">notifications</span></span> 종 아이콘 — 읽지 않은 알림 수가 표시되고, 누르면 수신함으로 갑니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">fit_screen</span></span> 화면 배율 — 누르면(파랗게 켜짐) 화면 전체를 75%로 줄입니다. 2880×1620 모니터를 Windows 배율 200%로 쓰면 화면이 꽉 차 보이는데, 이때 켜면 1920×1080 모니터와 같은 모습이 됩니다. 브라우저마다 기억합니다. 메뉴·말풍선 같은 작은 팝업은 원래 크기로 뜹니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">help</span></span> 물음표 — 지금 보고 있는 이 도움말을 새 탭으로 엽니다.</li>
</ul>
<h3>프로젝트 제목</h3>
<p>가운데 위 프로젝트 제목에 마우스를 올리면 테두리가 생깁니다. 누르면 그 자리에서 이름을 고칩니다 — <kbd>Enter</kbd>나 바깥을 누르면 저장, <kbd>Esc</kbd>는 취소. (그 프로젝트 멤버·관리자만)</p>
<div class="pjh-note"><span class="material-symbols-outlined">info</span>
<div>여러 사람이 동시에 써도 걱정 없습니다. 다른 사람이 바꾼 내용은 <b>약 8초 안에</b> 내 화면에 자동으로 반영됩니다(새로고침하지 않아도 됩니다). 내가 입력 중인 창은 건드리지 않습니다.</div></div>
</section>
@@ -253,10 +256,10 @@
<tr><td><span class="pjh-ui"><span class="material-symbols-outlined">link</span>공유</span></td><td>이 작업의 주소를 복사합니다. 메신저로 보내면 받은 멤버가 바로 이 작업을 엽니다.</td></tr>
<tr><td><span class="pjh-ui">✓ 완료로 표시</span></td><td>작업을 완료합니다. 다시 누르면 <span class="pjh-ui">↩ 완료 취소</span>.</td></tr>
<tr><td><span class="pjh-ui">삭제</span></td><td>작업을 지웁니다(만든 사람만). 하위 작업이 있으면 함께 지울지 한 번 더 묻습니다. 지운 작업은 휴지통에 3개월 보관됩니다.</td></tr>
<tr><td><span class="pjh-ui">취소</span> · <span class="pjh-ui">저장</span></td><td>제목·담당자·섹션·우선순위·마감일·설명은 <b>저장</b>을 눌러야 반영됩니다. 저장하지 않고 닫으려 하면 “저장하시겠습니까?”를 묻습니다.</td></tr>
<tr><td><span class="pjh-ui">저장됨</span></td><td>저장 버튼이 없습니다 — 고치는 즉시 저장되고, 버튼 줄 오른쪽에 <span class="pjh-ui">저장 중…</span> → <span class="pjh-ui">✓ 저장됨</span>이 잠깐 보입니다.</td></tr>
</table>
<div class="pjh-note"><span class="material-symbols-outlined">info</span>
<div>협업자 · 하위 작업 · 첨부 파일 · 다른 프로젝트 추가 · 댓글은 <b>누르는 즉시 저장</b>됩니다. 저장 버튼이 필요 없습니다.</div></div>
<div><b>실시간 저장</b> — 제목은 칸을 벗어나거나 <kbd>Enter</kbd>, 설명은 입력을 멈추고 1초쯤 뒤(또는 칸을 벗어날 때), 담당자·섹션·우선순위·마감일은 바꾸는 즉시 저장됩니다. 새 작업은 <b>제목을 쓰는 순간</b> 만들어집니다(제목 없이 닫으면 만들어지지 않습니다). 협업자 · 하위 작업 · 첨부 파일 · 다른 프로젝트 추가 · 댓글도 누르는 즉시 저장됩니다.</div></div>
<h3>제목과 기본 정보</h3>
<ul>
<li><b>제목</b> — 맨 위 큰 글씨를 눌러 바로 고칩니다.</li>
@@ -275,7 +278,7 @@
<h3>설명</h3>
<ul>
<li>서식 도구(왼쪽부터): <span class="pjh-ui"><span class="material-symbols-outlined">format_bold</span></span> 굵게 · <span class="pjh-ui"><span class="material-symbols-outlined">format_italic</span></span> 기울임 · <span class="pjh-ui"><span class="material-symbols-outlined">format_underlined</span></span> 밑줄 · <span class="pjh-ui"><span class="material-symbols-outlined">format_strikethrough</span></span> 취소선(<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>X</kbd>) · <span class="pjh-ui"><span class="material-symbols-outlined">format_list_bulleted</span></span> 글머리 목록 · <span class="pjh-ui"><span class="material-symbols-outlined">format_list_numbered</span></span> 번호 목록 · <span class="pjh-ui"><span class="material-symbols-outlined">check_box</span></span> 체크박스 · <span class="pjh-ui"><span class="material-symbols-outlined">format_quote</span></span> 인용 · <span class="pjh-ui"><span class="material-symbols-outlined">link</span></span> 링크 · <span class="pjh-ui"><span class="material-symbols-outlined">format_clear</span></span> 서식 지우기 · <span class="pjh-ui"><span class="material-symbols-outlined">image</span></span> 이미지 넣기. 아이콘에 마우스를 올리면 이름이 나옵니다.</li>
<li><b>체크박스(체크리스트)</b> — 글머리 목록처럼 씁니다. <span class="pjh-ui"><span class="material-symbols-outlined">check_box</span></span>를 누르면 지금 줄(또는 고른 줄들)이 체크리스트가 되어 줄마다 체크박스가 붙습니다. <kbd>Enter</kbd>로 새 줄을 만들면 체크박스도 함께 생기고, 빈 줄에서 <kbd>Enter</kbd>를 누르면 목록이 끝납니다. 체크박스를 누르면 체크되고 그 줄은 흐리게 취소선이 그어집니다. 다시 <span class="pjh-ui"><span class="material-symbols-outlined">check_box</span></span>를 누르면 평범한 글로, 글머리·번호 버튼을 누르면 그 목록으로 바뀝니다. 체크 상태는 <b>저장</b>하면 그대로 남습니다.</li>
<li><b>체크박스(체크리스트)</b> — 글머리 목록처럼 씁니다. <span class="pjh-ui"><span class="material-symbols-outlined">check_box</span></span>를 누르면 지금 줄(또는 고른 줄들)이 체크리스트가 되어 줄마다 체크박스가 붙습니다. <kbd>Enter</kbd>로 새 줄을 만들면 체크박스도 함께 생기고, 빈 줄에서 <kbd>Enter</kbd>를 누르면 목록이 끝납니다. 체크박스를 누르면 체크되고 그 줄은 흐리게 취소선이 그어집니다. 다시 <span class="pjh-ui"><span class="material-symbols-outlined">check_box</span></span>를 누르면 평범한 글로, 글머리·번호 버튼을 누르면 그 목록으로 바뀝니다. 체크 상태도 바로 저장됩니다.</li>
<li><b>이미지</b> — 캡처한 그림을 <kbd>Ctrl</kbd>+<kbd>V</kbd>로 바로 붙여 넣을 수 있습니다. 그림을 누르면 모서리를 끌어 크기를 바꾸거나 지울 수 있습니다.</li>
<li><b>링크</b> — 웹 주소를 붙여 넣으면 자동으로 링크가 되고, 누르면 새 탭에서 열립니다.</li>
<li><b>@태그</b> — <kbd>@</kbd>를 누르면 사람 목록이 뜹니다. 고른 사람의 수신함에 이 작업이 쌓입니다.</li>
@@ -323,7 +326,7 @@
<li>창 바깥을 누르거나 <kbd>Esc</kbd>로 닫습니다.</li>
</ul>
<div class="pjh-note"><span class="material-symbols-outlined">info</span>
<div>보드 카드와 하위 작업 줄에서는 날짜를 누르는 즉시 저장됩니다. 작업 편집 창의 마감일은 <b>저장</b>을 눌러야 반영됩니다.</div></div>
<div>보드 카드와 하위 작업 줄에서는 날짜를 누르는 즉시 저장됩니다. 작업 편집 창의 마감일도 고르는 즉시 저장됩니다.</div></div>
</section>
<!-- 11. 목록 -->
@@ -397,9 +400,17 @@
<ul>
<li>입력칸에 쓰고 <span class="pjh-ui">전송</span> 또는 <kbd>Enter</kbd>.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">attach_file</span></span>로 파일을 붙이거나, 캡처한 이미지를 <kbd>Ctrl</kbd>+<kbd>V</kbd>로 붙여 넣습니다. 이미지는 작은 그림으로 보입니다.</li>
<li><span class="pjh-ui"><span class="material-symbols-outlined">add_reaction</span></span>를 누르면 이모티콘 창이 열립니다. 종류별 탭으로 넘기거나 <b>검색</b>(예: 축하, 감사, 완료)으로 찾고, 누르면 커서 자리에 들어갑니다. 자주 쓴 이모티콘은 맨 위에 모입니다. 작업 팝업 아래 댓글 입력칸에도 같은 버튼이 있습니다.</li>
<li>웹 주소를 붙여 넣으면 링크가 되고, 누르면 새 탭에서 열립니다.</li>
<li>아직 읽지 않은 새 댓글이 있으면 말풍선이 깜빡이고 숫자가 빨간색으로 바뀝니다.</li>
</ul>
<h3>반응 · 답글 · 완료 표시 (아사나식)</h3>
<ul>
<li><b>반응</b> — 댓글에 마우스를 올리면 오른쪽 위에 👍 👀 🙌 ✅ 와 <span class="pjh-ui"><span class="material-symbols-outlined">add_reaction</span></span>가 뜹니다. 누르면 댓글 아래에 반응이 붙고(누른 사람 수), 내가 누른 반응은 파랗게 보입니다. 다시 누르면 취소됩니다. 반응에 마우스를 올리면 누가 눌렀는지 보입니다.</li>
<li><b>답글</b> — 같은 도구 모음의 <span class="pjh-ui"><span class="material-symbols-outlined">reply</span></span>. 작업 창에서는 원 댓글 아래 들여쓰기로 달리고, 댓글 대화창에서는 입력칸 위에 “OO 님에게 답글”이 뜬 뒤 보내면 말풍선 위에 원 댓글이 인용됩니다. 원 댓글을 지우면 답글도 함께 지워집니다.</li>
<li><b>작업 완료</b> — 작업을 완료하면 댓글 사이에 <span class="pjh-ui">✔ OO 님이 이 작업을 완료했습니다</span> 줄이 자동으로 생깁니다(댓글 수에는 세지 않습니다).</li>
<li><b>@태그 표시</b> — 댓글 속 <kbd>@아이디</kbd>는 프로필 아이콘 + 이름 칩으로 보입니다.</li>
</ul>
<h3>@태그로 동료 부르기</h3>
<ol class="pjh-steps">
<li>설명이나 댓글에서 <kbd>@</kbd>를 누릅니다.</li>
@@ -414,7 +425,7 @@
<h3>수신함 화면</h3>
<ul>
<li><b>나를 태그한 작업</b> — 누가 나를 @태그했는지와 함께 보입니다. <span class="pjh-ui">태그 모두 확인</span>으로 한 번에 확인 처리합니다.</li>
<li><b>알림</b> — 작업 배정 · 작업 완료 · 새 댓글 · 마감 알림이 쌓입니다. 항목을 누르면 읽음이 되고, <span class="pjh-ui">이동</span>을 누르면 그 작업으로 갑니다.</li>
<li><b>알림</b> — 작업 배정 · 작업 완료 · 새 댓글 · 마감 알림이 쌓입니다. 항목을 누르면 읽음이 되고, <span class="pjh-ui">확인</span>을 누르면 수신함에 머문 채 <b>오른쪽에 그 작업 창</b>이 열립니다(나를 태그한 작업도 같음). 창을 닫으면(→| 또는 <kbd>Esc</kbd>) 다시 수신함입니다. <kbd>Ctrl</kbd>+클릭하면 새 탭에서 프로젝트 화면으로 엽니다.</li>
<li><span class="pjh-ui">알림 모두 읽음</span>으로 한 번에 읽음 처리합니다. 읽지 않은 알림에서 우클릭 → <span class="pjh-ui">읽음으로 표시</span>도 됩니다.</li>
</ul>
<h3>어떤 알림이 누구에게 가나요?</h3>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260926v" />
<link rel="stylesheet" href="/static/project.css?v=20260928c" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -25,8 +25,8 @@
<div class="pj-view pj-inbox-pane">
<!-- 아사나 Inbox 처럼 "나를 태그(@)한 업무"를 맨 위에 리스트로 보여준다.
업무를 누르면 그 프로젝트 화면이 열리면서 업무 편집 팝업이 뜬다
(?task= 파라미터 — project.js 가 처리). -->
"확인"을 누르면 수신함에 머문 채 오른쪽에 그 작업 창이 열린다
(프로젝트 화면을 ?task=&embed=1 로 iframe 에 — project.js initInboxTaskPanel). -->
<div class="pj-inbox-section">
<h3 class="pj-inbox-h3">
나를 태그한 작업
@@ -50,7 +50,8 @@
{% if t.mention_actor %} · {% set nm = t.mention_actor.split('@')[0] %}{{ nm[:1]|upper }}{{ nm[1:] }}님이 태그{% endif %}
</div>
</div>
<a class="pj-btn pj-inbox-go" href="/project/p/{{ t.project_id }}?task={{ t.id }}">열기</a>
<a class="pj-btn pj-inbox-go" href="/project/p/{{ t.project_id }}?task={{ t.id }}"
data-task-id="{{ t.id }}">확인</a>
</li>
{% endfor %}
</ul>
@@ -85,8 +86,10 @@
</div>
</div>
{% if n.project_id %}
{# 작업 알림은 "확인" → 수신함에 머문 채 오른쪽에 작업 창(project.js initInboxTaskPanel) #}
<a class="pj-btn pj-inbox-go"
href="/project/p/{{ n.project_id }}{% if n.task_id %}?task={{ n.task_id }}{% endif %}">이동</a>
href="/project/p/{{ n.project_id }}{% if n.task_id %}?task={{ n.task_id }}{% endif %}"
{% if n.task_id %}data-task-id="{{ n.task_id }}"{% endif %}>확인</a>
{% endif %}
</li>
{% endfor %}
@@ -101,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260926v" defer></script>
<script src="/static/project.js?v=20260928c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260926v" />
<link rel="stylesheet" href="/static/project.css?v=20260928c" />
<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=20260926v" defer></script>
<script src="/static/project.js?v=20260928c" defer></script>
{% endblock %}
@@ -1,11 +1,17 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260926v" />
<link rel="stylesheet" href="/static/project.css?v=20260928c" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
<link href="/static/vendor/vis-timeline/vis-timeline-graph2d.min.css" rel="stylesheet" />
<!-- ?embed=1 — 수신함 오른쪽 패널(iframe) 안에서 작업 창만 보이는 모드. 첫 페인트 전에 표시. -->
<script>
if (new URLSearchParams(location.search).get("embed") === "1" && window.parent !== window) {
document.documentElement.classList.add("pj-embed");
}
</script>
{% endblock %}
{% block topbar_actions %}
@@ -50,7 +56,7 @@
같은 마크업으로 다시 그린다. -->
<div class="pj-title-wrap">
<h1 class="pj-project-title">
<span class="pj-project-title-pill" style="--pj-color: {{ project.color or '#4573d2' }}">{% if project.icon %}<span class="material-symbols-outlined pj-pill-ic">{{ project.icon }}</span>{% endif %}{{ project.name }}</span>
<span class="pj-project-title-pill" style="--pj-color: {{ project.color or '#4573d2' }}">{% if project.icon %}<span class="material-symbols-outlined pj-pill-ic">{{ project.icon }}</span>{% endif %}<span class="pj-pill-name">{{ project.name }}</span></span>
</h1>
<div class="pj-title-members" id="pj-member-list">
{% for m in members %}
@@ -237,8 +243,8 @@
<button type="button" class="pj-btn pj-btn-complete" id="pj-toggle-complete" hidden>✓ 완료로 표시</button>
<button type="button" class="pj-btn pj-btn-danger" id="pj-delete-task" hidden>삭제</button>
<span style="flex:1"></span>
<button type="button" class="pj-btn" data-close>취소</button>
<button type="button" class="pj-btn pj-btn-primary" id="pj-save-task">저장</button>
<!-- 저장 버튼 없음 — 칸마다 바로 저장된다(실시간 저장). 상태만 작게 표시. -->
<span class="pj-autosave-state" id="pj-autosave-state" aria-live="polite"></span>
<!-- 패널 접기 — 아사나처럼 오른쪽 끝의 →| 아이콘으로도 닫을 수 있다. -->
<button type="button" class="pj-icon-btn pj-panel-collapse-btn" data-close title="패널 접기">
<span class="material-symbols-outlined">last_page</span>
@@ -252,7 +258,7 @@
<span class="material-symbols-outlined">subdirectory_arrow_left</span>
<span class="pj-t-parent-title" id="pj-t-parent-title"></span>
</button>
<input type="text" id="pj-t-title" class="pj-t-title-input" placeholder="작업 제목" />
<textarea id="pj-t-title" class="pj-t-title-input" rows="1" placeholder="작업 제목"></textarea>
<div class="pj-modal-body">
<div class="pj-modal-col-main">
@@ -473,5 +479,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260926v" defer></script>
<script src="/static/project.js?v=20260928c" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260926v" />
<link rel="stylesheet" href="/static/project.css?v=20260928c" />
<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=20260926v" defer></script>
<script src="/static/project.js?v=20260928c" defer></script>
{% endblock %}
+169 -2
View File
@@ -180,6 +180,12 @@
background: var(--pj-color, var(--pj-accent)); border-radius: 14px; padding: 8px 24px;
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 제목 바로 수정 — 마우스를 올리면 점선 테두리 + 글자 커서, 편집 중엔 흰 테두리 */
.pj-project-title-pill.is-editable { cursor: text; box-shadow: 0 0 0 2px transparent; transition: box-shadow .12s; }
.pj-project-title-pill.is-editable:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 0 0 4px var(--pj-color, var(--pj-accent)); }
.pj-project-title-pill.is-editing { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pj-color, var(--pj-accent)); text-overflow: clip; }
.pj-pill-name { outline: none; }
.pj-pill-name[contenteditable="true"] { display: inline-block; min-width: 2em; white-space: pre; }
/* 현재 활성 뷰(보드/리스트/달력/타임라인)가 pj-main 의 남은 세로 공간을
차지 — 뷰 하나만 자체 스크롤(다른 칸과 스크롤이 서로 안 얽히게). 보드는
내부에 pj-board 자체 스크롤 컨테이너가 따로 있어 여기선 넘침을 숨긴다. */
@@ -589,9 +595,11 @@
안에서 글자가 세로 가운데에 오도록 한다(한 줄짜리 input 표준 기법). */
.pj-t-title-input {
display: block; width: 100%; border: none !important; background: transparent !important;
height: 40px; line-height: 40px; font-size: 19px !important; font-weight: 700;
padding: 0 4px !important; margin: 4px 0 8px !important;
min-height: 40px; line-height: 1.4; font-size: 19px !important; font-weight: 700;
padding: 7px 4px !important; margin: 4px 0 8px !important;
color: var(--pj-ink); box-sizing: border-box;
/* textarea — 긴 제목은 다음 줄로(높이는 JS fitTitleHeight 가 맞춘다) */
resize: none; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere;
}
.pj-t-title-input:focus { outline: none; background: #f6f7f8 !important; border-radius: 8px; }
/* 하위 업무 팝업 — 제목 위 상위 업무 경로(아사나식). 누르면 상위 업무로 */
@@ -1507,6 +1515,150 @@ img.pj-person-ic { width: 22px; height: 22px; }
.pj-mention-opt .pj-avatar, .pj-mention-opt .pj-gicon { flex: 0 0 auto; }
.pj-mention-empty { padding: 8px; font-size: 12.5px; color: #9aa1a9; }
/* 댓글 이모티콘 — 입력칸 옆 버튼 + 선택 팝업(구글 챗 모양) */
.pj-emoji-btn {
display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
width: 34px; height: 34px; padding: 0; border: none; background: transparent;
border-radius: 8px; color: #5f6368; cursor: pointer;
}
.pj-emoji-btn:hover { background: #f1f2f4; }
.pj-emoji-btn .material-symbols-outlined { font-size: 20px; }
.pj-emoji-picker {
position: fixed; z-index: 1300; width: 352px; max-width: calc(100vw - 16px);
display: flex; flex-direction: column;
background: #fff; border: 1px solid #d8dce2; border-radius: 12px;
box-shadow: 0 8px 28px rgba(0,0,0,.18); overflow: hidden;
}
.pj-emoji-picker[hidden] { display: none; }
.pj-emoji-top { padding: 10px 10px 6px; }
.pj-emoji-search {
display: flex; align-items: center; gap: 6px; padding: 0 10px; height: 34px;
border: 1px solid #d8dce2; border-radius: 17px; background: #f6f7f9;
}
.pj-emoji-search .material-symbols-outlined { font-size: 18px; color: #6b7280; }
.pj-emoji-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 13px; font-family: inherit; }
.pj-emoji-tabs { display: flex; justify-content: space-between; padding: 0 6px 4px; border-bottom: 1px solid #eceef1; }
.pj-emoji-tabs button {
display: inline-flex; align-items: center; justify-content: center;
width: 32px; height: 32px; padding: 0; border: none; background: transparent;
border-radius: 8px; color: #5f6368; cursor: pointer;
}
.pj-emoji-tabs button:hover { background: #f1f2f4; color: #1e1f21; }
.pj-emoji-tabs .material-symbols-outlined { font-size: 20px; }
.pj-emoji-body { position: relative; height: 280px; overflow-y: auto; padding: 4px 8px 8px; }
.pj-emoji-sec { font-size: 12px; font-weight: 600; color: #4b5563; padding: 8px 4px 4px; }
.pj-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); }
.pj-emoji-opt {
height: 38px; padding: 0; border: none; background: transparent; border-radius: 8px; cursor: pointer;
font-size: 24px; line-height: 1;
font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.pj-emoji-opt:hover { background: #f1f2f4; }
.pj-emoji-empty { padding: 24px 8px; text-align: center; font-size: 12.5px; color: #9aa1a9; }
/* 수신함 오른쪽 패널 — 프로젝트 화면을 ?embed=1 로 iframe 에 띄우고 작업 창만 보인다 */
html.pj-embed .erp-sidebar, html.pj-embed .erp-topbar, html.pj-embed .pj-wrap { display: none !important; }
html.pj-embed #pj-modal-task { background: transparent; }
html.pj-embed #pj-modal-task .pj-task-modal-card {
width: 100% !important; max-width: none; min-width: 0; transform: none !important;
box-shadow: none; border-radius: 0; transition: none;
}
html.pj-embed .pj-task-panel-resizer { display: none; }
.pj-inbox-panel {
position: fixed; top: 0; right: 0; bottom: 0; z-index: 900;
width: min(640px, 92vw); background: #fff;
box-shadow: -8px 0 28px rgba(0,0,0,.14); border-left: 1px solid #e1e4e8;
transform: translateX(100%); transition: transform .22s ease;
}
.pj-inbox-panel.is-open { transform: translateX(0); }
.pj-inbox-panel iframe { display: block; width: 100%; height: 100%; border: 0; }
.pj-inbox-item.is-selected { border-color: var(--pj-accent, #4573d2); box-shadow: 0 0 0 1px var(--pj-accent, #4573d2) inset; }
/* 작업 창 실시간 저장 상태 — 저장 버튼 자리 */
.pj-autosave-state { font-size: 12px; color: #9aa1a9; margin-right: 4px; white-space: nowrap; }
.pj-autosave-state[data-state="saved"]::before { content: "✓ "; color: #2e9e5b; }
.pj-autosave-state[data-state="error"] { color: #d93025; }
/* ── 댓글: @태그 칩 · 반응 · 답글 · 완료 이력 (아사나식) ── */
.pj-mention-chip {
display: inline-flex; align-items: center; gap: 4px; vertical-align: -3px;
padding: 1px 7px 1px 2px; border-radius: 12px; background: #eceef1;
font-weight: 600; color: #1e1f21; white-space: nowrap; line-height: 18px;
}
.pj-mention-chip .pj-avatar { width: 16px; height: 16px; }
.pj-mention-chip .pj-gicon { font-size: 16px; width: 16px; height: 16px; color: #9aa1a9; }
.pj-chat-msg.mine .pj-mention-chip { background: rgba(0,0,0,.08); }
.pj-react-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; }
.pj-react-pill {
display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px;
border: 1px solid #e1e4e8; border-radius: 12px; background: #fff;
font-size: 12px; color: #4b5563; cursor: pointer;
}
.pj-react-pill:hover { border-color: #b9bfc7; }
.pj-react-pill.is-mine { background: #e8eefb; border-color: #9db4e6; color: #2f5bb7; font-weight: 600; }
.pj-react-emo { font-size: 14px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.pj-react-add {
display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px;
padding: 0; border: none; background: transparent; border-radius: 12px; color: #6b7280; cursor: pointer;
}
.pj-react-add:hover { background: #eceef1; }
.pj-react-add .material-symbols-outlined { font-size: 18px; }
/* 마우스를 올리면 댓글 오른쪽 위에 뜨는 도구 모음 */
.pj-comment-item, .pj-chat-bubble-wrap { position: relative; }
.pj-cmt-hoverbar {
position: absolute; top: -14px; right: 4px; z-index: 3;
display: none; align-items: center; gap: 1px; padding: 2px;
background: #fff; border: 1px solid #e1e4e8; border-radius: 9px;
box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.pj-comment-item:hover > .pj-cmt-hoverbar,
.pj-chat-bubble-wrap:hover > .pj-cmt-hoverbar { display: inline-flex; }
.pj-cmt-hoverbar button {
display: inline-flex; align-items: center; justify-content: center;
width: 28px; height: 26px; padding: 0; border: none; background: transparent; border-radius: 6px;
font-size: 15px; line-height: 1; color: #5f6368; cursor: pointer;
font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}
.pj-cmt-hoverbar button:hover { background: #f1f2f4; }
.pj-cmt-hoverbar .material-symbols-outlined { font-size: 18px; }
.pj-chat-msg.other .pj-cmt-hoverbar { right: auto; left: calc(100% - 40px); }
.pj-comment-thread { border-top: 1px solid #f0f1f3; padding-top: 2px; }
.pj-comment-thread:first-child { border-top: none; }
.pj-comment-replies { margin-left: 30px; }
.pj-comment-item.is-reply { padding-top: 5px; padding-bottom: 5px; }
.pj-reply-form { margin: 4px 0 8px; }
.pj-reply-form input { padding: 5px 9px; font-size: 12.5px; }
.pj-reply-form .pj-btn { padding: 5px 12px; font-size: 12px; }
.pj-comment-event, .pj-chat-event {
display: flex; align-items: center; gap: 8px; padding: 8px 2px;
font-size: 12.5px; color: #2e7d4f; border-top: 1px solid #f0f1f3;
}
.pj-comment-event b, .pj-chat-event b { font-weight: 700; }
.pj-cmt-event-ic { font-size: 20px; color: #2e9e5b; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.pj-chat-event { align-self: center; border: none; padding: 3px 12px; background: #fff; border-radius: 14px; font-size: 12px; }
.pj-chat-event .pj-cmt-event-ic { font-size: 16px; }
.pj-chat-quote {
display: flex; align-items: center; gap: 3px; max-width: 100%;
margin-bottom: 3px; padding: 2px 8px; border-left: 3px solid #b9bfc7; border-radius: 4px;
background: rgba(255,255,255,.6); font-size: 11.5px; color: #6b7280;
overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.pj-chat-quote .material-symbols-outlined { font-size: 14px; }
.pj-chat-list > li:first-child { margin-top: 12px; } /* 첫 말풍선의 도구 모음이 잘리지 않게 */
.pj-chat-quote b { color: #4b5563; margin-right: 3px; }
.pj-chat-replying {
display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 5px 8px;
background: #f1f4fa; border-radius: 8px; font-size: 12px; color: #4b5563;
}
.pj-chat-replying[hidden] { display: none; }
.pj-chat-replying > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pj-chat-replying .material-symbols-outlined { font-size: 16px; }
/* 설명란 링크 — 클릭하면 새 탭으로 열린다(JS 가 처리). */
.pj-desc-editor a { color: var(--pj-accent-dark, #2f5bb7); text-decoration: underline; cursor: pointer; }
@@ -1686,3 +1838,18 @@ img.pj-person-ic { width: 22px; height: 22px; }
}
.pj-help-btn .material-symbols-outlined { font-size: 22px; }
.pj-help-btn:hover { background: var(--pj-accent-tint); border-color: var(--pj-accent); color: var(--pj-accent); }
/* ── 화면 배율(고해상도) 토글 — _help_btn.html 의 버튼이 html.pj-ui-scale 을 켠다.
2880×1620·200% 는 CSS 화면 폭이 1440px 이라 1920 기준 화면이 꽉 차 보인다 → 앱 전체를
0.75(=1440/1920)로 줄인다. zoom 안에서 vh·vw 도 같이 줄어들어 화면 높이만큼 쓰는 곳은
배율로 나눠 되돌린다. 팝업(메뉴·말풍선·이모티콘 창 등)은 body 에 붙어 배율 밖이라
원래 크기로 뜬다. (project.js UI_ZOOM 과 같은 값) */
.pj-ui-scale-btn.is-on { background: var(--pj-accent); border-color: var(--pj-accent); color: #fff; }
html.pj-ui-scale { --pj-z: 0.75; }
html.pj-ui-scale .erp-app { zoom: var(--pj-z); height: calc(100vh / var(--pj-z)); }
html.pj-ui-scale .erp-sidebar,
html.pj-ui-scale .erp-content { height: calc(100vh / var(--pj-z)); }
html.pj-ui-scale .pj-task-modal-card { height: calc(100vh / var(--pj-z)); max-height: calc(100vh / var(--pj-z)); max-width: calc(50vw / var(--pj-z)); }
html.pj-ui-scale .pj-modal-card { max-height: calc(90vh / var(--pj-z)); }
html.pj-ui-scale .pj-mt-list { max-height: calc(50vh / var(--pj-z)); }
html.pj-ui-scale .pj-modal-chat { max-height: calc(92vh / var(--pj-z)); }
+835 -105
View File
File diff suppressed because it is too large Load Diff
+42 -2
View File
@@ -234,6 +234,8 @@ docker exec -i postgres-db psql -U postgres -d project_db \
< scripts/sql/project_db_010_trash.sql
docker exec -i postgres-db psql -U postgres -d project_db \
< scripts/sql/project_db_011_project_icon.sql
docker exec -i postgres-db psql -U postgres -d project_db \
< scripts/sql/project_db_012_comment_replies_reactions.sql
# 4) 재배포 (git pull 후 반드시 --build)
cd /opt/www/main && docker compose up -d --build web
@@ -284,8 +286,8 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
## 6. 댓글 · 첨부 · 수신함 · 섹션 편집 (구현됨)
- **댓글** `task_comments` — 작업 모달 하단. 등록/삭제(본인·관리자). 새 댓글 시 관련자 인앱 알림.
- **작업 편집 팝업** — 버튼 줄(공유·완료·삭제·취소·저장)은 **팝업 맨 위에 고정**
(`.pj-modal-actions-top`) — 카드가 flex column 이고 `.pj-modal-body` 만 스크롤하므로 sticky 없이 고정된다(sticky 는 카드 padding 안쪽에 붙어 바가 밀려 내려오고 제목을 덮었다). 설명/하위 작업이 길어도 스크롤 없이 저장·취소한다.
- **작업 편집 팝업** — 버튼 줄(공유·완료·삭제·저장 상태·패널 접기)은 **팝업 맨 위에 고정**
(`.pj-modal-actions-top`) — 카드가 flex column 이고 `.pj-modal-body` 만 스크롤하므로 sticky 없이 고정된다(sticky 는 카드 padding 안쪽에 붙어 바가 밀려 내려오고 제목을 덮었다). 저장 버튼은 없다 — 실시간 저장(§6-6).
그 아래 메타(담당자·섹션·우선순위·마감일 한 줄 — 마감일은 캘린더 아이콘 버튼, 좁으면 2×2 | 협업자), 다시 그 아래 **설명란**과
**하위 작업**가 각각 팝업 너비 전체를 쓰는 별도 행(`.pj-desc-block` / `.pj-subtask-full`,
그리드 `1 / -1`). 하위 작업은 제목 왼쪽 체크박스로 완료를 토글하고, 완료된 줄은
@@ -382,6 +384,44 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
- 010 미적용이면 휴지통 없이 예전처럼 영구 삭제(휴지통 화면에 안내).
- 프로젝트 삭제(작업 전체 CASCADE)와 댓글 삭제는 아직 휴지통 대상이 아니다.
## 6-6. 작업 창 실시간 저장 · 제목 줄바꿈 · 프로젝트 제목 바로 수정
- **저장 버튼 없음**(아사나식). 칸마다 바로 `PUT /api/tasks/{id}` 로 **그 필드만** 보낸다(`saveField`) —
제목: blur/Enter(빈 값이면 되돌림) · 설명: 입력 멈춤 1.2초·blur(이미지 업로드 중이면 미룸) ·
담당자/섹션/우선순위/마감일: change 즉시. 요청은 `saveChain` 한 줄로 순서 보장, 보낼 값·id 는 부르는
순간 잡으므로 저장 중 다른 작업을 열어도 안전. 닫기·다른 작업 열기 직전 `flushAutoSave`. 버튼 줄에
"저장 중… / ✓ 저장됨 / 저장 실패" 표시(`#pj-autosave-state`).
- **새 작업**은 제목이 처음 생기는 순간 지금 칸 값으로 `POST` → 기존 작업 화면(댓글·첨부·하위 작업)으로
바꿔 연다. 그 사이 더 친 제목·설명은 이어서 저장. 제목 없이 닫으면 만들지 않는다.
- 섹션을 옮기면 서버가 기본 담당자를 넣거나 완료 처리할 수 있어 응답으로 담당자 칸·완료 버튼을 다시 맞춘다.
- 작업 제목칸은 `textarea`(자동 높이, `fitTitleHeight`) — 긴 제목은 다음 줄로. Enter·붙여넣은 줄바꿈은 막는다.
- 프로젝트 화면 제목 알약(`.pj-pill-name`)은 마우스 올림 → 테두리, 클릭 → contenteditable 로 이름 수정
(`PUT /api/projects/{id}` `{name}`, Enter/blur 저장·Esc 취소). `can_manage` 인 사람만.
## 6-7. 댓글 답글 · 이모티콘 반응 · 완료 이력 · @칩 (마이그레이션 012)
- `task_comments.parent_id`(답글, 한 단계 — 답글의 답글도 원 댓글에 붙음, 원 댓글 삭제 시 CASCADE) +
`task_comment_reactions`(comment_id·user_email·emoji PK, `task_id` 는 휴지통 스냅샷용 —
`TRASH_CHILD_TABLES` 에 포함). 012 트리거로 반응도 live-version 을 올린다.
- API: `GET /api/tasks/{id}/comments` → `{comments(+reactions), events, features}` —
`events` 는 `project_activity` 의 완료(`completed`) 이력(댓글 수에는 안 셈), `features` 는 012 적용 여부.
`POST /api/tasks/{id}/comments` 에 `parent_id`. `POST /api/comments/{id}/reactions` `{emoji}` = 켜기/끄기 토글.
- 화면: 작업 창 댓글은 시간순(댓글 + "OO 님이 이 작업을 완료했습니다" 줄), 답글은 원 댓글 아래 들여쓰기 +
답글 입력칸. 마우스 올림 도구 모음(👍 👀 🙌 ✅ · 반응 추가(이모티콘 창) · 답글 · 수정 · 삭제).
댓글 대화창은 말풍선 위 인용으로 답글 표시, 입력칸 위 "OO 님에게 답글" 줄.
본문의 `@아이디` 는 사용자 목록(`/api/all-users`)과 맞으면 아이콘+이름 칩(`commentBodyHtml`).
- 012 미적용이면 답글·반응 버튼이 숨겨지고, API 는 503 "마이그레이션 012 필요". 완료 이력·@칩은 012 없이도 동작.
## 6-8. 수신함 오른쪽 작업 창 · 화면 배율
- 수신함의 "확인"(예전 "이동"/"열기")은 페이지를 떠나지 않고 오른쪽 패널(`.pj-inbox-panel`)에 작업 창만 띄운다.
프로젝트 화면을 `?task={id}&embed=1` 로 iframe 에 열고, `html.pj-embed` 가 작업 창 외에는 숨긴다.
작업 창을 닫으면 iframe 이 `postMessage({type:"pj-embed-close"})` → 패널 닫힘. Ctrl+클릭은 새 탭(예전처럼 이동).
- 화면 배율 토글(상단 바 `fit_screen`, `_help_btn.html`) — `html.pj-ui-scale` 이면 `.erp-app` 에 `zoom: .75`
(2880×1620·200% = CSS 폭 1440px 에서 1920 기준 화면처럼). zoom 안에서 줄어드는 `vh` 높이는 배율로 나눠
되돌린다. 팝업은 전부 `body` 에 붙어 배율 밖이라 좌표 보정 불필요(전체 검색 결과창도 body 로 옮김),
배율 안에서 마우스 거리로 크기를 바꾸는 작업 창 너비 조절만 `uiZoom()` 으로 나눈다. localStorage `pj_ui_scale`.
## 7. 추후 단계
작업 라벨(태그 분류) · 반복 작업 · 템플릿 · 작업 의존성 · 하위 작업의 하위 작업(다단계 중첩,
@@ -0,0 +1,50 @@
-- =====================================================================
-- project_db 마이그레이션 012 — 댓글 답글 + 이모티콘 반응(아사나식)
-- =====================================================================
-- 멱등(idempotent). DROP/TRUNCATE 없음.
--
-- task_comments.parent_id 답글이면 원 댓글 id(한 단계만 — 답글의 답글도 원 댓글에 붙는다).
-- 원 댓글을 지우면 답글도 CASCADE 로 같이 지워진다.
-- task_comment_reactions 댓글 1개 × 사람 1명 × 이모티콘 1개 = 1행(누르면 추가, 다시 누르면 삭제).
-- task_id 는 휴지통 스냅샷(TRASH_CHILD_TABLES)이 task_id 로 묶기 때문.
--
-- 미적용이어도 앱은 동작한다 — 답글/반응 버튼만 숨겨지고, 누르면 "마이그레이션 012 필요" 안내.
--
-- 적용 (1회, 여러 번 돌려도 안전):
-- docker exec -i postgres-db psql -U postgres -d project_db \
-- < scripts/sql/project_db_012_comment_replies_reactions.sql
-- =====================================================================
\set ON_ERROR_STOP on
\connect project_db
ALTER TABLE task_comments
ADD COLUMN IF NOT EXISTS parent_id BIGINT REFERENCES task_comments(id) ON DELETE CASCADE;
CREATE INDEX IF NOT EXISTS idx_task_comments_parent ON task_comments (parent_id);
COMMENT ON COLUMN task_comments.parent_id IS '답글이면 원 댓글 id (한 단계). NULL = 일반 댓글';
CREATE TABLE IF NOT EXISTS task_comment_reactions (
comment_id BIGINT NOT NULL REFERENCES task_comments(id) ON DELETE CASCADE,
task_id BIGINT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
user_email TEXT NOT NULL,
emoji TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
PRIMARY KEY (comment_id, user_email, emoji)
);
CREATE INDEX IF NOT EXISTS idx_task_comment_reactions_task ON task_comment_reactions (task_id);
-- 실시간 반영(007) — 반응도 다른 사람 화면에 바로 보이게 버전 카운터를 올린다.
DO $$
BEGIN
IF to_regproc('project_bump_live_version') IS NOT NULL THEN
EXECUTE 'DROP TRIGGER IF EXISTS trg_task_comment_reactions_live_version ON task_comment_reactions';
EXECUTE 'CREATE TRIGGER trg_task_comment_reactions_live_version '
'AFTER INSERT OR UPDATE OR DELETE ON task_comment_reactions '
'FOR EACH STATEMENT EXECUTE FUNCTION project_bump_live_version()';
END IF;
END $$;
GRANT SELECT, INSERT, UPDATE, DELETE ON task_comment_reactions TO project_app;
SELECT 'project_db 012 comment replies/reactions ready' AS status;