fix(sidebar): make entire section header row clickable
All checks were successful
Build & Publish / publish (push) Successful in 2m1s
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:
@@ -215,6 +215,8 @@
|
|||||||
gap: 2px;
|
gap: 2px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 8px 0 4px;
|
padding: 8px 0 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.treeSectionChevronBtn {
|
.treeSectionChevronBtn {
|
||||||
|
|||||||
@@ -115,15 +115,18 @@ function SidebarSection({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`${styles.treeSection} ${active ? styles.treeSectionActive : ''} ${className ?? ''}`}>
|
<div className={`${styles.treeSection} ${active ? styles.treeSectionActive : ''} ${className ?? ''}`}>
|
||||||
<div className={styles.treeSectionToggle}>
|
<div
|
||||||
<button
|
className={styles.treeSectionToggle}
|
||||||
className={styles.treeSectionChevronBtn}
|
onClick={onToggle}
|
||||||
onClick={onToggle}
|
role="button"
|
||||||
aria-expanded={open}
|
tabIndex={0}
|
||||||
aria-label={open ? `Collapse ${label}` : `Expand ${label}`}
|
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} />}
|
{open ? <ChevronDown size={12} /> : <ChevronRight size={12} />}
|
||||||
</button>
|
</span>
|
||||||
{icon && <span className={styles.sectionIcon}>{icon}</span>}
|
{icon && <span className={styles.sectionIcon}>{icon}</span>}
|
||||||
<span className={styles.treeSectionLabel}>{label}</span>
|
<span className={styles.treeSectionLabel}>{label}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user