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:
co-authored by
Claude Opus 4.5
parent
75895b17d4
commit
7b55740a9e
@@ -93,17 +93,15 @@ export function SlidingSidebar({ selectedAgentId }: SlidingSidebarProps) {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// Mobile: close sidebar when agent is selected
|
// Mobile: close sidebar when agent is selected
|
||||||
|
// Use a quick fade instead of slide since navigation interrupts the animation
|
||||||
const handleAgentSelectMobile = useCallback(() => {
|
const handleAgentSelectMobile = useCallback(() => {
|
||||||
// Start animation immediately, don't wait for useEffect
|
// Fast fade out - slide animations freeze during navigation
|
||||||
translateX.value = withTiming(-windowWidth, {
|
|
||||||
duration: ANIMATION_DURATION,
|
|
||||||
easing: ANIMATION_EASING,
|
|
||||||
});
|
|
||||||
backdropOpacity.value = withTiming(0, {
|
backdropOpacity.value = withTiming(0, {
|
||||||
duration: ANIMATION_DURATION,
|
duration: 100,
|
||||||
easing: ANIMATION_EASING,
|
easing: ANIMATION_EASING,
|
||||||
});
|
});
|
||||||
close(); // Update state for consistency
|
translateX.value = -windowWidth; // Snap immediately
|
||||||
|
close();
|
||||||
}, [close, translateX, backdropOpacity, windowWidth]);
|
}, [close, translateX, backdropOpacity, windowWidth]);
|
||||||
|
|
||||||
// Close gesture (swipe left to close when sidebar is open)
|
// Close gesture (swipe left to close when sidebar is open)
|
||||||
|
|||||||
Reference in New Issue
Block a user