This commit is contained in:
Macbook
2026-07-12 05:37:13 +09:00
parent 9c49b01d7f
commit 3c57a28edd
6 changed files with 49 additions and 6 deletions
+3 -2
View File
@@ -83,8 +83,9 @@ export default function AgentShell({ shop = false }: Props) {
setOpenCards((prev) => {
const next = { ...prev }
sections.forEach((sec) => {
// 기본은 접힘. 현재 경로가 속한 섹션만 펼침
if (next[sec.id] === undefined) {
next[sec.id] = sectionContainsPath(sec, location.pathname) || sec.items.length <= 1
next[sec.id] = sectionContainsPath(sec, location.pathname)
}
if (sectionContainsPath(sec, location.pathname)) next[sec.id] = true
})
@@ -201,7 +202,7 @@ export default function AgentShell({ shop = false }: Props) {
{!collapsed && (
<aside className="leftpanel" style={{ width: panelWidth }}>
{sections.map((sec) => {
const open = openCards[sec.id] !== false
const open = openCards[sec.id] === true
const activeSec = sectionContainsPath(sec, location.pathname)
return (
<div className={`lp-card${activeSec ? ' is-active' : ''}`} key={sec.id}>