From 5f3ea8d56fbc5731997214eb0ab847eb1abbd916 Mon Sep 17 00:00:00 2001 From: ypshim Date: Tue, 27 Oct 2026 16:56:12 +0900 Subject: [PATCH] =?UTF-8?q?feat(copy):=20=EC=BD=94=ED=95=91=EC=9D=98=20?= =?UTF-8?q?=EB=81=9D=EB=8B=A8=20=EB=86=92=EC=9D=B4=20h1,=20=ED=85=8C?= =?UTF-8?q?=EC=9D=B4=ED=8D=BC=20=EB=86=92=EC=9D=B4=20h2,=20Level=20?= =?UTF-8?q?=ED=8F=AD=EC=9D=84=20=EB=B3=B5=EC=82=AC=20=ED=95=AD=EB=AA=A9?= =?UTF-8?q?=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - COPY_ITEMS에 coping-h1, coping-h2, level-width 추가 (기본 해제) - 코핑 부재의 복사 항목에 포함, 바뀐 값이 있으면 기본으로 체크 - 테스트 갱신 및 h1·Level 폭 기본 체크 테스트 추가 Co-Authored-By: Claude Haiku 5.5 --- src/core/copy-targets.ts | 2 +- src/core/copy.ts | 5 ++++- tests/copy-targets.test.ts | 8 ++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/copy-targets.ts b/src/core/copy-targets.ts index 7400dbb..b73103b 100644 --- a/src/core/copy-targets.ts +++ b/src/core/copy-targets.ts @@ -34,7 +34,7 @@ export function selectedTargets(piers: CopyCandidate[], sourceName: string, same /** 부재 → 복사 항목. A member with no copy items (기둥, 받침) copies nothing yet. */ export const MEMBER_COPY_ITEMS: Record = { bearing: [], - coping: ['coping-width', 'coping-length'], + coping: ['coping-width', 'coping-length', 'coping-h1', 'coping-h2', 'level-width'], column: [], footing: ['pile-length', 'pile-rows'], ground: ['ground-position'], diff --git a/src/core/copy.ts b/src/core/copy.ts index d432c26..8109146 100644 --- a/src/core/copy.ts +++ b/src/core/copy.ts @@ -5,7 +5,7 @@ import type { PierInput } from './types'; * 속성 복사 (spec §9 · plan C7). Copies chosen attributes from one pier to others. * Values the spec never copies (coordinates, IP, elevations, names) are not in any item, so they cannot be copied. */ -export type CopyItem = 'coping-width' | 'coping-length' | 'pile-length' | 'pile-rows' | 'ground-position'; +export type CopyItem = 'coping-width' | 'coping-length' | 'coping-h1' | 'coping-h2' | 'level-width' | 'pile-length' | 'pile-rows' | 'ground-position'; interface ItemRule { label: string; @@ -19,6 +19,9 @@ interface ItemRule { export const COPY_ITEMS: Record = { 'coping-width': { label: '코핑 폭', keys: ['copingWidthMm'], defaultOn: true, pileItem: false }, 'coping-length': { label: '코핑 길이 L', keys: ['copingLengthMm'], defaultOn: false, pileItem: false }, + 'coping-h1': { label: '끝단 높이 h1', keys: ['copingH1Mm'], defaultOn: false, pileItem: false }, + 'coping-h2': { label: '테이퍼 높이 h2', keys: ['copingH2Mm'], defaultOn: false, pileItem: false }, + 'level-width': { label: 'Level 폭', keys: ['levelWidthMm'], defaultOn: false, pileItem: false }, 'pile-length': { label: '말뚝 길이', keys: ['pileLengthMm'], defaultOn: false, pileItem: true }, 'pile-rows': { label: '열별 본수', keys: ['pileRows'], defaultOn: false, pileItem: true }, 'ground-position': { label: '지반 위치·지하수위', keys: ['groundPosition', 'groundWaterOn', 'groundWaterEl', 'floodLevelEl', 'highWaterEl', 'lowWaterEl'], defaultOn: false, pileItem: false }, diff --git a/tests/copy-targets.test.ts b/tests/copy-targets.test.ts index 8b5960d..75d1279 100644 --- a/tests/copy-targets.test.ts +++ b/tests/copy-targets.test.ts @@ -43,7 +43,7 @@ describe('selectedTargets (선택한 대상만)', () => { describe('copyItemsFor (부재 선택에 해당하는 복사 항목)', () => { it('coping copies only the coping items', () => { - expect(copyItemsFor('coping')).toEqual(['coping-width', 'coping-length']); + expect(copyItemsFor('coping')).toEqual(['coping-width', 'coping-length', 'coping-h1', 'coping-h2', 'level-width']); }); it('확대기초 · 말뚝 copies only the pile items', () => { @@ -61,7 +61,7 @@ describe('copyItemsFor (부재 선택에 해당하는 복사 항목)', () => { it('every copy item belongs to exactly one member', () => { const all = (['bearing', 'coping', 'column', 'footing', 'ground'] as const).flatMap((m) => copyItemsFor(m)); - expect([...all].sort()).toEqual(['coping-length', 'coping-width', 'ground-position', 'pile-length', 'pile-rows']); + expect([...all].sort()).toEqual(['coping-h1', 'coping-h2', 'coping-length', 'coping-width', 'ground-position', 'level-width', 'pile-length', 'pile-rows']); }); }); @@ -81,6 +81,10 @@ describe('copyItemsWithOverrides (기준 교각에서 되돌리기가 표시된 expect(copyItemsWithOverrides(source({ pileLengthMm: base.pileLengthMm + 100 }))).toEqual(['pile-length']); }); + it('selects the coping h1, h2 and Level 폭 items when those values changed', () => { + expect(copyItemsWithOverrides(source({ copingH1Mm: base.copingH1Mm + 1, levelWidthMm: base.levelWidthMm + 1 }))).toEqual(['coping-h1', 'level-width']); + }); + it('ignores a changed value that no copy item carries (groundEl)', () => { expect(copyItemsWithOverrides(source({ groundEl: base.groundEl + 0.5 }))).toEqual([]); });