feat(copy): 복사 항목이 없는 부재(교량받침·기둥)에서는 속성 복사 패널을 숨김

- hasCopyItems 추가, 테스트 2건 (코핑·확대기초·지반은 표시, 교량받침·기둥은 숨김)
- "이 부재는 복사 항목이 없습니다" 문구 제거
- 대응표는 그대로 두어 항목이 생기면 자동으로 다시 표시

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-27 17:03:45 +09:00
1 parent fb09c693c4
commit 278d19faa5
4 files changed
+22 -4

No files matched your search

-1
View File
@@ -170,7 +170,6 @@
<button id="cp-items-reset" class="btn-o small" type="button">변경 항목으로 선택</button>
</div>
<div id="cp-items" class="cp-chips"></div>
<p id="cp-none" class="muted small" hidden>이 부재는 복사 항목이 없습니다. 기둥·받침은 예정입니다.</p>
<p class="muted small">복사하지 않는 값: 좌표 · IP · 받침 EL · 코핑 상면 EL · 기초 하단 EL · 지반고 · 기둥 높이 · 말뚝 선단 EL · 계단 구간</p>
</section>
</div>
+5
View File
@@ -39,6 +39,11 @@ export const MEMBER_COPY_ITEMS: Record<MemberId, CopyItem[]> = {
ground: ['ground-position'],
};
/** Whether the 속성 복사 panel is shown for the 부재: only when it has copy items. */
export function hasCopyItems(member: MemberId): boolean {
return copyItemsFor(member).length > 0;
}
/** The copy items for the selected 부재. */
export function copyItemsFor(member: MemberId): CopyItem[] {
return MEMBER_COPY_ITEMS[member];
+3 -2
View File
@@ -9,7 +9,7 @@ import { buildTemplateWorkbook } from './core/template';
import { EDITABLE_FIELDS, FIELD_LABELS, overrideKeys, pendingKeys, revertDraft, type EditableKey, type PierValues } from './core/changes';
import { adjustRow, layoutText, resolveRowCounts, rowLayout, totalPiles } from './core/piles';
import { applyCopy, COPY_ITEMS, planCopy, type CopyItem } from './core/copy';
import { copyCandidates, copyItemsFor, copyItemsWithOverrides, selectedTargets, type CopyCandidate } from './core/copy-targets';
import { copyCandidates, copyItemsFor, copyItemsWithOverrides, hasCopyItems, selectedTargets, type CopyCandidate } from './core/copy-targets';
import { pileGeometry } from './core/geometry';
import { rebarSummary, type RebarRow } from './core/rebar/summary';
import { shearSegments } from './core/rebar/coping';
@@ -678,7 +678,8 @@ function renderCopyItems(): void {
label.append(check, document.createTextNode(COPY_ITEMS[item].label));
box.appendChild(label);
}
$('cp-none').hidden = items.length > 0;
// The panel is hidden for a 부재 without copy items (교량받침·기둥 are 예정).
$('copy-panel').hidden = !hasCopyItems(state.member);
}
function renderCopyTargets(): void {
+14 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { copyCandidates, copyItemsFor, copyItemsWithOverrides, selectedTargets, type CopyCandidate } from '../src/core/copy-targets';
import { copyCandidates, copyItemsFor, copyItemsWithOverrides, hasCopyItems, selectedTargets, type CopyCandidate } from '../src/core/copy-targets';
import { loadP1 } from './helpers';
const piers: CopyCandidate[] = [
@@ -88,3 +88,16 @@ describe('copyItemsWithOverrides (기준 교각에서 되돌리기가 표시된
expect(copyItemsWithOverrides(source({ groundEl: base.groundEl + 0.5 }))).toEqual([]);
});
});
describe('hasCopyItems (속성 복사 패널을 보일지)', () => {
it('shows the panel for coping, 확대기초·말뚝 and 지반', () => {
expect(hasCopyItems('coping')).toBe(true);
expect(hasCopyItems('footing')).toBe(true);
expect(hasCopyItems('ground')).toBe(true);
});
it('hides the panel for 교량받침 and 기둥 (no copy items yet)', () => {
expect(hasCopyItems('bearing')).toBe(false);
expect(hasCopyItems('column')).toBe(false);
});
});