From 359ff29e95001769ac43773ec4c09cdced87d55f Mon Sep 17 00:00:00 2001 From: king Date: Fri, 6 Nov 2026 19:58:18 +0900 Subject: [PATCH] =?UTF-8?q?feat(=EC=8B=A4=EC=A0=81):=20=EC=97=B4=20?= =?UTF-8?q?=EC=A0=91=EA=B8=B0=20=EB=B2=84=ED=8A=BC=EC=97=90=20=EC=BB=A4?= =?UTF-8?q?=EC=84=9C=20=EB=94=B0=EB=9D=BC=EB=8B=A4=EB=8B=88=EB=8A=94=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=A7=90=ED=92=8D=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 버튼 위에 올리면 커서 바로 위에 쇼핑몰(열) 이름 — 글자 크기는 열 제목과 같은 12px 굵게. 머리글 th 의 기본 title 말풍선은 버튼 title="" 로 막음. Co-Authored-By: Claude Opus 5.5 --- app/modules/performance/CLAUDE.md | 1 + app/static/performance.css | 4 ++++ app/static/performance.js | 15 ++++++++++++++- tests/js/perf_colfold.browser.test.js | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/modules/performance/CLAUDE.md b/app/modules/performance/CLAUDE.md index 09e008d..88ae264 100644 --- a/app/modules/performance/CLAUDE.md +++ b/app/modules/performance/CLAUDE.md @@ -91,6 +91,7 @@ - **열 접기**(2026-11-06) — 매출 실적·광고비 일자별 표 머리글 위 작은 화살표 버튼(`.perf-cfold`, `performance.js initColFold`)으로 열 하나씩 접기/펴기(날짜 열 빼고, 일 합계·그룹 열 포함). 접은 열 = 26px 띠(`is-cfold`, 칸 내용 숨김·클릭/메모 안 됨, 너비는 JS `CFOLD_W` 와 CSS 같게, 수동 열 너비 표도 같음). **로그인한 사람 본인에게만** — `PUT /api/my-col-fold {kind: sales|ads, cols}` → `perf_settings` key `col_fold:<이메일 sha1>`(key 64자 제한) = `{sales, ads}`, 화면은 표 `data-col-fold`(라우터 `_load_col_fold`). 011 미적용이면 다 펼침·저장 503. + 버튼 위 말풍선 = 커서 바로 위를 따라다니는 `.perf-cfold-tip`(열 이름, 12px 굵게 = 제목 글자), 버튼 `title=""` 로 머리글 기본 말풍선 막음. 그룹 하위 열 접기(⊟, localStorage)와는 별개. 테스트 `tests/js/perf_colfold.browser.test.js`, `test_custom_groups.py::test_api_my_col_fold_per_user`. - **표 열 너비 자동/수동**(2026-10-27) — 설정 "보기 설정" **표 열 너비** [자동(글자 길이)]·[수동 조절](누구나, 이 브라우저 쿠키 `perf_colw`, `router._colw_ctx` → 템플릿 `colw`). 수동 = 매출 실적·광고비 일자별 표에 `perf-colw-manual` → `performance.js initColWidths` 가 자동 너비를 잰 뒤 `table-layout:fixed`(`is-colw-fixed`, 넘치는 글자 …), diff --git a/app/static/performance.css b/app/static/performance.css index 5bc366f..11d4bbe 100644 --- a/app/static/performance.css +++ b/app/static/performance.css @@ -535,3 +535,7 @@ body.perf-colw-dragging, body.perf-colw-dragging * { cursor: col-resize !importa .perf-main .is-cfold > :not(.perf-cfold) { display: none !important; } /* 보기 기준(총매출·차감) 표시 규칙보다 우선 */ .perf-main th.is-cfold .perf-cfold { pointer-events: auto; margin-top: 0; } @media (prefers-reduced-motion: reduce) { .perf-cfold svg { transition: none; } } +/* 열 접기 버튼 말풍선 — 커서 바로 위, 글자 = 열 제목 크기(12px 굵게) */ +.perf-cfold-tip { position: fixed; z-index: 2200; transform: translate(-50%, calc(-100% - 12px)); padding: 5px 9px; border-radius: 6px; + background: #222; color: #fff; font-size: 12px; font-weight: 700; line-height: 1.4; white-space: nowrap; pointer-events: none; + box-shadow: 0 4px 12px rgba(0, 0, 0, .18); } diff --git a/app/static/performance.js b/app/static/performance.js index 7185599..aad0396 100644 --- a/app/static/performance.js +++ b/app/static/performance.js @@ -362,14 +362,27 @@ const b = th.querySelector(".perf-cfold"); b.setAttribute("aria-expanded", fold ? "false" : "true"); b.setAttribute("aria-label", b.dataset.name + (fold ? " 열 펴기" : " 열 접기")); - b.title = fold ? b.dataset.name + " 열 펴기" : "열 접기"; } + // 버튼 위 말풍선(2026-11-06) — 커서 위를 따라다니며 쇼핑몰(열) 이름, 글자 크기 = 열 제목. 빈 title 로 머리글 th 의 기본 말풍선은 막는다 + let tip = null; + function hideTip() { if (tip) { tip.remove(); tip = null; } } + row.addEventListener("pointermove", function (e) { + const b = e.target.closest(".perf-cfold"); + if (!b || (tip && tip._b !== b)) hideTip(); + if (!b) return; + if (!tip) { tip = el("div", { class: "perf-cfold-tip", role: "tooltip", text: b.dataset.name }); tip._b = b; document.body.appendChild(tip); } + tip.style.left = e.clientX + "px"; + tip.style.top = e.clientY + "px"; + }); + row.addEventListener("pointerleave", hideTip); + window.addEventListener("scroll", hideTip, true); Array.prototype.forEach.call(row.cells, function (th) { const col = th.dataset.col; if (!col || col === "label") return; const b = document.createElement("button"); b.type = "button"; b.className = "perf-cfold"; + b.title = ""; b.dataset.name = th.textContent.replace(/[✎\s]+/g, " ").trim(); b.innerHTML = ICON; th.insertBefore(b, th.firstChild); diff --git a/tests/js/perf_colfold.browser.test.js b/tests/js/perf_colfold.browser.test.js index 6fde3c6..a339c90 100644 --- a/tests/js/perf_colfold.browser.test.js +++ b/tests/js/perf_colfold.browser.test.js @@ -57,6 +57,23 @@ function state(p, col) { }); const s0 = await state(p, col); check(tag + "날짜 열 빼고 열마다 버튼, 처음엔 펼침", s0.buttons === s0.heads - 1 && !s0.labelBtn && !s0.folded && s0.expanded === "true", s0); + // 말풍선 — 버튼 위에 올리면 커서 바로 위에 열 이름(제목 글자 크기 12px), 커서 따라 움직임, 머리글 기본 말풍선(title) 없음 + const bb = await p.locator('thead th[data-col="' + col + '"] .perf-cfold').boundingBox(); + await p.mouse.move(bb.x + 4, bb.y + bb.height / 2); + await p.mouse.move(bb.x + bb.width - 4, bb.y + bb.height / 2); + const tip = await p.evaluate(function (col) { + const t = document.querySelector(".perf-cfold-tip"), b = document.querySelector('thead th[data-col="' + col + '"] .perf-cfold'); + const head = document.querySelector('thead th[data-col="' + col + '"]'); + if (!t) return null; + const r = t.getBoundingClientRect(); + return { text: t.textContent, name: head.textContent.replace(/[✎\s]+/g, " ").trim(), size: getComputedStyle(t).fontSize, + headSize: getComputedStyle(head).fontSize, cx: Math.round(r.left + r.width / 2), bottom: Math.round(r.bottom), title: b.getAttribute("title") }; + }, col); + const cursorX = Math.round(bb.x + bb.width - 4), cursorY = bb.y + bb.height / 2; + check(tag + "말풍선 = 열 이름, 제목 글자 크기, 커서 위를 따라감", tip && tip.text === tip.name && tip.text !== "" && tip.size === tip.headSize && + Math.abs(tip.cx - cursorX) <= 1 && tip.bottom < cursorY && tip.title === "", tip); + await p.mouse.move(5, 5); + check(tag + "벗어나면 말풍선 닫힘", (await p.locator(".perf-cfold-tip").count()) === 0); await p.click('thead th[data-col="' + col + '"] .perf-cfold'); await p.waitForTimeout(100); const s1 = await state(p, col);