feat(mobile): add swipe-from-left-edge back gesture

This commit is contained in:
Jannis Braun
2026-03-17 15:37:27 +01:00
parent e45bf1927e
commit 0222946f04
2 changed files with 79 additions and 0 deletions
@@ -4,6 +4,7 @@ import { useVoiceStore } from '../../stores/voiceStore';
import { useLocation } from 'react-router-dom';
import { MobileScreenStack } from './MobileScreenStack';
import { MobileBottomNav } from './MobileBottomNav';
import { useSwipeGesture } from '../../hooks/useSwipeGesture';
// Screen components — imported as they are created in subsequent tasks.
// Inline placeholders are used until the real components exist.
@@ -45,6 +46,16 @@ export function MobileShell() {
const currentVoiceChannelId = useVoiceStore((s) => s.currentVoiceChannelId);
const location = useLocation();
// Edge swipe back gesture
useSwipeGesture({
onSwipeRight: () => {
if (mobileStack.length > 0) {
popMobileScreen();
}
},
enabled: mobileStack.length > 0,
});
// Reconstruct mobile stack from URL on mount (deep link / refresh support)
useEffect(() => {
const path = location.pathname;