mirror of
https://github.com/unslothai/unsloth.git
synced 2026-07-09 15:58:41 +00:00
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:
parent
61eb9eabd0
commit
8750d86cf7
1 changed files with 11 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue