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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user