fix(sidebar): make entire section header row clickable
All checks were successful
Build & Publish / publish (push) Successful in 2m1s

The toggle was only on the chevron button. Now the full row
(chevron + icon + label) triggers onToggle on click or Enter/Space.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-02 21:59:47 +02:00
parent 9b8739b5d8
commit 50a1296a9d
2 changed files with 13 additions and 8 deletions

View File

@@ -215,6 +215,8 @@
gap: 2px;
width: 100%;
padding: 8px 0 4px;
cursor: pointer;
user-select: none;
}
.treeSectionChevronBtn {

View File

@@ -115,15 +115,18 @@ function SidebarSection({
return (
<div className={`${styles.treeSection} ${active ? styles.treeSectionActive : ''} ${className ?? ''}`}>
<div className={styles.treeSectionToggle}>
<button
className={styles.treeSectionChevronBtn}
onClick={onToggle}
aria-expanded={open}
aria-label={open ? `Collapse ${label}` : `Expand ${label}`}
>
<div
className={styles.treeSectionToggle}
onClick={onToggle}
role="button"
tabIndex={0}
aria-expanded={open}
aria-label={open ? `Collapse ${label}` : `Expand ${label}`}
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onToggle() } }}
>
<span className={styles.treeSectionChevronBtn} aria-hidden="true">
{open ? <ChevronDown size={12} /> : <ChevronRight size={12} />}
</button>
</span>
{icon && <span className={styles.sectionIcon}>{icon}</span>}
<span className={styles.treeSectionLabel}>{label}</span>
</div>