fix(388-3 보안): 세션 넘침 안내 — 화면 모듈을 안에서만 가져옴

- b_page_state 맨 위 로케일 가져오기가 이 파일을 Node 로 돌리는 시험(346-4 등)을 깨던 것
- 넘침 안내 때만 토스트 · 로케일을 함께 동적으로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
2026-10-17 17:56:49 +09:00
co-authored by Claude Opus 5.5
parent 3349b53a54
commit 1fa5717fca
2 changed files with 7 additions and 9 deletions
+3 -4
View File
@@ -21,8 +21,6 @@
* 않는다** — ②·④는 두 화면이 같은 키를 쓴다.
* ========================================================================== */
import { t } from "@ui/ui_template_locale";
/** 값이 속한 통. `pref`·`draft`·`result` 셋만 저장소를 쓴다(즉시 반영은 표에 없다). */
export type StateBucket = "pref" | "draft" | "result";
@@ -457,8 +455,9 @@ function setOrMakeRoom(store: Storage, key: string, value: string): void {
try {
store.setItem(key, value);
} catch (error) {
void import("@ui/ui_template_elements").then(({ showToast }) =>
showToast(t("Session_Storage_Full"), "warning", 8000),
// 화면 모듈은 안에서만 — 이 파일을 Node 로 돌리는 시험 · 묶음이 안 끌게
void Promise.all([import("@ui/ui_template_elements"), import("@ui/ui_template_locale")]).then(
([{ showToast }, { t }]) => showToast(t("Session_Storage_Full"), "warning", 8000),
);
throw error;
}
+4 -5
View File
@@ -45,11 +45,10 @@ function fakeStorage(limit = Infinity) {
global.window = { sessionStorage: fakeStorage(), localStorage: fakeStorage() };
const toasts = [];
const pageState = load("A00_Common/b_page_state.ts", (id) =>
id.includes("ui_template_locale")
? { t: (key) => key }
: { showToast: (msg, kind) => toasts.push([msg, kind]) },
);
const pageState = load("A00_Common/b_page_state.ts", () => ({
t: (key) => key,
showToast: (msg, kind) => toasts.push([msg, kind]),
}));
const purged = [];
const config = { CURRENT_PROJECT_ID_KEY: "frd_current_project_id" };
const sw = load("A00_Common/b_project_switch.ts", (id) => {