refactor: fixed mobile session button for android

Replaces custom pointer-capture touch logic with touch-action: manipulation
Aligns with the pattern used across other mobile surfaces
This commit is contained in:
Bohdan Triapitsyn
2026-06-16 14:46:55 +03:00
parent f3aff42b8a
commit 69e534c457
@@ -418,7 +418,6 @@ export const MobileSessionPanelTrigger: React.FC<MobileSessionPanelTriggerProps>
const isMobile = useUIStore((state) => state.isMobile);
const open = useUIStore((state) => state.mobileSessionPanelOpen);
const setOpen = useUIStore((state) => state.setMobileSessionPanelOpen);
const handledTouchRef = React.useRef(false);
// Ensure the cross-project session list is loaded once, so the panel reflects
// every project, not just the active directory.
@@ -440,21 +439,8 @@ export const MobileSessionPanelTrigger: React.FC<MobileSessionPanelTriggerProps>
'rounded-md relative hover:bg-[var(--interactive-hover)]',
open && 'text-[var(--primary-base)]'
)}
onPointerDownCapture={(event) => {
if (event.pointerType === 'touch') {
event.preventDefault();
event.stopPropagation();
handledTouchRef.current = true;
setOpen(!open);
}
}}
onClick={() => {
if (handledTouchRef.current) {
handledTouchRef.current = false;
return;
}
setOpen(!open);
}}
style={{ touchAction: 'manipulation' }}
onClick={() => setOpen(!open)}
title={t('mobile.sessions.search.section.sessions')}
aria-label={t('mobile.sessions.search.section.sessions')}
aria-expanded={open}