From 3becee0ded166dec2f1d9dc76c0888c8ef8fc0a4 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Tue, 21 Jul 2026 00:12:00 -0500 Subject: [PATCH] fix again (please wokr this time) --- src/app/features/room-nav/RoomNavItem.tsx | 2 +- src/app/features/room/message/styles.css.ts | 2 +- src/app/hooks/useMobileLongPress.ts | 11 ++++++++--- src/app/styles/overrides/TouchDevices.css | 5 +++++ src/client/slidingSync.test.ts | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/app/features/room-nav/RoomNavItem.tsx b/src/app/features/room-nav/RoomNavItem.tsx index 5bedaf635..de6e775ed 100644 --- a/src/app/features/room-nav/RoomNavItem.tsx +++ b/src/app/features/room-nav/RoomNavItem.tsx @@ -470,7 +470,7 @@ export function RoomNavItem({ radii="400" highlight={shouldShowUnreadIndicator} aria-selected={selected} - data-hover={!!menuAnchor || isPressing || isMobileMenuOpen} + data-hover={!!menuAnchor || isPressing} onContextMenu={handleContextMenu} {...hoverProps} {...focusWithinProps} diff --git a/src/app/features/room/message/styles.css.ts b/src/app/features/room/message/styles.css.ts index 877f12981..ed3718a36 100644 --- a/src/app/features/room/message/styles.css.ts +++ b/src/app/features/room/message/styles.css.ts @@ -10,7 +10,7 @@ export const MessageBaseBubbleCollapsed = style({ }); export const MessageForceHover = style({ - backgroundColor: color.Surface.ContainerHover, + backgroundColor: `${color.Surface.ContainerHover} !important`, }); export const MessageOptionsBase = style([ diff --git a/src/app/hooks/useMobileLongPress.ts b/src/app/hooks/useMobileLongPress.ts index a47b51c0a..a0b1463e9 100644 --- a/src/app/hooks/useMobileLongPress.ts +++ b/src/app/hooks/useMobileLongPress.ts @@ -27,7 +27,7 @@ export function useMobileLongPress(callback: () => void, delay = 500) { startY.current = e.touches[0].clientY; startX.current = e.touches[0].clientX; } - + timerRef.current = setTimeout(() => { firedRef.current = true; callback(); @@ -43,7 +43,12 @@ export function useMobileLongPress(callback: () => void, delay = 500) { const onTouchMove = useCallback( (e: React.TouchEvent | TouchEvent) => { - if (startY.current === null || startX.current === null || !('touches' in e) || !e.touches[0]) { + if ( + startY.current === null || + startX.current === null || + !('touches' in e) || + !e.touches[0] + ) { clear(); return; } @@ -56,7 +61,7 @@ export function useMobileLongPress(callback: () => void, delay = 500) { }, [clear] ); - + const onTouchCancel = useCallback(() => clear(), [clear]); return { onTouchStart, onTouchEnd, onTouchMove, onTouchCancel, firedRef, isPressing }; diff --git a/src/app/styles/overrides/TouchDevices.css b/src/app/styles/overrides/TouchDevices.css index 918f0b548..ede299820 100644 --- a/src/app/styles/overrides/TouchDevices.css +++ b/src/app/styles/overrides/TouchDevices.css @@ -27,4 +27,9 @@ html body [data-message-id][data-message-item]:hover { background-color: transparent !important; } + + * { + -webkit-tap-highlight-color: transparent !important; + -webkit-touch-callout: none !important; + } } diff --git a/src/client/slidingSync.test.ts b/src/client/slidingSync.test.ts index 45559d2eb..c62aa7e01 100644 --- a/src/client/slidingSync.test.ts +++ b/src/client/slidingSync.test.ts @@ -120,7 +120,7 @@ describe('SlidingSyncManager initial request', () => { expect(joined?.ranges).toEqual([[0, 29]]); expect(joined?.timeline_limit).toBe(1); - expect(joined?.required_state).toHaveLength(8); + expect(joined?.required_state).toHaveLength(10); expect(joined?.required_state).toContainEqual([EventType.RoomJoinRules, '']); expect(joined?.required_state).not.toContainEqual(['m.space.child', '*']); expect(updates).toMatchObject({