Merge remote-tracking branch 'origin/sub_laptop_7' into sub_laptop_2

This commit is contained in:
2026-09-29 08:46:16 +09:00
4 changed files with 17 additions and 6 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ export interface SpreadsheetOptions {
onSelect?: (selection: { 시트: string; 칸: string; 범위: string }) => void;
/** 아래 시트 탭 줄 — false 면 안 그림(산출근거 = 시트 하나) · 시트 오가기 · 새 시트 단축키 · 시트 메뉴도 끔 */
tabs?: boolean;
/** 위 알약 막대 — 입력값 · 자재를 칸에 연결(`spreadsheet_links.ts` · 이때만 불러옴) */
/** 아래 알약 막대(상태줄 위) — 입력값 · 자재를 칸에 연결(`spreadsheet_links.ts` · 이때만 불러옴) */
links?: LinkOptions;
}
+2 -2
View File
@@ -1,4 +1,4 @@
/* spreadsheet_links.css (주인 D) — 위 알약 막대 · 연결 칸 세모 · 자재 고르기 창 */
/* spreadsheet_links.css (주인 D) — 아래 알약 막대 · 연결 칸 세모 · 자재 고르기 창 */
.ss-links {
display: flex;
@@ -6,7 +6,7 @@
flex-wrap: wrap;
gap: var(--spacing-4);
padding: var(--spacing-4) var(--spacing-8);
border-bottom: 1px solid var(--color-border);
border-top: 1px solid var(--color-border);
background: var(--color-surface);
}
+4 -3
View File
@@ -1,6 +1,6 @@
/* =============================================================================
* spreadsheet_links.ts (주인 D)
* 위 알약 막대 — 면적산출(입력값) · 재료산출(자재) 알약을 칸에 연결(PLAN 13장).
* 아래 알약 막대(시트 아래 · 상태줄 위) — 면적산출(입력값) · 재료산출(자재) 알약을 칸에 연결(PLAN 13장).
* 칸을 고른 채 밝은 알약을 누르면 그 칸에 연결(알약 흐려짐 + 칸 주소 · 칸 왼아래 작은 세모) ·
* 흐린 알약을 누르면 연결 칸으로 · 우클릭 [연결 풀기] · 자재 모드는 [자재 더하기] → 고르기 창 → 새 알약.
* 자재 모드 알약 목록 = 호스트(M02)가 `항목` 으로 줌(자재 정보 포함 · 저장은 마스터 자재 조합) — [자재 더하기] ·
@@ -127,7 +127,8 @@ export function mountLinks(
slot: typeof slotOf,
): Links {
const bar = el("div", { className: "ss-links", attrs: { title: TEXT.bar } });
if (opts) ctx.root.prepend(bar);
// 시트 아래 · 상태줄 위(시트는 flex 라 막대 높이만큼 줄어듦)
if (opts) ctx.root.insertBefore(bar, ctx.root.querySelector(":scope > .ss-statusbar"));
const menu = createMapContextMenu("ss");
ctx.root.append(menu.element);
/** 알약 목록 — 호스트가 준 항목 + 더한 자재(자재 모드 · 바뀌면 호스트에 알림) */
@@ -323,7 +324,7 @@ export function mountLinks(
const a = anchor.getBoundingClientRect();
const o = ctx.root.getBoundingClientRect();
pick.style.left = `${a.left - o.left}px`;
pick.style.top = `${a.bottom - o.top + 4}px`;
pick.style.bottom = `${o.bottom - bar.getBoundingClientRect().top + 4}px`; // 막대 위로 엶
ctx.root.append(pick);
document.addEventListener("mousedown", onOutside, true);
@@ -113,6 +113,16 @@ def test_links_follow_rows_cols(r):
assert r["links"] == ["L:B7,W:D5", "L:B7", "L:B7,W:D5", "L:B5,W:D3", "D1"]
def test_links_bar_sits_under_sheet():
# 알약 막대 = 시트 아래 · 상태줄 위 · 자재 고르기 창은 막대 위로 엶
with open(
os.path.join(HERE, "../../../A00_Common/spreadsheet/spreadsheet_links.ts"), encoding="utf-8"
) as f:
src = f.read()
assert 'insertBefore(bar, ctx.root.querySelector(":scope > .ss-statusbar"))' in src
assert "pick.style.bottom = `${o.bottom - bar.getBoundingClientRect().top + 4}px`" in src
def test_typed_format(r):
assert r["typedFormat"] == ["0%", "0.0%", "#,##0.0", "#,##0", None, None, None]