fix(layout): admin 탭 영어 fallback title 을 메뉴 한글명으로 갱신

URL 직접 진입 / sessionStorage 복원 시 AppLayout 의 fallback
(pathname.split('/').pop()) 이 path segment 를 그대로 탭 title 로
사용해서 '부서관리' 대신 'deptMngList' 같은 영어가 표시되던 문제.

- tabStore: updateTabTitle(tabId, title) 추가
- AppLayout: uiMenus 로드 후 admin 탭들의 admin_url 매칭하여
  menu_name_kor (tabTitle/label/name) 로 갱신

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 11:10:01 +09:00
parent f0781022de
commit 36d93d91cf
2 changed files with 27 additions and 0 deletions
+16
View File
@@ -902,6 +902,22 @@ function AppLayoutInner({ children }: AppLayoutProps) {
}
}, [activeTab, uiMenus, isMenuActive]);
// URL 직접 진입 / sessionStorage 복원 시 admin 탭의 영어 path-segment title 을
// menu_name_kor (uiMenus 의 tabTitle/label/name) 로 한 번만 갱신.
useEffect(() => {
if (uiMenus.length === 0) return;
const store = useTabStore.getState();
for (const tab of store.admin.tabs) {
if (tab.type !== "admin" || !tab.admin_url) continue;
const matched = uiMenus.find((m: any) => m.url === tab.admin_url);
const koreanTitle: string | undefined =
matched?.tabTitle || matched?.label || matched?.name;
if (koreanTitle && tab.title !== koreanTitle) {
store.updateTabTitle(tab.id, koreanTitle);
}
}
}, [uiMenus]);
if (!user) {
return (
<div className="flex h-screen items-center justify-center">