refactor(B06): 등록표 키를 쓰는 자리가 저장소를 직접 고르지 않게
오늘 같은 계통이 두 번 났음 — 키는 등록표에서 받는데 **저장소는 제 맘대로** 고르는 자리. · `rockb` — 키를 날문자열로 만들어 읽는 쪽이 늘 빈 값(`f8fafd23`) · 화면 취향 — 키는 맞았는데 저장소를 직접 골라 **절반만** 옮겨짐(`9db84d9d`) 남은 두 자리(암 경계선 저장·표시 반폭)도 `storageOf` 를 거치게 함. 지금은 둘 다 초안이라 세션이 맞지만, 통이 바뀌면 조용히 갈릴 자리였음. 그물도 넓힘(`test_session_keys_registered.py`) — 등록표 키를 쓰는 파일이 저장소를 이름으로 직접 고르면 깨짐. 고르는 곳은 `b_page_state` 하나. 앱 전역 값(`CURRENT_PROJECT_ID_KEY`)은 등록표 밖이라 제외하고 이유를 적어 둠. **훑어 보니 남은 위반 0곳.** Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import { writeCrossDesignChoice } from "./B06_Section_Cross_Design_Session";
|
||||
import { CURRENT_PROJECT_ID_KEY, ROUTES } from "@config/config_frontend";
|
||||
import { leaveForDashboard } from "../A00_Common/b_missing_data_guard";
|
||||
import { stateKey } from "../A00_Common/b_page_state";
|
||||
import { stateKey, storageOf } from "../A00_Common/b_page_state";
|
||||
import { navigateTo } from "../A00_Common/router";
|
||||
import { createButton, createInputField, showToast } from "@ui/ui_template_elements";
|
||||
import type {
|
||||
StructureInstance,
|
||||
StructureType,
|
||||
} from "../B05_Profile/B05_Profile_Api_Structures";
|
||||
import type { StructureInstance, StructureType } from "../B05_Profile/B05_Profile_Api_Structures";
|
||||
import { createWorkflowLayout } from "@ui/ui_template_workflow_layout";
|
||||
import { attachCollapsible } from "@ui/ui_template_collapsible";
|
||||
import { workflowSteps } from "../A00_Common/b_page_scaffold";
|
||||
@@ -144,8 +141,7 @@ export async function renderB06ProfileCross(root: HTMLElement): Promise<void> {
|
||||
// 「구조물 배치」 — B05와 같은 컨테이너·하단 목록 템플릿(2026-08-29 일원화).
|
||||
// 하단 고정 dock 도 B05와 같은 구조: [구조물 목록][구분선][액션 버튼 행].
|
||||
let structureMarksSink:
|
||||
| ((structures: StructureInstance[], types: StructureType[]) => void)
|
||||
| null = null;
|
||||
((structures: StructureInstance[], types: StructureType[]) => void) | null = null;
|
||||
const structuresPanel = createB06StructuresPanel({
|
||||
projectId,
|
||||
// 횡단도·3D 넘김값에서 고른 것이 폼에 실릴 때 좌측 패널을 펼친다(2026-09-04 사용자).
|
||||
@@ -533,7 +529,7 @@ export async function renderB06ProfileCross(root: HTMLElement): Promise<void> {
|
||||
const width = crossHalfWidth();
|
||||
if (!key || width === undefined) return;
|
||||
try {
|
||||
window.sessionStorage.setItem(key, String(width));
|
||||
storageOf(key).setItem(key, String(width));
|
||||
} catch {
|
||||
/* 무시 */
|
||||
}
|
||||
@@ -712,7 +708,7 @@ export async function renderB06ProfileCross(root: HTMLElement): Promise<void> {
|
||||
// 세션에 보관된 표시 반폭이 있으면 그것이 우선한다(사용자가 마지막으로 지정한 값).
|
||||
const sessionDisplayKey = displaySessionKey();
|
||||
if (sessionDisplayKey) {
|
||||
const sessionDisplay = Number(window.sessionStorage.getItem(sessionDisplayKey));
|
||||
const sessionDisplay = Number(storageOf(sessionDisplayKey).getItem(sessionDisplayKey));
|
||||
if (Number.isFinite(sessionDisplay) && sessionDisplay > 0)
|
||||
crossHalfWidthField.input.value = sessionDisplay.toFixed(1);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import { flushPendingPipes } from "../B05_Profile/B05_Profile_Api_Pipes_Draft";
|
||||
import { flushPendingStructures } from "../B05_Profile/B05_Profile_Api_Structures";
|
||||
import { flushUphillOverrides } from "../B05_Profile/B05_Profile_Api_Fetch";
|
||||
import { buildCrossPatches, type CrossPatchSources } from "./B06_Section_UI_Page_Patches";
|
||||
import { readState } from "../A00_Common/b_page_state";
|
||||
import { readState, storageOf } from "../A00_Common/b_page_state";
|
||||
import {
|
||||
applyStructureAreaRows,
|
||||
STRUCTURE_AREA_KEYS,
|
||||
@@ -92,7 +92,7 @@ export function createRockBoundaryStore(options: {
|
||||
const storageKey = sessionKey();
|
||||
if (!storageKey) return;
|
||||
try {
|
||||
window.sessionStorage.setItem(storageKey, JSON.stringify(Object.fromEntries(offsets)));
|
||||
storageOf(storageKey).setItem(storageKey, JSON.stringify(Object.fromEntries(offsets)));
|
||||
} catch {
|
||||
/* 세션 저장 실패는 무시(용량 초과 등) — 값은 메모리에 유지된다. */
|
||||
}
|
||||
@@ -105,7 +105,7 @@ export function createRockBoundaryStore(options: {
|
||||
const storageKey = sessionKey();
|
||||
if (!storageKey) return;
|
||||
try {
|
||||
const raw = window.sessionStorage.getItem(storageKey);
|
||||
const raw = storageOf(storageKey).getItem(storageKey);
|
||||
if (!raw) return;
|
||||
const parsed = JSON.parse(raw) as Record<string, number>;
|
||||
Object.entries(parsed).forEach(([chainage, offset]) => {
|
||||
|
||||
Reference in New Issue
Block a user