lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
43.2k stars 9.76k forks source link

[Bug] 在多条长对话中编辑历史对话(非最后一条)时,会直接跳到回答底部(或更下面的位置)。此时需要向上翻才能找到编辑的内容 #4494

Open one-pyy opened 2 hours ago

one-pyy commented 2 hours ago

📦 部署环境

Docker

📌 软件版本

1.24.1(服务器版本)

💻 系统环境

Ubuntu

🌐 浏览器

Edge

🐛 问题描述

在多条长对话中编辑历史对话(非最后一条)时,会直接跳到回答底部。此时需要向上翻才能找到编辑的内容。推测是因为总是使用到顶部的距离,而编辑时会限制文本框高度,导致要编辑的内容变矮,而此时与顶端高度相同的地方就变成了底部(或更下面的位置)

📷 复现步骤

打开一个会话,添加两条消息,每条消息"test\n"*200。然后点击编辑第一条消息,即可复现。

🚦 期望结果

每次打开编辑都会定位到输入框顶部

📝 补充信息

或许可以参考下面的修改方法?

感谢大佬们!

lobehubbot commented 2 hours ago

👀 @one-pyy

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible. Please make sure you have given us as much context as possible.\ 非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

lobehubbot commented 2 hours ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


📦 Deployment environment

Docker

📌 Software version

1.24.1 (server version)

💻 System environment

Ubuntu

🌐 Browser

Edge

🐛 Problem description

When editing a historical conversation (not the last one) in multiple long conversations, you will jump directly to the bottom of the answer. At this time, you need to scroll up to find the edited content. It is speculated that the distance to the top is always used, and the height of the text box is limited when editing, causing the content to be edited to become shorter, and the place with the same height as the top becomes the bottom (or lower).

📷 Steps to reproduce

Open a session and add two messages, each message "test\n"*200. Then click to edit the first message to reproduce.

🚦 Expected results

The edit button is at the top of the single message so this problem can be avoided/

Ability to set the non-folding height of the edit box (it is best if the edit button is suspended so that you can turn it to where it is and modify it)/

There is an edit button in the menu bar. After pressing it, all messages can be edited directly.

📝 Supplementary information

Thanks guys!

dosubot[bot] commented 2 hours ago

The issue you're experiencing seems to be related to the scrolling behavior when editing a message in a long conversation. When you edit a message that is not the last one, the interface jumps to the bottom, making it difficult to find the content you want to edit. This might be due to the way the height of the text box is controlled during editing, which can affect the scrolling position.

Currently, the height of the text box is controlled by the DraggablePanel component, which has defined minimum and maximum heights. This could be causing the issue where the content appears to jump to the bottom when editing sup>[[1]](https://github.com/lobehub/lobe-chat/blob/main/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx)</sup.

To address this, you might consider implementing a mechanism to keep the edit button visible or floating while scrolling, which would allow you to edit messages more conveniently. However, there is no existing functionality or component in the repository that provides this feature [2].

For a more immediate solution, you could explore adjusting the CSS or JavaScript logic to ensure the editing interface maintains its position relative to the message being edited, rather than jumping to the bottom. This might involve modifying the event listeners or handlers associated with message editing to better manage scrolling and positioning [3].

To continue talking to Dosu, mention @dosu.