diff --git a/src/app/features/room/message/Message.tsx b/src/app/features/room/message/Message.tsx index 2480f215..5b8e7061 100644 --- a/src/app/features/room/message/Message.tsx +++ b/src/app/features/room/message/Message.tsx @@ -854,6 +854,11 @@ const MessageInner = as<'div', MessageProps>( const dot = useDotColor(room, mEvent, layout !== 'channel', hideReadReceipts); const screenSize = useScreenSizeContext(); const isMobile = screenSize === ScreenSize.Mobile; + // Touch-friendly action-rail sizing — one step larger on mobile so the hover + // rail is comfortable under a finger (desktop stays compact for the mouse). + const railBtnSize = isMobile ? '400' : '300'; + const railIconSize = isMobile ? '200' : '100'; + const railGap = isMobile ? '200' : '100'; // msgType comes from the parent — RoomTimeline reads // `mEvent.getContent().msgtype` synchronously and re-evaluates inside @@ -977,7 +982,7 @@ const MessageInner = as<'div', MessageProps>( {!edit && (hover || !!menuAnchor || !!emojiBoardAnchor) && (
- + {canSendReaction && ( ( - + )} @@ -1021,10 +1026,10 @@ const MessageInner = as<'div', MessageProps>( onClick={onReplyClick} data-event-id={mEvent.getId()} variant="SurfaceVariant" - size="300" + size={railBtnSize} radii="300" > - + )} {!isThreadReply && !hideThreadReplyAffordance && ( @@ -1032,20 +1037,20 @@ const MessageInner = as<'div', MessageProps>( onClick={(ev: Parameters[0]) => onReplyClick(ev, true)} data-event-id={mEvent.getId()} variant="SurfaceVariant" - size="300" + size={railBtnSize} radii="300" > - + )} {canEditEvent(mx, mEvent) && onEditId && ( onEditId(mEvent.getId())} variant="SurfaceVariant" - size="300" + size={railBtnSize} radii="300" > - + )} ( > - + @@ -1449,6 +1454,12 @@ export const Event = as<'div', EventProps>( const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setHover }); const [menuAnchor, setMenuAnchor] = useState(); const stateEvent = typeof mEvent.getStateKey() === 'string'; + // Touch-friendly action-rail sizing — mirrors MessageInner so the system/ + // state-event rail also reads comfortably under a finger on mobile. + const isMobile = useScreenSizeContext() === ScreenSize.Mobile; + const railBtnSize = isMobile ? '400' : '300'; + const railIconSize = isMobile ? '200' : '100'; + const railGap = isMobile ? '200' : '100'; const handleContextMenu: MouseEventHandler = (evt) => { if (evt.altKey || !window.getSelection()?.isCollapsed) return; @@ -1488,7 +1499,7 @@ export const Event = as<'div', EventProps>( {(hover || !!menuAnchor) && (
- + ( > - +