From 3486abf2baaeed075b35227ad4a20032066ed841 Mon Sep 17 00:00:00 2001 From: tfomkin Date: Fri, 13 Feb 2026 16:39:52 +0800 Subject: [PATCH] fix: disable AI message actions long press while response is generating --- .../chat/features/ai-message-actions/src/lib/component.tsx | 7 ++++++- .../chat/src/lib/components/messages-list/component.tsx | 1 + .../chat/ui/message-actions-wrapper/src/lib/component.tsx | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libs/mobile/chat/features/ai-message-actions/src/lib/component.tsx b/libs/mobile/chat/features/ai-message-actions/src/lib/component.tsx index a7a00ff..9bff564 100644 --- a/libs/mobile/chat/features/ai-message-actions/src/lib/component.tsx +++ b/libs/mobile/chat/features/ai-message-actions/src/lib/component.tsx @@ -19,6 +19,7 @@ interface AiMessageActionsProps { onAddDetails: (messageId: string) => void; onMoreConcise: (messageId: string) => void; isLast: boolean; + isResponseGenerating: boolean; } //TODO Extend with more actions - https://www.figma.com/design/YPCZjyVlD86psDwUxvMVBc/OpenWebUI-Redesign-React-Native?node-id=27540-25291&t=kg2yUIDp3UQDStLf-0 @@ -31,6 +32,7 @@ export function AiMessageActions({ onAddDetails, onMoreConcise, isLast, + isResponseGenerating, children, }: PropsWithChildren): ReactElement { const translate = useTranslation('CHAT.AI_MESSAGE_ACTIONS'); @@ -134,7 +136,10 @@ export function AiMessageActions({ return ( - + {children} ; actions: Array; + isResponseGenerating?: boolean; + sheetRef?: React.RefObject; } export function MessageActionsSheetWrapper({ sheetRef, actions, + isResponseGenerating, children, }: PropsWithChildren): ReactElement { const actionsSheetRef = useRef(null); const { animatedStyle, startAnimation, stopAnimation } = useAnimateMessage(); const handleLongPress = (): void => { + if (isResponseGenerating) return; + startAnimation(); actionsSheetRef.current?.present(); };