Co-Authored-By: Claude Opus 5
}`}
>
{icon}
- <span>{label}</span>
+ {/* min-w-0: flex 아이템 기본 min-width:auto가 truncate의 overflow-hidden을 무력화하는
+ 문제 대응. 접힘 폭(md:w-16)에서 라벨이 글자 단위로 세로 줄바꿈되던 것을 방지한다
+ (한 줄 유지 + 말줄임) — 접힘 시 아이콘 전용 표시로 전환하는 것이 정식 해법이나
+ 아이콘 자산이 없어 이번 범위에서는 다루지 않는다. */}
+ <span className="min-w-0 truncate">{label}</span>
</Link>
);
}
export function Sidebar({ header, children, footer, className }: SidebarProps) {
return (
<aside
- className={`flex h-full w-64 flex-col border-r border-border bg-surface ${className ?? ""}`}
+ // h-full(퍼센트 높이)을 쓰지 않는다 — 부모가 flex-grow로 산출한 높이는 CSS 퍼센트
+ // 해석의 기준(containing block)이 되지 못해 h-full이 auto로 무너질 수 있다. 대신
+ // 명시적 높이를 지정하지 않아(auto) 부모 flex 컨테이너의 기본 align-items:stretch가
+ // 그대로 적용되게 한다 — 이 방식은 부모 높이가 퍼센트든 flex-grow든 항상 안정적으로
+ // 동작한다.
+ className={`flex w-64 flex-col border-r border-border bg-surface ${className ?? ""}`}
{header && <div className="border-b border-border p-4">{header}</div>}
<nav className="flex-1 overflow-y-auto p-2">{children}</nav>
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?