Merge remote-tracking branch 'origin/sub_laptop_3' into main_laptop_1

This commit is contained in:
2026-10-26 22:51:50 +09:00
3 changed files with 81 additions and 4 deletions
@@ -283,14 +283,16 @@ body.cad-file-dragging::after {
text-overflow: ellipsis;
white-space: nowrap;
}
/* 단추 = 단추 부품(보조 · 단 24) · 여기는 둘이 폭을 나눔만 */
/* 단추 = 단추 부품(보조 · 단 24) · 여기는 폭 나눔만 — 글 12 로 한 줄에 둘이 안 들어가면 줄을 넘김 */
.cad-block-library__actions {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 8px;
}
.cad-block-library__actions > .ui-btn {
flex: 1;
flex: 1 1 auto;
white-space: nowrap;
}
/* 도각 자리표 패널 — 도각 편집으로 도면을 실었을 때만 뜬다 (2026-09-06 사용자 지시로
@@ -1,7 +1,7 @@
/**
* 부품 상자(`ui_template/`) CAD 쪽 한 벌(553-6) — CAD 겉도 앱 화면과 같은 부품 꼴을 씀.
* 부품 CSS 를 싣고 단추 · 확인창 기본 꼴(`injectBaseStyles`)을 한 번 넣음 · 확인창 · 글 묻기를 다시 냄.
* React 화면은 부품 클래스(`ui-btn` · `ui-icon-btn` · `ui-toggle--chip` · `ui-tabs` · `ui-float-panel` · `ui-ctx-menu` · `ui-empty` · `ui-text` · `ui-input`)와
* React 화면은 부품 클래스(`ui-btn` · `ui-icon-btn` · `ui-toggle--chip` · `ui-tabs` · `ui-float-panel` · `ui-ctx-menu` · `ui-empty` · `ui-text` · `ui-input` · `ui-sidebar-row`)와
* `data-size` 단을 직접 붙임 · 자리 · 폭은 App.css 의 `cad-*` 가 맡음 · 도면 그림 색(`--draw-*`)은 안 건드림.
*/
import '../../../../ui_template/ui_template_tabs.css';
@@ -11,8 +11,10 @@ import '../../../../ui_template/ui_template_context_menu.css';
import '../../../../ui_template/ui_template_empty.css';
import '../../../../ui_template/ui_template_input.css';
import '../../../../ui_template/ui_template_text.css';
import '../../../../ui_template/ui_template_list_row.css';
import { injectBaseStyles } from '../../../../ui_template/ui_template_elements_styles.ts';
export { askConfirm, askText } from '../../../../ui_template/ui_template_modal.ts';
injectBaseStyles();
// DOM 없는 시험(vitest node)에선 건너뜀
if (typeof document !== 'undefined') injectBaseStyles();
+73
View File
@@ -0,0 +1,73 @@
"""553-6 CAD 앱 겉 = 부품 상자 부품 — 화면 없이 소스로 지킴.
상태막대 켜기 칩 · 특성/레이어 탭 · 떠 있는 판 · 메뉴 · 아이콘 단추 · 확인창(window.confirm · prompt 없음) ·
부품 CSS 를 앱 CSS 보다 먼저 실음 · 옛 자체 단추 규칙 · 보라 별칭 · 날 색 없음 · 도면 바탕 = --draw-canvas.
"""
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
CAD = ROOT / "B07_DesignDetail" / "openwebcad" / "src"
def _t(rel: str) -> str:
return (CAD / rel).read_text("utf-8")
def test_parts_markup():
status = _t("components/StatusBar.tsx")
assert status.count('className="ui-toggle ui-toggle--chip"') == 6
assert 'data-size="22"' in status and "aria-pressed=" in status
inspector = _t("components/InspectorPanel.tsx")
assert '"ui-tabs cad-inspector-tabs"' in inspector and inspector.count("ui-tabs__tab") == 2
for rel in (
"components/QuickProperties.tsx",
"components/BlockLibraryPanel.tsx",
"components/FramePlaceholderPanel.tsx",
):
src = _t(rel)
assert (
"ui-float-panel" in src
and "ui-float-panel__head" in src
and "ui-float-panel__body" in src
), rel
assert "ui-ctx-menu cad-ribbon-overflow" in _t("ribbon/Ribbon.tsx")
assert "ui-ctx-menu cad-command-suggestions" in _t("components/CommandLine.tsx")
assert "ui-ctx-menu cad-snap-menu" in _t("inputController/snap-menu.ts")
assert _t("components/ViewControls.tsx").count("{...ICON_BUTTON}") == 5
assert "ui-icon-btn" in _t("components/QuickAccessBar.tsx")
assert "h-[42px]" in _t("components/Button.tsx")
def test_no_system_dialogs():
for path in CAD.rglob("*.ts*"):
if ".test." in path.name:
continue
src = path.read_text("utf-8")
assert "window.confirm(" not in src and "window.prompt(" not in src, path.name
assert "askConfirm" in _t("components/BlockLibraryPanel.tsx")
assert "askText" in _t("commands/commands.insert.ts")
def test_kit_loaded_before_app_css():
kit = _t("integration/ui-kit.ts")
assert "if (typeof document !== 'undefined') injectBaseStyles();" in kit
main = _t("main.tsx")
assert main.index("./integration/ui-kit.ts") < main.index("import App from './App.tsx'")
def test_css_tokens_only():
css = _t("App.css") + _t("App_Layers.css") + _t("inputController/snap-menu.css")
assert "--cad-canvas: var(--draw-canvas);" in css
assert "mist-violet" not in css
assert not re.search(r"#[0-9a-fA-F]{3,6}\b", css)
# 옛 자체 단추 규칙은 부품이 대신함
for gone in (
".cad-statusbar button",
".cad-view-controls button",
".cad-quick-properties__header",
".cad-frame-tokens__button",
".cad-inspector-tabs button",
):
assert gone not in css, gone