From 7cb15af1e7b5d86e71fcdaf821dab854480233be Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 17 Sep 2026 10:54:44 +0900 Subject: [PATCH] =?UTF-8?q?feat(z01):=20=EC=83=81=EC=9E=90=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=EC=9D=84=20=EC=84=9C=EB=B2=84=20group=5Flabel=20?= =?UTF-8?q?=EB=A1=9C=20=E2=80=94=20=EC=95=88=20=EC=98=A4=EB=A9=B4=20group?= =?UTF-8?q?=20=ED=82=A4=20=EA=B7=B8=EB=8C=80=EB=A1=9C(=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EC=97=90=20=ED=95=9C=EA=B8=80=20=EC=9D=B4=EB=A6=84=20=EC=95=88?= =?UTF-8?q?=20=EB=B0=95=EC=9D=8C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 지금 서버가 갈래 키(base_price·pumsem_basis)만 줘 상자 제목이 영문으로 뜨던 자리 - 공종 축(work_item) 상자는 코드 추가 없이 섬 — 가짜 응답으로 확인(산림 358 · 건설 가짜 2,199 · 찾기·끝 쪽) - 시험: 갈래 이름이 오면 그 이름 · 안 오면 키가 드러남 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq --- Z01_MasterData/Z01_MasterData_UI_Cells.ts | 10 +++++++--- Z01_MasterData/Z01_MasterData_UI_Side.ts | 6 +++--- resources/tester/test_z01_master_cells.py | 19 +++++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/Z01_MasterData/Z01_MasterData_UI_Cells.ts b/Z01_MasterData/Z01_MasterData_UI_Cells.ts index c207aa2d..e0995b09 100644 --- a/Z01_MasterData/Z01_MasterData_UI_Cells.ts +++ b/Z01_MasterData/Z01_MasterData_UI_Cells.ts @@ -88,18 +88,22 @@ export function outdatedBanner(sources?: TableSource[]): string[] { /** 서버가 주는 표 한 벌 — 갈래·kind·한글 이름·줄 수. 화면은 제 목록을 안 가짐(늘면 저절로 섬). */ export interface ServedKind { group: string; + /** 갈래 한글 이름(이름표 `base_price_groups`) — 안 오면 group 키가 그대로 떠 빠진 것이 드러남 */ + group_label?: string; kind: string; label: string; rows: number; } +type KindBox = { group: string; label: string; items: ServedKind[] }; + /** 받은 차례 그대로 갈래별로 묶음 — 갈래 차례도 서버가 낸 순서를 따름. */ -export function groupKinds(kinds: ServedKind[]): { group: string; items: ServedKind[] }[] { - const boxes: { group: string; items: ServedKind[] }[] = []; +export function groupKinds(kinds: ServedKind[]): KindBox[] { + const boxes: KindBox[] = []; for (const kind of kinds) { const box = boxes.find((each) => each.group === kind.group); if (box) box.items.push(kind); - else boxes.push({ group: kind.group, items: [kind] }); + else boxes.push({ group: kind.group, label: kind.group_label ?? kind.group, items: [kind] }); } return boxes; } diff --git a/Z01_MasterData/Z01_MasterData_UI_Side.ts b/Z01_MasterData/Z01_MasterData_UI_Side.ts index d245d1ee..0e958c6d 100644 --- a/Z01_MasterData/Z01_MasterData_UI_Side.ts +++ b/Z01_MasterData/Z01_MasterData_UI_Side.ts @@ -56,7 +56,7 @@ export function buildSidePanel( button.addEventListener("click", () => { activate(button); view.show({ - title: `${box.group} › ${served.label}`, + title: `${box.label} › ${served.label}`, key: `base-prices/${served.kind}`, load: (query) => fetchBasePrices(served.kind, query), save: (rowId, values) => saveBasePrice(served.kind, rowId, values), @@ -64,7 +64,7 @@ export function buildSidePanel( }); grid.append(button); } - return { group: box.group, grid }; + return { label: box.label, grid }; }); const overridesButton = el("button", { className: "z01-master__base z01-master__base--wide", @@ -131,7 +131,7 @@ export function buildSidePanel( } panel.append( - ...boxes.map((box) => section(box.group, box.grid)), + ...boxes.map((box) => section(box.label, box.grid)), section(L("Z01_MasterData_Tree"), tree), ); attachCollapsible(panel); diff --git a/resources/tester/test_z01_master_cells.py b/resources/tester/test_z01_master_cells.py index 28d71e34..be23448e 100644 --- a/resources/tester/test_z01_master_cells.py +++ b/resources/tester/test_z01_master_cells.py @@ -30,14 +30,16 @@ import { // kind 목록은 서버가 줌 — 화면이 제 목록을 들면 kind 가 늘 때마다 빠짐(2026-09-16 브레인) const served = [ - { group: "base_price", kind: "labor", label: "노임", rows: 261 }, - { group: "base_price", kind: "oil", label: "유가", rows: 36 }, - { group: "pumsem_basis", kind: "coef", label: "토량환산계수", rows: 32 }, + { group: "base_price", group_label: "기초단가", kind: "labor", label: "노임", rows: 261 }, + { group: "base_price", group_label: "기초단가", kind: "oil", label: "유가", rows: 36 }, + { group: "pumsem_basis", group_label: "품셈 기준", kind: "coef", label: "토량환산계수", rows: 32 }, // 서버가 새 kind·새 갈래를 더해도 화면이 그대로 세움 - { group: "pumsem_basis", kind: "machine_productivity", label: "기계 작업량", rows: 47 }, + { group: "pumsem_basis", group_label: "품셈 기준", kind: "machine_productivity", label: "기계 작업량", rows: 47 }, + { group: "work_axis", group_label: "공종 축", kind: "forest", label: "산림품셈 기준", rows: 358 }, + // 갈래 이름이 안 오면 키가 그대로 떠 빠진 것이 드러남(때우지 않음) { group: "later_group", kind: "brand_new", label: "새 갈래 것", rows: 3 }, ]; -const grouped = groupKinds(served).map((g) => [g.group, g.items.map((i) => i.kind)]); +const grouped = groupKinds(served).map((g) => [g.label, g.items.map((i) => i.kind)]); // 열 제목 누르기 — 없음 → 오름 → 내림 → 없음(원본 차례) · 다른 열을 누르면 그 열 오름부터 const sorts = [ @@ -323,9 +325,10 @@ def test_칸_글자와_숨김_열(tmp_path: Path) -> None: None, {"key": "item_code", "desc": False}, ] - # 서버 차례 그대로 갈래별로 묶임 · 새 kind·새 갈래도 저절로 섬(화면 목록이 없음) + # 서버 차례 그대로 갈래별로 묶임 · 상자 이름은 서버 group_label · 새 kind·새 갈래도 저절로 섬 assert got["grouped"] == [ - ["base_price", ["labor", "oil"]], - ["pumsem_basis", ["coef", "machine_productivity"]], + ["기초단가", ["labor", "oil"]], + ["품셈 기준", ["coef", "machine_productivity"]], + ["공종 축", ["forest"]], ["later_group", ["brand_new"]], ]