feat(실적): 열 접기 버튼에 커서 따라다니는 이름 말풍선

버튼 위에 올리면 커서 바로 위에 쇼핑몰(열) 이름 — 글자 크기는 열 제목과 같은 12px 굵게.
머리글 th 의 기본 title 말풍선은 버튼 title="" 로 막음.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 19:58:18 +09:00
parent 548a163fc4
commit 359ff29e95
4 changed files with 36 additions and 1 deletions
+1
View File
@@ -91,6 +91,7 @@
- **열 접기**(2026-11-06) — 매출 실적·광고비 일자별 표 머리글 위 작은 화살표 버튼(`.perf-cfold`, `performance.js initColFold`)으로 열 하나씩 접기/펴기(날짜 열 빼고, 일 합계·그룹 열 포함). - **열 접기**(2026-11-06) — 매출 실적·광고비 일자별 표 머리글 위 작은 화살표 버튼(`.perf-cfold`, `performance.js initColFold`)으로 열 하나씩 접기/펴기(날짜 열 빼고, 일 합계·그룹 열 포함).
접은 열 = 26px 띠(`is-cfold`, 칸 내용 숨김·클릭/메모 안 됨, 너비는 JS `CFOLD_W` 와 CSS 같게, 수동 열 너비 표도 같음). **로그인한 사람 본인에게만** — 접은 열 = 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. `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`. 그룹 하위 열 접기(⊟, 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`). - **표 열 너비 자동/수동**(2026-10-27) — 설정 "보기 설정" **표 열 너비** [자동(글자 길이)]·[수동 조절](누구나, 이 브라우저 쿠키 `perf_colw`, `router._colw_ctx` → 템플릿 `colw`).
수동 = 매출 실적·광고비 일자별 표에 `perf-colw-manual` → `performance.js initColWidths` 가 자동 너비를 잰 뒤 `table-layout:fixed`(`is-colw-fixed`, 넘치는 글자 …), 수동 = 매출 실적·광고비 일자별 표에 `perf-colw-manual` → `performance.js initColWidths` 가 자동 너비를 잰 뒤 `table-layout:fixed`(`is-colw-fixed`, 넘치는 글자 …),
+4
View File
@@ -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 .is-cfold > :not(.perf-cfold) { display: none !important; } /* 보기 기준(총매출·차감) 표시 규칙보다 우선 */
.perf-main th.is-cfold .perf-cfold { pointer-events: auto; margin-top: 0; } .perf-main th.is-cfold .perf-cfold { pointer-events: auto; margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .perf-cfold svg { transition: none; } } @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); }
+14 -1
View File
@@ -362,14 +362,27 @@
const b = th.querySelector(".perf-cfold"); const b = th.querySelector(".perf-cfold");
b.setAttribute("aria-expanded", fold ? "false" : "true"); b.setAttribute("aria-expanded", fold ? "false" : "true");
b.setAttribute("aria-label", b.dataset.name + (fold ? " 열 펴기" : " 열 접기")); 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) { Array.prototype.forEach.call(row.cells, function (th) {
const col = th.dataset.col; const col = th.dataset.col;
if (!col || col === "label") return; if (!col || col === "label") return;
const b = document.createElement("button"); const b = document.createElement("button");
b.type = "button"; b.type = "button";
b.className = "perf-cfold"; b.className = "perf-cfold";
b.title = "";
b.dataset.name = th.textContent.replace(/[✎\s]+/g, " ").trim(); b.dataset.name = th.textContent.replace(/[✎\s]+/g, " ").trim();
b.innerHTML = ICON; b.innerHTML = ICON;
th.insertBefore(b, th.firstChild); th.insertBefore(b, th.firstChild);
+17
View File
@@ -57,6 +57,23 @@ function state(p, col) {
}); });
const s0 = await state(p, col); const s0 = await state(p, col);
check(tag + "날짜 열 빼고 열마다 버튼, 처음엔 펼침", s0.buttons === s0.heads - 1 && !s0.labelBtn && !s0.folded && s0.expanded === "true", s0); 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.click('thead th[data-col="' + col + '"] .perf-cfold');
await p.waitForTimeout(100); await p.waitForTimeout(100);
const s1 = await state(p, col); const s1 = await state(p, col);