feat(project): 보드 가로 스크롤 · 카드 인라인 편집 · 내 업무 사이드 메뉴 · @태그

- 보드: 매이슨리 절대배치 제거 → 아사나식 flex 가로 배치. 세션이 늘어나면
  아래로 접히지 않고 계속 오른쪽으로 이어지고, 보드가 가로로 스크롤된다
  (막대는 attachHScrollIndicator 가 직접 그린다). 긴 세션은 컬럼 안에서 세로 스크롤.
- 카드: 담당자/마감일을 클릭하면 팝업을 열지 않고 그 자리에서 바꾼다.
  값이 없는 칩은 카드 호버 시 흐리게 나타나 바로 지정할 수 있다.
- 내 업무: 화면 오른쪽 상시 패널을 없애고 좌측 사이드바의 접이식 메뉴로 이전
  (기본 접힘, 업무를 고르면 팝업이 열리며 다시 접힘). 레이아웃 3열 → 2열.
- 설명란: 웹주소를 붙여넣으면 자동 링크(target=_blank), 클릭하면 새 탭으로 연다.
  contenteditable 은 브라우저가 링크를 기본으로 열지 않아 클릭을 직접 받는다.
- @태그: 설명란·댓글에서 @ 로 멤버를 고른다. 설명란은 멘션 칩(data-email),
  댓글은 화면이 고른 이메일을 함께 전송. 서버는 설명란의 경우 저장될 HTML 에서
  직접 이메일을 뽑는다(화면이 보낸 목록을 믿지 않는다).
  태그된 사람은 수신함(/project/inbox)에서 그 업무를 리스트로 본다.

DB: 마이그레이션 006(task_mentions) 신규 — 배포 시 적용 필요.
    미적용 환경에서도 화면이 죽지 않게 멘션 조회/기록은 모두 감쌌다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-22 11:04:21 +09:00
parent 79aa16bf49
commit fac8d5a0b1
11 changed files with 1152 additions and 166 deletions
+86 -1
View File
@@ -922,6 +922,90 @@ class ProjectStore:
)
return cur.rowcount or 0
# ════════════════════════════════════════════════════════════
# 멘션(@태그) — task_mentions
#
# 설명란/댓글에서 @로 지정된 사람. 수신함의 "나를 태그한 업무" 목록이
# 이걸 읽는다. 같은 자리(설명란=comment_id NULL, 또는 같은 댓글)에서 같은
# 사람을 두 번 저장하지 않는다(마이그레이션 006 의 UNIQUE 인덱스).
# ════════════════════════════════════════════════════════════
def add_mentions(
self, *, task_id: int, emails: list[str], actor_email: str = "",
comment_id: int | None = None, source: str = "description",
) -> list[str]:
"""멘션을 기록하고 '이번에 새로 추가된' 이메일만 돌려준다(알림 대상)."""
actor = store.norm_str(actor_email, lower=True)
targets = [e for e in store.normalize_emails(emails) if e != actor]
if not targets:
return []
added: list[str] = []
with self._pool.connection() as conn:
for email in targets:
cur = conn.execute(
"INSERT INTO task_mentions "
"(task_id, comment_id, mentioned_email, actor_email, source) "
"VALUES (%s,%s,%s,%s,%s) ON CONFLICT DO NOTHING",
(task_id, comment_id, email, actor, source),
)
if cur.rowcount:
added.append(email)
return added
def list_mentioned_tasks(
self, *, mentioned_email: str, limit: int = 100
) -> list[dict[str, Any]]:
"""내가 태그된 업무 목록(업무 1건당 1행, 가장 최근 태그 기준 정렬)."""
email = store.norm_str(mentioned_email, lower=True)
with self._pool.connection() as conn:
rows = conn.execute(
"""
SELECT t.*, p.name AS project_name, p.color AS project_color,
s.name AS stage_name,
m.last_at AS mentioned_at,
m.unread AS unread_mentions,
m.last_actor AS mention_actor
FROM (
SELECT task_id,
MAX(created_at) AS last_at,
COUNT(*) FILTER (WHERE NOT is_read) AS unread,
(ARRAY_AGG(actor_email ORDER BY created_at DESC))[1] AS last_actor
FROM task_mentions
WHERE mentioned_email = %s
GROUP BY task_id
) m
JOIN tasks t ON t.id = m.task_id
JOIN projects p ON p.id = t.project_id
LEFT JOIN project_stages s ON s.id = t.stage_id
ORDER BY m.last_at DESC
LIMIT %s
""",
(email, int(limit)),
).fetchall()
return [self._serialize(r) for r in rows]
def count_unread_mentions(self, *, mentioned_email: str) -> int:
with self._pool.connection() as conn:
row = conn.execute(
"SELECT COUNT(*) AS n FROM task_mentions "
"WHERE mentioned_email = %s AND is_read = FALSE",
(store.norm_str(mentioned_email, lower=True),),
).fetchone()
return int(row["n"] or 0)
def mark_mentions_read(
self, *, mentioned_email: str, task_id: int | None = None
) -> int:
clause = "WHERE mentioned_email = %s AND is_read = FALSE"
params: list[Any] = [store.norm_str(mentioned_email, lower=True)]
if task_id is not None:
clause += " AND task_id = %s"
params.append(task_id)
with self._pool.connection() as conn:
cur = conn.execute(
f"UPDATE task_mentions SET is_read = TRUE {clause}", params
)
return cur.rowcount or 0
# ════════════════════════════════════════════════════════════
# 실시간 새로고침 — 프로젝트/업무/댓글/멤버/단계 중 가장 최근 변경 시각
# ════════════════════════════════════════════════════════════
@@ -933,7 +1017,8 @@ class ProjectStore:
" COALESCE((SELECT MAX(updated_at) FROM tasks), 'epoch'::timestamptz),"
" COALESCE((SELECT MAX(created_at) FROM task_comments), 'epoch'::timestamptz),"
" COALESCE((SELECT MAX(created_at) FROM project_members), 'epoch'::timestamptz),"
" COALESCE((SELECT MAX(created_at) FROM project_stages), 'epoch'::timestamptz)"
" COALESCE((SELECT MAX(created_at) FROM project_stages), 'epoch'::timestamptz),"
" COALESCE((SELECT MAX(created_at) FROM task_mentions), 'epoch'::timestamptz)"
") AS ts"
).fetchone()
ts = row["ts"] if row else None