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:
@@ -418,7 +418,6 @@ export const MobileSessionPanelTrigger: React.FC<MobileSessionPanelTriggerProps>
|
|||||||
const isMobile = useUIStore((state) => state.isMobile);
|
const isMobile = useUIStore((state) => state.isMobile);
|
||||||
const open = useUIStore((state) => state.mobileSessionPanelOpen);
|
const open = useUIStore((state) => state.mobileSessionPanelOpen);
|
||||||
const setOpen = useUIStore((state) => state.setMobileSessionPanelOpen);
|
const setOpen = useUIStore((state) => state.setMobileSessionPanelOpen);
|
||||||
const handledTouchRef = React.useRef(false);
|
|
||||||
|
|
||||||
// Ensure the cross-project session list is loaded once, so the panel reflects
|
// Ensure the cross-project session list is loaded once, so the panel reflects
|
||||||
// every project, not just the active directory.
|
// 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)]',
|
'rounded-md relative hover:bg-[var(--interactive-hover)]',
|
||||||
open && 'text-[var(--primary-base)]'
|
open && 'text-[var(--primary-base)]'
|
||||||
)}
|
)}
|
||||||
onPointerDownCapture={(event) => {
|
style={{ touchAction: 'manipulation' }}
|
||||||
if (event.pointerType === 'touch') {
|
onClick={() => setOpen(!open)}
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
handledTouchRef.current = true;
|
|
||||||
setOpen(!open);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onClick={() => {
|
|
||||||
if (handledTouchRef.current) {
|
|
||||||
handledTouchRef.current = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setOpen(!open);
|
|
||||||
}}
|
|
||||||
title={t('mobile.sessions.search.section.sessions')}
|
title={t('mobile.sessions.search.section.sessions')}
|
||||||
aria-label={t('mobile.sessions.search.section.sessions')}
|
aria-label={t('mobile.sessions.search.section.sessions')}
|
||||||
aria-expanded={open}
|
aria-expanded={open}
|
||||||
|
|||||||
Reference in New Issue
Block a user