[agent-pipeline] rollback to d3acf391

This commit is contained in:
DDD1542
2026-03-17 18:17:51 +09:00
parent 9dc2959601
commit ad48b22770
2 changed files with 30 additions and 34 deletions

View File

@@ -490,12 +490,12 @@ function AppLayoutInner({ children }: AppLayoutProps) {
const menuObjid = parseInt((menu.objid || menu.id)?.toString() || "0");
if (activeTab?.type === "admin" && activeTab?.adminUrl) {
if (activeTab.type === "admin" && activeTab.adminUrl) {
return menu.url === activeTab.adminUrl;
}
if (activeTab?.type === "screen") {
if (activeTab?.menuObjid != null && menuObjid === activeTab.menuObjid) return true;
if (activeTab?.screenId != null && menu.screenId === activeTab.screenId) return true;
if (activeTab.type === "screen") {
if (activeTab.menuObjid != null && menuObjid === activeTab.menuObjid) return true;
if (activeTab.screenId != null && menu.screenId === activeTab.screenId) return true;
}
return false;
},
@@ -562,34 +562,6 @@ function AppLayoutInner({ children }: AppLayoutProps) {
);
};
const uiMenus = user ? convertMenuToUI(currentMenus, user as ExtendedUserInfo) : [];
// 활성 탭에 해당하는 메뉴가 속한 부모 메뉴 자동 확장 (기존 확장 상태 유지, 추가만 함)
useEffect(() => {
if (!activeTab || uiMenus.length === 0) return;
const toExpand: string[] = [];
for (const menu of uiMenus) {
if (menu.hasChildren && menu.children) {
const hasActiveChild = menu.children.some((child: any) => isMenuActive(child));
if (hasActiveChild) toExpand.push(menu.id);
}
}
if (toExpand.length > 0) {
setExpandedMenus((prev) => {
const next = new Set(prev);
let changed = false;
toExpand.forEach((id) => {
if (!next.has(id)) {
next.add(id);
changed = true;
}
});
return changed ? next : prev;
});
}
}, [activeTab, uiMenus, isMenuActive]);
if (isPreviewMode) {
return (
<div className="bg-background h-screen w-full overflow-auto p-4">{children}</div>
@@ -607,6 +579,30 @@ function AppLayoutInner({ children }: AppLayoutProps) {
);
}
const uiMenus = convertMenuToUI(currentMenus, user as ExtendedUserInfo);
// 활성 탭에 해당하는 메뉴가 속한 부모 메뉴 자동 확장
useEffect(() => {
if (!activeTab || uiMenus.length === 0) return;
const toExpand: string[] = [];
for (const menu of uiMenus) {
if (menu.hasChildren && menu.children) {
const hasActiveChild = menu.children.some((child: any) => isMenuActive(child));
if (hasActiveChild && !expandedMenus.has(menu.id)) {
toExpand.push(menu.id);
}
}
}
if (toExpand.length > 0) {
setExpandedMenus((prev) => {
const next = new Set(prev);
toExpand.forEach((id) => next.add(id));
return next;
});
}
}, [activeTab, uiMenus, isMenuActive, expandedMenus]);
return (
<div className="bg-background flex h-screen flex-col">
{/* 모바일 헤더 */}