fix(performance): 날짜 열은 너비 조절 안 함(늘 자동 너비)

수동 열 너비 모드에서도 날짜 열은 글자 길이 자동 너비 유지, 경계 손잡이 없음,
예전에 저장된 날짜 열 너비는 무시.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 23:32:14 +09:00
parent 2b3b36d646
commit fbed3ef159
3 changed files with 17 additions and 3 deletions
+1 -1
View File
@@ -82,7 +82,7 @@
- 일자별 표 매출 칸 아래 **광고비(ROAS%)** 주황 줄(`--perf-ad`, `dashboard._ad_lines`) — 광고비 탭과 같은 값(`ad_spend.channel_roas`). 쇼핑몰 → 광고 채널은 `dashboard.sales_ad_channels`: 카페24 = 구글·메타 두 줄(이름 붙임), 네이버 = 네이버, 나머지는 `ROAS_SALES_CODE`(쿠팡 ← 쿠팡(윙)). 일 합계 = 보이는 쇼핑몰 광고비 합, ROAS = **일 합계 금액 ÷ 일 합계 광고비**(2026-10-19 — 예전엔 광고비 있는 쇼핑몰 매출만 더했다; `roas` 총매출·`roas_net` 수수료 차감 매출 기준, 보기 기준에 따라 하나만). 광고비 표 없으면 줄 없음.
- **표 열 너비 자동/수동**(2026-10-27) — 설정 "보기 설정" **표 열 너비** [자동(글자 길이)]·[수동 조절](누구나, 이 브라우저 쿠키 `perf_colw`, `router._colw_ctx` → 템플릿 `colw`).
수동 = 매출 실적·광고비 일자별 표에 `perf-colw-manual` → `performance.js initColWidths` 가 자동 너비를 잰 뒤 `table-layout:fixed`(`is-colw-fixed`, 넘치는 글자 …),
머리글 오른쪽 경계 `.perf-colw-grip` 드래그(최소 36px)·두 번 누르면 그 열만 자동. 너비 = localStorage `perf_colw_sales`/`perf_colw_ads`(th `data-col` = 쇼핑몰·채널 코드·`label`·`total`)에 계속 유지,
머리글 오른쪽 경계 `.perf-colw-grip` 드래그(최소 36px)·두 번 누르면 그 열만 자동. **날짜 열(`label`)은 조절 불가 — 늘 자동 너비, 손잡이 없음, 저장값 무시**. 너비 = localStorage `perf_colw_sales`/`perf_colw_ads`(th `data-col` = 쇼핑몰·채널 코드·`label`·`total`)에 계속 유지,
설정 [조절한 너비 초기화]가 둘 다 지움. 그룹 접기·펴기 때 열 너비도 함께 움직임(`colw.animate/settle`). 테스트 `tests/js/perf_colw.browser.test.js`.
- **매출 단위** 원·천원·백만원 — 설정 "보기 설정"(누구나, 이 브라우저 쿠키 `perf_unit`), 서버가 `amount_text`(천원 정수·백만원 소수 한 자리)로 그림(`router._unit_ctx` → 템플릿 `amt`). 광고비 탭은 원 그대로.
- 설정의 진단 카드(쇼핑몰 원본 데이터 확인·카페24 매출 대조·일별 한 번에 비교)는 2026-10-19 화면에서 뺐다(서버 API `marketplaces/{code}/reconcile`·`daily-check` 는 진단용으로 남김).
+4 -1
View File
@@ -269,7 +269,9 @@
function store() {
try { localStorage.setItem(KEY, JSON.stringify(saved)); } catch (_) { /* 기억만 못 함 */ }
}
function widthOf(th) { const c = th.dataset.col; return saved[c] || auto[c] || 80; }
// 날짜 열(label)은 조절 안 함(2026-10-27) — 늘 자동 너비(글자 길이), 손잡이 없음
function fixedCol(th) { return th.dataset.col === "label"; }
function widthOf(th) { const c = th.dataset.col; return (!fixedCol(th) && saved[c]) || auto[c] || 80; }
function apply(zero) { // zero = 너비 0 으로 둘 열(접는 중·펴기 직전)
let sum = 0;
heads.forEach(function (th) {
@@ -291,6 +293,7 @@
apply();
}
heads.forEach(function (th) {
if (fixedCol(th)) return;
const g = document.createElement("span");
g.className = "perf-colw-grip";
g.setAttribute("aria-hidden", "true");
+12 -1
View File
@@ -67,7 +67,18 @@ async function drag(p, col, dx) {
}).length;
});
const sum0 = Object.keys(w0.cols).reduce(function (s, k) { return s + w0.cols[k]; }, 0);
check("수동 = 고정 표 + 열마다 손잡이, 처음엔 글자가 잘리지 않는 자동 너비", w0.fixed && w0.grips === Object.keys(w0.cols).length && fits === 0, { w0: w0, fits: fits });
const labelGrip = await p.locator('th[data-col="label"] > .perf-colw-grip').count();
check("수동 = 고정 표 + 날짜 열 빼고 열마다 손잡이, 처음엔 글자가 잘리지 않는 자동 너비",
w0.fixed && w0.grips === Object.keys(w0.cols).length - 1 && labelGrip === 0 && fits === 0, { w0: w0, fits: fits, labelGrip: labelGrip });
// 예전에 저장된 날짜 열 너비가 있어도 무시(자동 너비)
await p.evaluate(function () { localStorage.setItem("perf_colw_sales", JSON.stringify({ label: 300 })); });
await p.reload();
await p.waitForTimeout(150);
const wl = await widths(p);
check("날짜 열은 저장 너비 무시 — 늘 자동 너비", Math.abs(wl.cols.label - w0.cols.label) <= 1, { label: wl.cols.label, auto: w0.cols.label });
await p.evaluate(function () { localStorage.removeItem("perf_colw_sales"); });
await p.reload();
await p.waitForTimeout(150);
check("표 너비 = 열 너비 합", Math.abs(w0.table - sum0) <= 2, { table: w0.table, sum: sum0 });
await drag(p, "naver", 70);
const w1 = await widths(p);