Studio: keep the sidebar bottom fade in sync when groups collapse (#6640)

The fade is recomputed on a group's open/close state flip, but the groups
animate their height, so it measured scrollHeight mid-animation and the
fade could vanish at random. Re-measure on the collapsible animationend,
and add the missing pinnedOpen dep to the recompute effect.
This commit is contained in:
Michael Han 2026-06-24 05:46:49 -07:00 committed by GitHub
parent 61eb9eabd0
commit 8750d86cf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -454,6 +454,7 @@ export function AppSidebar() {
chatOpen,
trainOpen,
runsOpen,
pinnedOpen,
isStudioRoute,
]);
@ -1103,6 +1104,16 @@ export function AppSidebar() {
<SidebarContent
ref={scrollRef}
onScroll={(e) => syncScrollState(e.currentTarget)}
// Collapsible groups animate their height; re-measure the fade once the
// open/close animation settles, not on the (still-animating) state flip.
onAnimationEnd={(e) => {
if (
e.animationName === "collapsible-down" ||
e.animationName === "collapsible-up"
) {
syncScrollState(e.currentTarget);
}
}}
className={cn(
// pb-2 keeps the last row's rounded highlight clear of the
// overflow clip edge so its bottom corners aren't shaved off.