Skip to content

Commit 378a320

Browse files
authored
Add truncate for names in sidebar pane (#484)
Wraps sidebar tree labels in a truncating element so long names don't overflow. The e2e assertions were hardened separately in #508 to scope to the treeitem, so they stay valid with the wrapper.
1 parent 190754b commit 378a320

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/cli/src/components/IndexPane/CompactView.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const CompactView: React.FC<CompactViewProps> = ({
5050
role="treeitem"
5151
aria-expanded={!route.collapsed}
5252
aria-selected={i === cursor}
53-
className={cx("mb-1 cursor-pointer hover:underline", {
53+
className={cx("mb-1 pr-2 cursor-pointer hover:underline flex items-center", {
5454
"pl-2": route.level === 0,
5555
"pl-6": route.level === 1,
5656
"pl-[70px] pb-1 pt-1": route.level === 2,
@@ -85,7 +85,9 @@ const CompactView: React.FC<CompactViewProps> = ({
8585
</svg>
8686
</button>
8787
)}
88-
{route.displayName}
88+
<div aria-selected={i === cursor} className="truncate">
89+
{route.displayName}
90+
</div>
8991
</div>
9092
);
9193
})}

0 commit comments

Comments
 (0)