fix(M02): 옛 알약 연결 이름+단위로 맞춤 · 옆 판 이은 칸 즉시 갱신 · 새 조합 이름 겹침 · 첫 자재 조합 모달 글

- 알약 막대: 키가 목록에 없는 옛 연결(로직 키)을 이름 + 단위가 같은 알약으로 이어 새 키로 바꿈 — 따로 붙던 「연결」 알약 제거
- 재료산출 옆 판: 알약을 이음 · 풂 즉시 「이은 칸」 갱신
- 새 조합 이름: 원래 이름이 구조물 이름으로 끝나면 덧붙이지 않음(일위대가 · 자재)
- 자재 조합이 없는 열의 첫 생성 모달 글: 「이 열에 새 자재 조합을 만듦」

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Kyw9qnkJ94pC1A4PfpDtA
This commit is contained in:
2026-09-28 20:22:06 +09:00
co-authored by Claude Sonnet 5
parent 453095f6db
commit fb5aee7ea2
4 changed files with 41 additions and 8 deletions
@@ -231,8 +231,29 @@ export function mountLinks(
return b;
}
/** 옛 키(로직 키 등)로 저장된 연결 — 키가 알약 목록에 없으면 이름 + 단위가 같은 알약으로 이어
* 연결 키를 새 키로 바꿔 둠(다음 저장 때 새 키로 나감 · 안 맞으면 그대로 두어 늘 보임) */
function align(): void {
if (opts?.모드 !== "입력") return;
const keys = new Set(items.map((i) => i.키));
const taken = new Set<string>();
for (const sheet of ctx.book.시트)
for (const l of sheet.연결 ?? []) if (keys.has(l.키)) taken.add(l.키);
for (const sheet of ctx.book.시트)
for (const l of sheet.연결 ?? []) {
if (keys.has(l.키)) continue;
const hit = items.find(
(i) => !taken.has(i.키) && i.이름 === l.이름 && (i.단위 ?? "") === (l.단위 ?? ""),
);
if (!hit) continue;
l.키 = hit.키;
taken.add(hit.키);
}
}
function renderBar(): void {
if (!opts) return;
align();
const map = found();
const shown: LinkItem[] = [];
const seen = new Set<string>();