Merge remote-tracking branch 'origin/sub_laptop_5' into sub_laptop_4

This commit is contained in:
2026-10-11 14:01:55 +09:00
8 changed files with 92 additions and 18 deletions
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
"""PLAN 177-1 — 구조물 조합 미연결 라벨 = 연한 노랑(경고) 배경 + 테두리(소스 시험)."""
"""PLAN 177-1 → 258-3 — 구조물 조합 미연결 라벨 = 옅은 회색(구조물 리스트 램프 색) 배경 + 테두리(소스 시험)."""
import os
import re
@@ -15,10 +15,10 @@ def _rule(sel: str) -> str:
return m.group(1)
def test_미연결_배경_테두리_경고색_글자색_없음():
def test_미연결_배경_테두리_회색_글자색_없음():
body = _rule(".b05-structure__summary-name:not(.is-assigned)")
assert re.search(r"border-color:\s*var\(--color-warning\)", body)
assert re.search(r"background:\s*color-mix\([^;]*--color-warning[^;]*--color-surface", body)
assert re.search(r"border-color:\s*var\(--color-text-muted\)", body)
assert re.search(r"background:\s*color-mix\([^;]*--color-text-muted[^;]*--color-surface", body)
assert not re.search(r"(^|[;\s])color:", body)
@@ -1,7 +1,7 @@
"""243-1 · 126 — B08 · B09 값 고칠 수 있는 표 전부 더블클릭 입력 · 고칠 칸 테두리 = 246-1 에서 지움.
"""243-1 · 126 — B08 · B09 값 고칠 수 있는 표 전부 더블클릭 입력 · 고칠 칸 테두리 = 258-2 에서 옅게 되살림.
- 공용 표 editOnDouble = 한 번 누름 = 글 상자 안 열림 · 더블클릭 · 칸 누른 뒤 Enter · F2 = 그 칸 글 상자
- 고칠 수 있는 칸(td) 표시 `is-can-edit` 없음(246-1 · 241 앞 모양)
- 고칠 수 있는 칸(td) = 글일 때도 `is-can-edit`(옅은 outline · 258-2) · 못 고치는 칸 · 옛 방식 표 = 없음
- B09 = 표 만드는 길 한 곳(Shell) · B08 = 고칠 칸 있는 표(자재 집계표 셋) 모두 editOnDouble
- 칸 누름으로 여는 메뉴 · 고르기 · 이동(onCellClick · choices · link)은 그대로
"""
@@ -76,7 +76,7 @@ setTimeout(() => {
def test_공용_표_더블클릭_Enter_F2():
out = json.loads(_node(TABLE + HARNESS + SCENE_JS))
assert out["can"] == [] # 246-1 고칠 칸 td 표시 없음
assert out["can"] == ["3"] # 고칠 수 있는 칸만 · 글일 때도 표시(258-2)
assert out["start"] == [] # 처음 = 글 상자 없음
assert out["click"] == [[], ["click 1:qty"]] # 한 번 누름 = 안 열림 · 누름 알림은 그대로
assert out["f2"] == ["1:qty"] # F2 = 누른 칸 입력
@@ -90,10 +90,18 @@ def test_공용_표_더블클릭_Enter_F2():
assert out["old"] == [["1:qty"], []] # editOnDouble 없는 표 = 예전대로(테두리 class 없음)
def test_고칠_칸_테두리_CSS_없음():
def test_고칠_칸_테두리_CSS_옅게_테마_변수만():
css = (ROOT / "ui_template" / "ui_template_data_table.css").read_text("utf-8")
ts = (ROOT / "ui_template" / "ui_template_data_table.ts").read_text("utf-8")
assert "is-can-edit" not in css and "is-can-edit" not in ts # 246-1 되돌림
m = re.search(r"\.ui-data-table__table td\.is-can-edit \{([^}]*)\}", css)
assert m
body = m.group(1)
assert (
"outline: 1px solid color-mix(in srgb, var(--color-accent) 28%, var(--color-canvas));"
in body
)
assert "outline-offset: -1px;" in body # 칸 크기 불변
assert "box-shadow" not in body # 빨강 이동 상자(box-shadow)와 안 겹침
assert "#" not in body # 하드코딩 색 없음
def _sources(*folders: str) -> list[Path]:
@@ -16,11 +16,12 @@ ROOT = Path(__file__).resolve().parents[2]
OLD_ADDS = ["위에 줄 추가", "아래에 줄 추가", "아래에 하위 줄 추가", "새 공종 추가(1단)"]
def test_입력_칸_테두리_없음():
def test_입력_칸_채움_색_td_테두리_옅게():
css = (ROOT / "ui_template" / "ui_template_data_table.css").read_text("utf-8")
body = css.split(".ui-data-table__input {")[1].split("}")[0]
assert "background: color-mix(in srgb, var(--color-accent) 5%, var(--color-canvas));" in body
assert "box-shadow" not in body and "is-can-edit" not in css
assert "box-shadow" not in body
assert "td.is-can-edit {" in css # 258-2 — 고칠 칸 옅은 outline 되살림
def test_더함_하나_줄_삭제_연결_이름_셋():
@@ -0,0 +1,52 @@
"""258-1 · 258-2 · 258-3 — 표 폭 CSS 변수 · 입력 칸 테두리 옅게 · 구조물 조합 미지정 회색(소스 시험).
- 템플릿 표 인라인 = `--dt-w`(열 합) · css `width: var(--dt-w)` → 페이지 css 가 width 로 덮음
- 거리이정표 표 = 틀 폭 100%
- 고칠 칸 td.is-can-edit = accent 28% outline · box-shadow 아님
- B05 미지정 = 회색(text-muted)
"""
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
DT_CSS = ROOT / "ui_template" / "ui_template_data_table.css"
DT_TS = ROOT / "ui_template" / "ui_template_data_table.ts"
def _rule(css: str, selector: str) -> str:
m = re.search(re.escape(selector) + r" \{([^}]*)\}", css)
assert m, selector
return m.group(1)
def test_표_폭_인라인_변수_css_width_변수():
ts = DT_TS.read_text("utf-8")
assert '<table class="ui-data-table__table" style="--dt-w:${x}px">' in ts
assert 'style="width:${x}px"' not in ts # 인라인 width 가 페이지 css 를 이기지 않음
body = _rule(DT_CSS.read_text("utf-8"), ".ui-data-table__table")
assert "width: var(--dt-w);" in body
assert "table-layout: fixed;" in body
def test_거리이정표_표_틀_폭_전체():
css = (ROOT / "B08_Quantity" / "B08_Quantity_UI_Milestone.css").read_text("utf-8")
body = _rule(css, ".b08-milestone > .ui-data-table .ui-data-table__table")
assert "width: 100%;" in body # 변수 규칙(0,1,0)보다 선택자가 구체적
def test_입력_칸_테두리_옅게_outline():
css = DT_CSS.read_text("utf-8")
body = _rule(css, ".ui-data-table__table td.is-can-edit")
m = re.search(r"var\(--color-accent\) (\d+)%", body)
assert m and 25 <= int(m.group(1)) <= 30 # 예전 60% → 옅게
assert "outline: 1px solid" in body and "box-shadow" not in body
assert '"is-can-edit"' in DT_TS.read_text("utf-8")
def test_구조물_조합_미지정_회색():
css = (ROOT / "B05_Profile" / "B05_Profile_UI_Style_Structures.css").read_text("utf-8")
body = _rule(css, ".b05-structure__summary-name:not(.is-assigned)")
assert "border-color: var(--color-text-muted);" in body
assert "--color-text-muted" in body.split("background:")[1]
assert "--color-warning" not in body
+1 -1
View File
@@ -108,7 +108,7 @@ def test_155_1_글자_14px_열_폭_같은_비율(r):
assert abs(r["scale"] - 14 / 12) < 1e-9
w = r["widths"]
assert '<col style="width:112px"><col style="width:98px"><col style="width:140px">' in w
assert 'style="width:350px"' in w # 표 폭 = 112 + 98 + 140
assert 'style="--dt-w:350px"' in w # 표 폭 = 112 + 98 + 140 (258-1 · css 변수)
assert 'class="is-frozen is-edge" style="left:112px"' in w # 둘째 고정 열 left 도 같이
assert "font-size: var(--text-body-sm);" in r["css"]
assert "--dt-row-h: 28px;" in r["css"]