mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
fix(sidebar): use fast fade instead of slide when navigating
Slide animation freezes halfway when navigation starts. Now uses instant snap + 100ms backdrop fade for agent selection. Gestures still use the slide animation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -93,17 +93,15 @@ export function SlidingSidebar({ selectedAgentId }: SlidingSidebarProps) {
|
||||
}, []);
|
||||
|
||||
// Mobile: close sidebar when agent is selected
|
||||
// Use a quick fade instead of slide since navigation interrupts the animation
|
||||
const handleAgentSelectMobile = useCallback(() => {
|
||||
// Start animation immediately, don't wait for useEffect
|
||||
translateX.value = withTiming(-windowWidth, {
|
||||
duration: ANIMATION_DURATION,
|
||||
easing: ANIMATION_EASING,
|
||||
});
|
||||
// Fast fade out - slide animations freeze during navigation
|
||||
backdropOpacity.value = withTiming(0, {
|
||||
duration: ANIMATION_DURATION,
|
||||
duration: 100,
|
||||
easing: ANIMATION_EASING,
|
||||
});
|
||||
close(); // Update state for consistency
|
||||
translateX.value = -windowWidth; // Snap immediately
|
||||
close();
|
||||
}, [close, translateX, backdropOpacity, windowWidth]);
|
||||
|
||||
// Close gesture (swipe left to close when sidebar is open)
|
||||
|
||||
Reference in New Issue
Block a user