feat(copy): 속성 복사 항목을 선택한 부재에 해당하는 것만 표시

- 부재별 복사 항목 대응표(MEMBER_COPY_ITEMS)를 core/copy-targets.ts에 두고 테스트 추가
  코핑 → 폭·길이, 확대기초·말뚝 → 말뚝 길이·열별 본수, 지반 → 위치·지하수위, 기둥·받침 → 없음
- 항목은 선택된 부재(state.member) 기준으로 그려지고, 체크 상태는 부재를 바꿔도 유지
- 기둥·받침은 "복사 항목 없음"을 표시하고 적용 버튼을 비활성화
- ①은 복사 패널 안의 부재 선택으로, ②는 부재 목록으로 같은 부재를 고름

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-27 16:31:38 +09:00
1 parent ccc1f494bc
commit 3a16ee59da
4 files changed
+87 -34

No files matched your search

+25 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { copyCandidates, selectedTargets, type CopyCandidate } from '../src/core/copy-targets';
import { copyCandidates, copyItemsFor, selectedTargets, type CopyCandidate } from '../src/core/copy-targets';
const piers: CopyCandidate[] = [
{ name: 'P1', type: 'T형', hasModel: true },
@@ -39,3 +39,27 @@ describe('selectedTargets (선택한 대상만)', () => {
expect(selectedTargets(piers, 'P3', true, picked)).toEqual([]);
});
});
describe('copyItemsFor (부재 선택에 해당하는 복사 항목)', () => {
it('coping copies only the coping items', () => {
expect(copyItemsFor('coping')).toEqual(['coping-width', 'coping-length']);
});
it('확대기초 · 말뚝 copies only the pile items', () => {
expect(copyItemsFor('footing')).toEqual(['pile-length', 'pile-rows']);
});
it('지반 copies only the ground position', () => {
expect(copyItemsFor('ground')).toEqual(['ground-position']);
});
it('기둥 and 받침 have no copy items yet', () => {
expect(copyItemsFor('column')).toEqual([]);
expect(copyItemsFor('bearing')).toEqual([]);
});
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']);
});
});