From dec208f11a65190d38d8386fe993c6e150e7af93 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Sat, 17 Oct 2026 17:23:07 +0900 Subject: [PATCH] =?UTF-8?q?feat(393-1):=20B05=20=EC=9A=B0=EC=B8=A1=20?= =?UTF-8?q?=ED=9A=A1=EB=8B=A8=20=ED=8C=90=20=EA=B8=B0=EB=B3=B8=20=EC=A0=91?= =?UTF-8?q?=ED=9E=98=20=E2=80=94=20=EC=98=9B=20=EC=97=B4=EB=A6=BC=20?= =?UTF-8?q?=EA=B8=B0=EC=96=B5=20=ED=95=9C=20=EB=B2=88=20=EB=B2=84=EB=A6=BC?= =?UTF-8?q?(-v2)=20=C2=B7=20=EC=B8=A1=EC=A0=90=20=EB=88=88=EA=B8=88=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=EC=97=B4=EB=A6=BC=EC=9D=80=20=EA=B8=B0?= =?UTF-8?q?=EC=96=B5=20=EC=95=88=20=ED=95=A8=20=C2=B7=20=EC=86=90=EC=9E=A1?= =?UTF-8?q?=EC=9D=B4=EB=A1=9C=20=EC=97=B0=20=EA=B2=83=EB=A7=8C=20=EA=B8=B0?= =?UTF-8?q?=EC=96=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XWh5wNNycMkbwMpACz1rte --- B05_Profile/B05_Profile_UI_RouteEdit_Chrome.ts | 6 +++--- B05_Profile/B05_Profile_UI_RouteEdit_Cross.ts | 2 +- .../tester/test_b05_routeedit_chrome_modal.py | 14 +++++++++++++- ui_template/ui_template_side_panels.ts | 14 +++++++++----- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Chrome.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Chrome.ts index 6c1273f5e..9fbeb9801 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Chrome.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Chrome.ts @@ -149,7 +149,7 @@ export function createRouteEditChrome( overlay.querySelector('[data-slot="tools"]')!.replaceWith(...tools); // 횡단 미리보기 = 패널 양식(382-1 · 손잡이 · 머리 · 폭 끌기 · 열림 · 폭 기억) · 자리는 지도 위 덮개 그대로 · - // 기억이 없으면 좁은 화면은 접힌 채 시작(지도가 먼저다) · 잰 값 창이 판을 비킴(--b05-side-open). + // 기본 접힘(393-1 · 키 -v2 = 옛 열림 기억 한 번 버림) · 손잡이로 연 것만 기억 · 잰 값 창이 판을 비킴(--b05-side-open). const side = document.createElement("div"); side.className = "b05-routeedit__side"; const setSideOpen = (): void => @@ -158,9 +158,9 @@ export function createRouteEditChrome( `${(panels.current() ? panels.width() : 0) + SIDE_HANDLE_PX}px`, ); const panels = createSidePanels({ - prefKey: "b05-routeedit-cross", + prefKey: "b05-routeedit-cross-v2", panels: [{ id: "cross", title: "횡단", body: side }], - defaultOpen: window.innerWidth >= 1500 ? "cross" : null, + defaultOpen: null, defaultWidth: 460, follow: false, onChange: setSideOpen, diff --git a/B05_Profile/B05_Profile_UI_RouteEdit_Cross.ts b/B05_Profile/B05_Profile_UI_RouteEdit_Cross.ts index 742d132f4..eeef0e76d 100644 --- a/B05_Profile/B05_Profile_UI_RouteEdit_Cross.ts +++ b/B05_Profile/B05_Profile_UI_RouteEdit_Cross.ts @@ -287,7 +287,7 @@ export function createCrossPreview(params: CrossPreviewParams): CrossPreviewWind shown = null; redraw(); const panels = sidePanelsOf.get(params.side); - if (panels && panels.current() === null) panels.open("cross"); + if (panels && panels.current() === null) panels.open("cross", false); // 열되 기억 안 함(393-1) } /** 다른 보기(종단 · 3D · 목록 · 횡단 카드) 고름 → 일반측점이면 그 측점 횡단 · 구조물이면 마름모. */ diff --git a/resources/tester/test_b05_routeedit_chrome_modal.py b/resources/tester/test_b05_routeedit_chrome_modal.py index a39b471d2..8fd6afcce 100644 --- a/resources/tester/test_b05_routeedit_chrome_modal.py +++ b/resources/tester/test_b05_routeedit_chrome_modal.py @@ -49,10 +49,22 @@ def test_겉틀은_본문_칸(): # 시험 · 배선이 집는 자리는 남김 assert "b05-routeedit__measure-close" in chrome # 382-1 — 오른쪽 횡단 판 = 패널 양식(손잡이 · 머리 · 폭 끌기 · 열림 · 폭 기억) · 칸 높이를 채움 - assert "createSidePanels({" in chrome and 'prefKey: "b05-routeedit-cross"' in chrome + assert "createSidePanels({" in chrome and 'prefKey: "b05-routeedit-cross-v2"' in chrome assert "follow: false" in chrome and 'data-act="side-toggle"' not in chrome +def test_393_1_횡단_판_기본_접힘_자동_열림은_기억_안_함(): + chrome = _read("B05_Profile_UI_RouteEdit_Chrome.ts") + assert "defaultOpen: null," in chrome and "innerWidth >= 1500" not in chrome + # 측점 눈금 → 열되 기억 안 함 · 손잡이(누름)만 기억 + cross = _read("B05_Profile_UI_RouteEdit_Cross.ts") + assert 'panels.open("cross", false)' in cross + side = (ROOT / "ui_template" / "ui_template_side_panels.ts").read_text(encoding="utf-8") + assert "function open(id: string | null, remember = true): void {" in side + assert "JSON.stringify({ open: kept, width })" in side + assert "if (remember) {\n kept = next;\n save();" in side + + def test_CSS_덮개_걷음_대기막은_전체(): css = _read("B05_Profile_UI_Style_RouteEdit.css") root = _block(css, ".b05-routeedit") diff --git a/ui_template/ui_template_side_panels.ts b/ui_template/ui_template_side_panels.ts index e60217c44..187d3525f 100644 --- a/ui_template/ui_template_side_panels.ts +++ b/ui_template/ui_template_side_panels.ts @@ -49,8 +49,8 @@ export interface SidePanelsOpts { export interface SidePanels { root: HTMLElement; - /** 열 패널(null = 모두 접음) — 기억함 */ - open(id: string | null): void; + /** 열 패널(null = 모두 접음) — 기억함 · remember 거짓 = 이번 화면만(자동 열림) */ + open(id: string | null, remember?: boolean): void; current(): string | null; width(): number; } @@ -82,7 +82,8 @@ export function createSidePanels(opts: SidePanelsOpts): SidePanels { ? (ids[0] ?? null) : opts.defaultOpen; let width = clampSideWidth(pref.width ?? opts.defaultWidth ?? 420, min, window.innerWidth); - const save = (): void => writeByKey(key, JSON.stringify({ open: now, width })); + let kept = now; // 기억할 열림 — 자동 열림은 안 셈 + const save = (): void => writeByKey(key, JSON.stringify({ open: kept, width })); const root = el("div", { className: "ui-side-panels" }); root.style.setProperty("--ui-side-panels-width", `${width}px`); @@ -159,12 +160,15 @@ export function createSidePanels(opts: SidePanelsOpts): SidePanels { root.classList.toggle("is-collapsed", now === null); }; - function open(id: string | null): void { + function open(id: string | null, remember = true): void { const next = id !== null && ids.includes(id) ? id : null; const was = now; now = next; draw(); - save(); + if (remember) { + kept = next; + save(); + } if (next !== was) opts.onChange?.(next); }