mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
🔧 fix: Dev Deployment, Mistral OCR Error, and UI Consistency (#7668)
* 🔧 fix: Update ProgressText and ToolCall components for improved error handling and localization * 🔧 chore: Format ESLint configuration for improved readability and remove unused rule * 🔧 refactor: Simplify ProgressText component logic for better readability and maintainability * 🔧 refactor: Update ProgressText and ToolCall components for improved layout consistency * 🔧 refactor: Simplify icon rendering in TTS components and enhance button rendering logic in HoverButtons * 🔧 refactor: Update placeholder logic in VariableForm component to simply use variable name * fix: .docx. .pptx Mistral OCR Error with `image_limit=0` * chore: Update deploy workflow to include conditions for successful dev branch deployment and streamline deployment steps * ci: Set image_limit to 0 in MistralOCR service tests for consistent behavior
This commit is contained in:
parent
a2fc7d312a
commit
f9d40784f0
10 changed files with 95 additions and 52 deletions
|
|
@ -25,16 +25,16 @@ export function BrowserTTS({
|
|||
content,
|
||||
});
|
||||
|
||||
const renderIcon = (size: string) => {
|
||||
const renderIcon = () => {
|
||||
if (isLoading === true) {
|
||||
return <Spinner size={size} />;
|
||||
return <Spinner className="icon-md-heavy h-[18px] w-[18px]" />;
|
||||
}
|
||||
|
||||
if (isSpeaking === true) {
|
||||
return <VolumeMuteIcon size={size} />;
|
||||
return <VolumeMuteIcon className="icon-md-heavy h-[18px] w-[18px]" />;
|
||||
}
|
||||
|
||||
return <VolumeIcon size={size} />;
|
||||
return <VolumeIcon className="icon-md-heavy h-[18px] w-[18px]" />;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -68,13 +68,13 @@ export function BrowserTTS({
|
|||
renderButton({
|
||||
onClick: handleClick,
|
||||
title: title,
|
||||
icon: renderIcon('19'),
|
||||
icon: renderIcon(),
|
||||
isActive: isSpeaking,
|
||||
className,
|
||||
})
|
||||
) : (
|
||||
<button className={className} onClickCapture={handleClick} type="button" title={title}>
|
||||
{renderIcon('19')}
|
||||
{renderIcon()}
|
||||
</button>
|
||||
)}
|
||||
<audio
|
||||
|
|
@ -100,7 +100,14 @@ export function BrowserTTS({
|
|||
);
|
||||
}
|
||||
|
||||
export function ExternalTTS({ isLast, index, messageId, content, className }: TMessageAudio) {
|
||||
export function ExternalTTS({
|
||||
isLast,
|
||||
index,
|
||||
messageId,
|
||||
content,
|
||||
className,
|
||||
renderButton,
|
||||
}: TMessageAudio) {
|
||||
const localize = useLocalize();
|
||||
const playbackRate = useRecoilValue(store.playbackRate);
|
||||
|
||||
|
|
@ -111,16 +118,16 @@ export function ExternalTTS({ isLast, index, messageId, content, className }: TM
|
|||
content,
|
||||
});
|
||||
|
||||
const renderIcon = (size: string) => {
|
||||
const renderIcon = () => {
|
||||
if (isLoading === true) {
|
||||
return <Spinner size={size} />;
|
||||
return <Spinner className="icon-md-heavy h-[18px] w-[18px]" />;
|
||||
}
|
||||
|
||||
if (isSpeaking === true) {
|
||||
return <VolumeMuteIcon size={size} />;
|
||||
return <VolumeMuteIcon className="icon-md-heavy h-[18px] w-[18px]" />;
|
||||
}
|
||||
|
||||
return <VolumeIcon size={size} />;
|
||||
return <VolumeIcon className="icon-md-heavy h-[18px] w-[18px]" />;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -141,19 +148,33 @@ export function ExternalTTS({ isLast, index, messageId, content, className }: TM
|
|||
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
className={className}
|
||||
onClickCapture={() => {
|
||||
if (audioRef.current) {
|
||||
audioRef.current.muted = false;
|
||||
}
|
||||
toggleSpeech();
|
||||
}}
|
||||
type="button"
|
||||
title={isSpeaking === true ? localize('com_ui_stop') : localize('com_ui_read_aloud')}
|
||||
>
|
||||
{renderIcon('19')}
|
||||
</button>
|
||||
{renderButton ? (
|
||||
renderButton({
|
||||
onClick: () => {
|
||||
if (audioRef.current) {
|
||||
audioRef.current.muted = false;
|
||||
}
|
||||
toggleSpeech();
|
||||
},
|
||||
title: isSpeaking === true ? localize('com_ui_stop') : localize('com_ui_read_aloud'),
|
||||
icon: renderIcon(),
|
||||
isActive: isSpeaking,
|
||||
className,
|
||||
})
|
||||
) : (
|
||||
<button
|
||||
onClickCapture={() => {
|
||||
if (audioRef.current) {
|
||||
audioRef.current.muted = false;
|
||||
}
|
||||
toggleSpeech();
|
||||
}}
|
||||
type="button"
|
||||
title={isSpeaking === true ? localize('com_ui_stop') : localize('com_ui_read_aloud')}
|
||||
>
|
||||
{renderIcon()}
|
||||
</button>
|
||||
)}
|
||||
<audio
|
||||
ref={audioRef}
|
||||
controls
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue