Skip to content

webui: Allow editing file attachments when editing messages. #13645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nauful
Copy link
Contributor

@nauful nauful commented May 20, 2025

This PR adds the ability to edit (add/remote) file attachments when editing messages.

@nauful nauful requested a review from ngxson as a code owner May 20, 2025 01:54
@nauful nauful changed the title Allow editing file attachments when editing messages. webui: Allow editing file attachments when editing messages. May 20, 2025
Comment on lines 124 to 136
<Dropzone
noClick
onDrop={(files: File[]) => {
setIsDrag(false);
extraContext.onFileAdded(files);
}}
onDragEnter={() => setIsDrag(true)}
onDragLeave={() => setIsDrag(false)}
multiple={true}
>
{({ getRootProps, getInputProps }) => (
<div
className="flex flex-col w-full"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think copy-paste this whole code is not a good approach. It will make the code base become highly difficult to maintain in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, I've removed the old textarea and buttons in ChatMessage and refactored ChatInput to handle editing. Now ChatScreen and ChatMessage editing both use ChatInput.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't test this right now, could you upload a screen recording?

Btw thinking about the UI/UX, I think maybe we should redesign ChatInput component to make it more flexible, so that it can be shown in the middle when user creates a new conversion (same UI on chatgpt/claude), this will also make the ChatInput to looks better in the case we edit the message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen.Recording.2025-05-22.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants