diff --git a/apps/mobile/app/(main)/chat/create.tsx b/apps/mobile/app/(main)/chat/create.tsx index 0f679f4..6b62115 100644 --- a/apps/mobile/app/(main)/chat/create.tsx +++ b/apps/mobile/app/(main)/chat/create.tsx @@ -47,7 +47,7 @@ export default function CreateChatScreen(): ReactElement { header: , }} safeAreaProps={{ edges: [] }} - keyBoardAvoidingProps={{ enabled: !isBottomSheetInputFocused }}> + keyBoardAvoidingProps={{ enabled: !isBottomSheetInputFocused, bottomOffset: 60 }}> 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} - - - {isThinking || isAiSpeaking ? : } - - - - - {isAiSpeaking - ? translate('TEXT_TALKING') - : isThinking - ? translate('TEXT_THINKING') - : translate('TEXT_LISTENING')} - - - - + + + + {isThinking || isAiSpeaking ? : } + + + + + {isAiSpeaking + ? translate('TEXT_TALKING') + : isThinking + ? translate('TEXT_THINKING') + : translate('TEXT_LISTENING')} + + + + + ); diff --git a/libs/mobile/chat/ui/message-actions-wrapper/src/lib/component.tsx b/libs/mobile/chat/ui/message-actions-wrapper/src/lib/component.tsx index df90acf..3dadebc 100644 --- a/libs/mobile/chat/ui/message-actions-wrapper/src/lib/component.tsx +++ b/libs/mobile/chat/ui/message-actions-wrapper/src/lib/component.tsx @@ -9,19 +9,23 @@ import { import { useAnimateMessage } from './hooks/use-animate-message'; interface MessageActionsSheetWrapperProps { - sheetRef?: React.RefObject; 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(); }; diff --git a/libs/mobile/shared/features/markdown-view/src/lib/component.tsx b/libs/mobile/shared/features/markdown-view/src/lib/component.tsx index 3a4e41e..50c3d65 100644 --- a/libs/mobile/shared/features/markdown-view/src/lib/component.tsx +++ b/libs/mobile/shared/features/markdown-view/src/lib/component.tsx @@ -54,7 +54,7 @@ export function AppMarkdownView({ ) => { return ( {copyButton} - {formattedContent} + + {formattedContent} + ); } diff --git a/libs/mobile/shared/ui/keyboard-avoiding-view/src/lib/component.tsx b/libs/mobile/shared/ui/keyboard-avoiding-view/src/lib/component.tsx index a98777b..a5989fc 100644 --- a/libs/mobile/shared/ui/keyboard-avoiding-view/src/lib/component.tsx +++ b/libs/mobile/shared/ui/keyboard-avoiding-view/src/lib/component.tsx @@ -1,23 +1,24 @@ import { ComponentType } from 'react'; import { ScrollViewProps, StyleProp, ViewStyle } from 'react-native'; import { KeyboardAwareScrollView } from 'react-native-keyboard-controller'; -import { commonStyle } from '@open-webui-react-native/mobile/shared/ui/styles'; export type AppKeyboardAvoidingViewProps = Omit & { onFocus?: ((event: any) => void) | null; contentContainerStyleKeyboardShown?: StyleProp; enabled?: boolean; + bottomOffset?: number; }; // TODO: Research how use nativewind here export const AppKeyboardAvoidingView: ComponentType = ({ children, ...props }) => { - const { onFocus, ...restProps } = props; + const { onFocus, contentContainerStyle, bottomOffset, ...restProps } = props; return ( {children} diff --git a/libs/mobile/shared/ui/screen-wrapper/src/lib/component.tsx b/libs/mobile/shared/ui/screen-wrapper/src/lib/component.tsx index 39dab46..ba54d59 100644 --- a/libs/mobile/shared/ui/screen-wrapper/src/lib/component.tsx +++ b/libs/mobile/shared/ui/screen-wrapper/src/lib/component.tsx @@ -26,9 +26,12 @@ export function ScreenWrapper({ keyBoardAvoidingProps, }: PropsWithChildren): ReactElement { const { header, ...restScreenProps } = screenProps || {}; + const content = isKeyboardAvoiding ? ( - {children} + + {children} + ) : ( {children} diff --git a/libs/shared/data-access/api/src/lib/knowledge/models/knowledge-response.ts b/libs/shared/data-access/api/src/lib/knowledge/models/knowledge-response.ts index 387f00f..5851bed 100644 --- a/libs/shared/data-access/api/src/lib/knowledge/models/knowledge-response.ts +++ b/libs/shared/data-access/api/src/lib/knowledge/models/knowledge-response.ts @@ -1,8 +1,9 @@ -import { Expose } from 'class-transformer'; +import { Expose, Type } from 'class-transformer'; import { Knowledge } from './knowledge'; export class KnowledgeResponse { @Expose() + @Type(() => Knowledge) public items: Array; @Expose()