From 6bbdf4311d5d38b848c11a9bb18f1f7d9309e2af Mon Sep 17 00:00:00 2001 From: theorose49 Date: Tue, 30 Jun 2026 12:54:14 +0900 Subject: [PATCH] =?UTF-8?q?feat(mail):=20=EB=A9=94=EB=AA=A8=EB=A5=BC=20?= =?UTF-8?q?=EB=A9=94=EC=9D=BC=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=EC=9D=98=20?= =?UTF-8?q?=EB=8F=85=EB=A6=BD=20=EC=97=B4=EB=A1=9C(=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EC=A0=84=EC=97=90=EB=8F=84=20=EB=B3=B4=EC=9E=84=C2=B7=EC=9D=B8?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=ED=8E=B8=EC=A7=91)=20+=20=EC=88=98?= =?UTF-8?q?=EC=8B=A0=EC=9E=90=20=EC=9A=94=EC=95=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 각 메일 행 우측에 '메모 열' 상시 표시, 바로 요약 메모 입력(blur 저장)·마지막 수정자 표시 - 보낸이→받는이 표시에서 수신자 많으면 '외 N명'으로 축약, hover(title)로 전체 노출 - 펼침 상세에 전체 받는사람/참조/시각/메일함 Co-Authored-By: Claude Opus 4.8 (1M context) --- src/pages/ProjectDetail.tsx | 95 ++++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/src/pages/ProjectDetail.tsx b/src/pages/ProjectDetail.tsx index 6e33db8..22a9233 100644 --- a/src/pages/ProjectDetail.tsx +++ b/src/pages/ProjectDetail.tsx @@ -540,6 +540,23 @@ function MailTab({ projectId }: { projectId: string }) { ); } +// "Name " 또는 "a@b" → 표시용 짧은 이름(이름 또는 @앞) +function addrName(a: string): string { + a = a.trim(); + const m = a.match(/^"?([^"<]+?)"?\s*<[^>]*>$/); + if (m) return m[1].trim(); + const at = a.indexOf("@"); + return at > 0 ? a.slice(0, at) : a; +} +// 수신자(받는사람+참조)가 많으면 "둘 + 외 N명"으로 줄이고, 전체는 title(hover)로. +function recipientSummary(to: string, cc: string) { + const parts = `${to},${cc}`.split(",").map((s) => s.trim()).filter(Boolean); + const names = parts.map(addrName); + const full = parts.join(", "); + const short = names.length <= 2 ? names.join(", ") : `${names.slice(0, 2).join(", ")} 외 ${names.length - 2}명`; + return { short: short || "—", full: full || "—" }; +} + function MailRow({ projectId, mail, nameOf }: { projectId: string; mail: ProjectMail; nameOf: (e?: string | null) => string }) { const qc = useQueryClient(); const [open, setOpen] = useState(false); @@ -549,52 +566,56 @@ function MailRow({ projectId, mail, nameOf }: { projectId: string; mail: Project const save = useMutation({ mutationFn: () => putMailNote(projectId, mail.messageId, memo), onSuccess: invalidate }); const hide = useMutation({ mutationFn: () => hideMail(projectId, mail.messageId, !mail.hidden), onSuccess: invalidate }); const when = mail.ts ? formatDateTime(new Date(mail.ts).toISOString()) : mail.date; + const rcpt = recipientSummary(mail.to, mail.cc); return ( -
- - -
- {when} - + +
+ {when} + +
+
+ {/* 메모 열 — 클릭 전에도 항상 보이고 바로 요약을 적을 수 있다 */} +
+