feat(안내문 발송): DM 수동 보내기 + 설정 톱니 아이콘

- [+ 리스트 추가] 오른쪽 [DM 수동 보내기]: 이름 붙여 넣기·.txt/.csv → 왼쪽 이름 목록,
  누르면 오른쪽 DM 문구 {이름} 이 그 이름으로 바뀌고 클립보드 복사 + 짧은 안내
  (문구 = 설정 DM 문구, 리스트에 저장 안 함)
- 설정 버튼 → 맨 오른쪽 톱니 아이콘(공용 material-symbols)
- 공용 .erp-card display:flex 가 hidden 을 덮어 [리스트 추가] 창이 늘 열려 있던 것 고침
- outreach.js/css 캐시 버전 20261030a, 브라우저 테스트 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-30 16:28:48 +09:00
parent c13f529721
commit 3a43f699f5
8 changed files with 146 additions and 9 deletions
+26
View File
@@ -120,6 +120,32 @@ function check(name, cond, extra) {
await p.waitForTimeout(200);
const sendCall = calls.find(function (c) { return c.url === "/outreach/api/send"; });
check("고른 메일 보내기 → 메일·대기 줄만 보냄", !!sendCall && JSON.stringify(sendCall.body.ids) === "[1,3]", sendCall);
// 설정 = 맨 오른쪽 톱니 아이콘(2026-10-30)
const gear = await p.evaluate(function () {
const g = document.querySelector(".otr-gear"), top = document.querySelector(".otr-top").getBoundingClientRect(), r = g.getBoundingClientRect();
return { href: g.getAttribute("href"), icon: g.textContent.trim(), right: Math.round(top.right - r.right),
font: getComputedStyle(g.querySelector(".material-symbols-outlined")).fontFamily };
});
check("설정 = 맨 오른쪽 톱니(글자 대신 아이콘)", gear.href === "/outreach/settings" && gear.icon === "settings" && gear.right <= 2 &&
/Material Symbols/.test(gear.font), gear);
// DM 수동 보내기 — 이름 넣기 → 왼쪽 목록, 이름 누르면 오른쪽 문구 {이름} 바뀌고 복사 + 짧은 안내
await p.click("#otr-dm-open");
await p.fill("#otr-dm-text", "이름\n김민지\t메모\n\n박서준, x\n김민지");
await p.click("#otr-dm-load");
const names = await p.$$eval("#otr-dm-names .otr-dm-name", function (els) { return els.map(function (e) { return e.textContent; }); });
check("DM 수동 — 이름 목록(첫 칸, 머리글·빈 줄·같은 이름 뺌)", JSON.stringify(names) === '["김민지","박서준"]', names);
await p.click('#otr-dm-names .otr-dm-name[data-i="1"]');
await p.waitForTimeout(100);
const dm = await p.evaluate(async function () {
const t = document.getElementById("otr-toast");
return { body: document.getElementById("otr-dm-body").textContent, clip: navigator.clipboard ? await navigator.clipboard.readText() : (window.__copied || ""),
toast: t && !t.hidden ? t.textContent : "", active: document.querySelector(".otr-dm-name.is-active").textContent };
});
check("이름 누르면 오른쪽 문구 = 그 이름, 클립보드 복사, 안내", dm.active === "박서준" && dm.body.includes("박서준") && !dm.body.includes("{이름}") &&
dm.clip === dm.body && /박서준 님 문구를 클립보드에 복사/.test(dm.toast), dm);
await p.waitForTimeout(1800);
check("안내는 잠깐 뒤 사라짐", await p.evaluate(function () { return document.getElementById("otr-toast").hidden; }));
await p.click("#otr-dm-close");
// 리스트 추가 — 미리보기(판별) → 추가
await p.click("#otr-add-open");
await p.fill("#otr-add-text", "new@x.com 새사람\n@hong 홍\n홍길동");
+1
View File
@@ -36,6 +36,7 @@ def main() -> None:
ctx = {"user": {"email": "me@miras.co.kr", "name": "나", "picture": ""}, "is_admin": False, "nav_items": [],
"page_title": "안내문 발송", "page_subtitle": "", "template": t, "body_text": store.html_to_text(t["body"]),
"needs_name": store.needs_name(t), "images": [], "rows": [_view(r, t) for r in raw],
"dm_template": store.dm_text(t, store.NAME_TAG),
"logs": [], "gmail": {"available": True, "connected": True, "email": "me@miras.co.kr"}, "msg": ""}
with open(os.path.join(OUT_DIR, "outreach.html"), "w", encoding="utf-8") as f:
f.write(env.get_template("outreach/index.html").render(**ctx))