mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 09:50:15 +01:00
🚀 feat: Enhance Message Editing with File Resubmission (#2347)
* chore: fix type issue with File Table fakeData * refactor: new lazy loading image strategy and load images/files as part of Message Container * feat: resubmit files when editing messages with attached files
This commit is contained in:
parent
caabab4489
commit
3411d7a543
10 changed files with 122 additions and 90 deletions
|
|
@ -3,10 +3,10 @@ import { EModelEndpoint } from 'librechat-data-provider';
|
|||
import { useState, useRef, useEffect, useCallback } from 'react';
|
||||
import { useUpdateMessageMutation } from 'librechat-data-provider/react-query';
|
||||
import type { TEditProps } from '~/common';
|
||||
import Container from '~/components/Messages/Content/Container';
|
||||
import { cn, removeFocusOutlines } from '~/utils';
|
||||
import { useChatContext } from '~/Providers';
|
||||
import { useLocalize } from '~/hooks';
|
||||
import Container from './Container';
|
||||
|
||||
const EditMessage = ({
|
||||
text,
|
||||
|
|
@ -39,11 +39,16 @@ const EditMessage = ({
|
|||
|
||||
const resubmitMessage = () => {
|
||||
if (message.isCreatedByUser) {
|
||||
ask({
|
||||
text: editedText,
|
||||
parentMessageId,
|
||||
conversationId,
|
||||
});
|
||||
ask(
|
||||
{
|
||||
text: editedText,
|
||||
parentMessageId,
|
||||
conversationId,
|
||||
},
|
||||
{
|
||||
resubmitFiles: true,
|
||||
},
|
||||
);
|
||||
|
||||
setSiblingIdx((siblingIdx ?? 0) - 1);
|
||||
} else {
|
||||
|
|
@ -105,7 +110,7 @@ const EditMessage = ({
|
|||
);
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Container message={message}>
|
||||
<TextareaAutosize
|
||||
ref={textAreaRef}
|
||||
onChange={(e) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue