feat(B05): 계획노선 편집 겉틀 = 공용 모달 조각 — 배경 ui-modal__backdrop · 제목줄 ui-modal__top · 겹치는 CSS 지움 · 횡단 시험 하네스 ResizeObserver 대체(127-1)
openModal 은 안 씀 — 바깥 누름 · Esc 닫기 · 제목줄 단추 묶음 · 오른쪽 횡단 칸을 못 담음. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { createButton } from "@ui/ui_template_elements";
|
||||
import "@ui/ui_template_modal.css";
|
||||
|
||||
/* =============================================================================
|
||||
* B05_Profile_UI_RouteEdit_Chrome.ts
|
||||
@@ -10,6 +11,9 @@ import { createButton } from "@ui/ui_template_elements";
|
||||
* **배치**(2026-09-12 사용자 지시 ⑩~⑬·⑱) — 아래 정보행을 없애고 지도 위 오버레이로 옮겼다.
|
||||
* 단추는 제목행 오른쪽, 조작 설명은 지도 왼쪽 위 2열, 상태·범례는 왼쪽 아래, 잰 값은 오른쪽
|
||||
* 아래. 메인 창은 왼쪽으로 밀고 오른쪽 세로 칸에 횡단 두 판이 앉는다.
|
||||
*
|
||||
* 겉틀 — 배경 · 제목줄은 공용 모달 조각(`ui-modal__backdrop` · `ui-modal__top`). `openModal` 은
|
||||
* 안 씀 — 바깥 누름 · Esc 로 닫혀 고치던 노선을 날리고, 제목줄에 단추 묶음 · 오른쪽 횡단 칸이 못 앉음.
|
||||
* ========================================================================== */
|
||||
|
||||
/** 회전 단추 아이콘 — **반만 도는 화살표**(2026-09-12 사용자 지시 ㉙). 한 바퀴를 다 그린
|
||||
@@ -37,11 +41,11 @@ export interface RouteEditChrome {
|
||||
/** 모달을 만들어 `document.body` 에 붙이고, 자주 쓰는 요소를 집어 돌려준다. */
|
||||
export function createRouteEditChrome(): RouteEditChrome {
|
||||
const overlay = document.createElement("div");
|
||||
overlay.className = "b05-routeedit";
|
||||
overlay.className = "ui-modal__backdrop b05-routeedit";
|
||||
overlay.innerHTML = `
|
||||
<div class="b05-routeedit__box" role="dialog" aria-label="계획노선 편집">
|
||||
<div class="b05-routeedit__head">
|
||||
<strong>계획노선 편집</strong>
|
||||
<div class="ui-modal__top b05-routeedit__head">
|
||||
<h3>계획노선 편집</h3>
|
||||
<span class="b05-routeedit__rec-now" data-rec-now></span>
|
||||
<span class="b05-routeedit__actions">
|
||||
<button type="button" class="ui-btn ui-btn--ghost" data-act="recommend" disabled
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
/* 계획노선 편집 모달 — 큰 모달 하나. 계산이 오래 걸리는 조작이라 화면을 통째로 덮는다
|
||||
(2026-09-06 사용자 확정). 색은 전부 테마 토큰을 쓴다. */
|
||||
(2026-09-06 사용자 확정). 색은 전부 테마 토큰을 쓴다.
|
||||
배경(덮기 · 겹 · 색)은 공용 `.ui-modal__backdrop` — 여기는 칸 사이 · 가장자리만. */
|
||||
|
||||
.b05-routeedit {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: var(--z-modal, 1000);
|
||||
display: flex;
|
||||
gap: var(--spacing-12);
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: var(--spacing-12);
|
||||
background: rgb(0 0 0 / 55%);
|
||||
}
|
||||
|
||||
/* 메인 창은 **왼쪽**, 횡단 두 판은 오른쪽 세로 칸(2026-09-12 사용자 지시 ⑱).
|
||||
@@ -24,16 +18,14 @@
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: var(--radius-16, 12px);
|
||||
border-radius: var(--radius-xl);
|
||||
background: var(--color-surface-raised);
|
||||
box-shadow: 0 12px 40px rgb(0 0 0 / 45%);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
/* 제목줄 꼴(가로 · 가운데 · 간격)은 공용 `.ui-modal__top` — 여기는 띠 테두리만. */
|
||||
.b05-routeedit__head {
|
||||
display: flex;
|
||||
flex: none;
|
||||
align-items: center;
|
||||
gap: var(--spacing-12);
|
||||
padding: var(--spacing-12) var(--spacing-16);
|
||||
border-bottom: 1px solid var(--color-border);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,11 @@ const fakeEl = () => ({
|
||||
getBoundingClientRect: () => ({ width: 300, height: 200 }),
|
||||
});
|
||||
globalThis.document = { createElement: fakeEl };
|
||||
// node 에는 ResizeObserver 가 없음 — 횡단 판 크기 따라가기는 이 시험 밖
|
||||
globalThis.ResizeObserver = class {
|
||||
observe() {}
|
||||
disconnect() {}
|
||||
};
|
||||
|
||||
const asked = [];
|
||||
const STUBS = {
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
"""계획노선 편집 겉틀 = 공용 모달 조각(PLAN 127-1) — 배경 · 제목줄은 공용 클래스, 닫기 규칙은 그대로."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
PAGE = ROOT / "B05_Profile"
|
||||
|
||||
|
||||
def _block(css: str, selector: str) -> str:
|
||||
found = re.search(rf"^{re.escape(selector)} \{{([^}}]*)\}}", css, re.M)
|
||||
assert found, selector
|
||||
return found.group(1)
|
||||
|
||||
|
||||
def test_겉틀은_공용_모달_조각():
|
||||
chrome = (PAGE / "B05_Profile_UI_RouteEdit_Chrome.ts").read_text(encoding="utf-8")
|
||||
assert 'import "@ui/ui_template_modal.css";' in chrome
|
||||
assert '"ui-modal__backdrop b05-routeedit"' in chrome
|
||||
assert '<div class="ui-modal__top b05-routeedit__head">' in chrome
|
||||
assert "<h3>계획노선 편집</h3>" in chrome
|
||||
assert "<strong>계획노선 편집</strong>" not in chrome
|
||||
# 시험 · 배선이 집는 자리는 남김
|
||||
for hook in (
|
||||
'data-act="apply"',
|
||||
'data-act="cancel"',
|
||||
"b05-routeedit__close",
|
||||
"b05-routeedit__measure-close",
|
||||
):
|
||||
assert hook in chrome
|
||||
|
||||
|
||||
def test_겹치는_CSS는_공용에_맡김():
|
||||
css = (PAGE / "B05_Profile_UI_Style_RouteEdit.css").read_text(encoding="utf-8")
|
||||
overlay = _block(css, ".b05-routeedit")
|
||||
for prop in ("position:", "z-index:", "background:", "align-items:"):
|
||||
assert prop not in overlay
|
||||
head = _block(css, ".b05-routeedit__head")
|
||||
for prop in ("display:", "align-items:", "gap:"):
|
||||
assert prop not in head
|
||||
|
||||
|
||||
def test_바깥_누름_Esc_로_안_닫힘():
|
||||
main = (PAGE / "B05_Profile_UI_RouteEdit.ts").read_text(encoding="utf-8")
|
||||
assert "openModal" not in main
|
||||
assert "Escape" not in main
|
||||
Reference in New Issue
Block a user