diff --git a/M02_MasterTemplete/M02_Item_Copy.py b/M02_MasterTemplete/M02_Item_Copy.py index 19e0f5779..a6fef7c8f 100644 --- a/M02_MasterTemplete/M02_Item_Copy.py +++ b/M02_MasterTemplete/M02_Item_Copy.py @@ -231,8 +231,11 @@ def _kept_picks(picks: Any, labor: dict[str, Any]) -> dict[str, Any]: return out -def reapply(project_root: str | Path, folder: str) -> dict[str, Any]: - """재적용 — 원본(층 · 마스터)을 다시 가져옴 · 입력값 · 고른자재는 같은 키면 살림. +def reapply( + project_root: str | Path, folder: str, who: dict[str, Any] | None = None +) -> dict[str, Any]: + """재적용 — 원본(층 · 마스터)을 다시 가져옴 · 입력값 · 고른자재는 같은 키면 살림 · + `who` = 가져온이 새로(142-2). 원본과 달라 덮인 파일(도면 · 면적)은 `덮임` 에 알림.""" target = folder_of(project_root, folder) @@ -262,6 +265,8 @@ def reapply(project_root: str | Path, folder: str) -> dict[str, Any]: # 원본을 다시 가져왔으니 시트 고침은 없음 — 살린 입력값 · 고른 자재는 `값있음` 으로 따로 알림 kept = bool(kept_values or files[PICKS_FILE]) fresh = {**manifest, "판": source, "원본판": source, "가져온날": stamp, "고침": False} + if who: + fresh["가져온이"] = who fresh["값있음"] = kept fresh.pop("고친날", None) atomic_write_json(target / MANIFEST_NAME, fresh) diff --git a/M02_MasterTemplete/M02_Project_Items_Router.py b/M02_MasterTemplete/M02_Project_Items_Router.py index d877cda49..3680ffb7c 100644 --- a/M02_MasterTemplete/M02_Project_Items_Router.py +++ b/M02_MasterTemplete/M02_Project_Items_Router.py @@ -29,6 +29,7 @@ from common_util.common_util_summary_item import parse_summary_item from M02_MasterTemplete import M02_Item_Copy as copies from M02_MasterTemplete import M02_MasterTemplete_Router_Layers as layer_routes from M02_MasterTemplete import M02_MasterTemplete_Store as store +from M02_MasterTemplete.M02_Item_Snapshot import importer from M02_MasterTemplete.M02_Item_Source import item_name router = APIRouter(prefix="/api/projects", tags=["M02 Project Items"]) @@ -162,7 +163,8 @@ async def write_item_file( async def reapply_item( project_id: str, folder: str, session: dict[str, Any] = Depends(verify_session) ) -> dict[str, Any]: - return await _run(copies.reapply, await _root(session, project_id), folder) + root = await _root(session, project_id) + return await _run(copies.reapply, root, folder, importer(session)) # 가져온이(142-2) @router.post("/{project_id}/items/{folder}/save-as") diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Style.css b/M02_MasterTemplete/StructOptions/M02_SO_Style.css index 492eb8c4f..cc499e87a 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Style.css +++ b/M02_MasterTemplete/StructOptions/M02_SO_Style.css @@ -357,3 +357,14 @@ .m02-sod__specpreview { max-width: 28rem; } + +/* 미리보기 상자 이름표 [삭제] — B05 상자 안 작은 단추 틀과 같은 꼴(136-3 · M02 는 B05 CSS 를 안 읽음) */ +.m02-sod__block .b05-structure__group > legend > button { + box-sizing: border-box; + height: 26px; + min-height: 0; + padding-block: 0; + padding-inline: var(--spacing-8); + font-size: var(--text-caption); + line-height: 1; +} diff --git a/resources/tester/test_136_3_remove_button.py b/resources/tester/test_136_3_remove_button.py index 457972857..2ca13237f 100644 --- a/resources/tester/test_136_3_remove_button.py +++ b/resources/tester/test_136_3_remove_button.py @@ -42,3 +42,10 @@ def test_이름표_단추는_작은_단추_틀_흐림은_글에만(): assert "height: var(--b05-control-h)" in small and "padding-block: 0" in small legend = _rule(".b05-structure__group > legend {") assert "opacity" not in legend and "currentColor 80%" in legend + + +def test_M02_미리보기_이름표_단추도_작은_단추_틀(): + css = (ROOT / "M02_MasterTemplete" / "StructOptions" / "M02_SO_Style.css").read_text("utf-8") + at = css.index(".m02-sod__block .b05-structure__group > legend > button") + rule = css[at : css.index("}", at)] + assert "height: 26px" in rule and "padding-block: 0" in rule diff --git a/resources/tester/test_item_copy_complete.py b/resources/tester/test_item_copy_complete.py index 95f50a518..7fad1f06d 100644 --- a/resources/tester/test_item_copy_complete.py +++ b/resources/tester/test_item_copy_complete.py @@ -421,6 +421,9 @@ def test_재적용은_시트_고침을_덮고_알림_입력값은_살림(world): assert "메모" not in copies.read_file(root, FOLDER, "면적")["내용"] assert copies.read_file(root, FOLDER, "입력값")["내용"] == values assert copies.reapply(root, FOLDER)["덮임"] == [] + who = {"id": 42, "이름": "재적용"} # 142-2 — [재적용]이 가져온이를 새로 적음 + copies.reapply(root, FOLDER, who) + assert copies.list_items(root)[0]["가져온이"] == who def test_개인에_저장하면_개인_층에_항목(world):