refactor: enhance mobile swipe gesture handling and improve outlet behavior on compact routes
Some checks failed
Build / increment-version (push) Successful in 6s
Build / build-android (push) Failing after 1m32s
Build / create-release (push) Has been skipped

This commit is contained in:
2026-07-11 20:36:10 +10:00
parent f709998c50
commit c7b6e8f5f0
10 changed files with 298 additions and 7 deletions

View File

@@ -26,6 +26,7 @@ import { useRoomCreators } from '../../hooks/useRoomCreators';
import { activeThreadIdAtomFamily } from '../../state/activeThread';
import { ThreadView } from './ThreadView';
import { MobileSwipeToReplyLayer } from '../../components/mobile/MobileSwipeToReplyLayer';
import { useMobileKeyboardLayout } from '../../hooks/useMobileKeyboardLayout';
const FN_KEYS_REGEX = /^F\d+$/;
const shouldFocusMessageField = (evt: KeyboardEvent): boolean => {
@@ -63,6 +64,7 @@ export function RoomView({ room, eventId }: { room: Room; eventId?: string }) {
const roomViewRef = useRef<HTMLDivElement>(null);
const [hideActivity] = useSetting(settingsAtom, 'hideActivity');
const { isLandscape, keyboardOpen } = useMobileKeyboardLayout();
const { roomId } = room;
const editor = useEditor();
@@ -101,9 +103,12 @@ export function RoomView({ room, eventId }: { room: Room; eventId?: string }) {
)
);
const composerPadding = isLandscape ? '0' : `0 ${config.space.S400}`;
const showHeader = !keyboardOpen;
return (
<Page ref={roomViewRef}>
<RoomViewHeader />
{showHeader && <RoomViewHeader />}
{activeThreadId ? (
<ThreadView room={room} threadRootId={activeThreadId} />
) : (
@@ -121,7 +126,7 @@ export function RoomView({ room, eventId }: { room: Room; eventId?: string }) {
</Box>
</MobileSwipeToReplyLayer>
<Box shrink="No" direction="Column" data-disable-swipe-back="true">
<div style={{ padding: `0 ${config.space.S400}` }}>
<div style={{ padding: composerPadding }}>
{tombstoneEvent ? (
<RoomTombstone
roomId={roomId}