feat: swipe gesture to open/close sidebar on mobile

Swipe right from the left edge to open the sidebar,
swipe left to close it. Standard mobile UX pattern
with edge detection, vertical drift rejection, and
time-based velocity check.
This commit is contained in:
Nicolas Varrot
2026-02-15 16:04:57 +00:00
parent 7890d34583
commit 9ee9874181
2 changed files with 83 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import { ToolCollapseProvider } from './contexts/ToolCollapseContext';
import { sessionDisplayName } from './lib/sessionName';
import { X } from 'lucide-react';
import { useT } from './hooks/useLocale';
import { useSwipeSidebar } from './hooks/useSwipeSidebar';
const Chat = lazy(() => import('./components/Chat').then(m => ({ default: m.Chat })));
@@ -83,6 +84,7 @@ export default function App() {
const [sidebarOpen, setSidebarOpen] = useState(false);
const [shortcutsOpen, setShortcutsOpen] = useState(false);
useSwipeSidebar(sidebarOpen, () => setSidebarOpen(true), () => setSidebarOpen(false));
const { notify, soundEnabled, toggleSound } = useNotifications();
const prevMessageCountRef = useRef(messages.length);