Skip to content

【功能建议】输出长文本时自动堆叠 #337

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
1 task done
hug1013 opened this issue Apr 4, 2025 · 1 comment
Open
1 task done

【功能建议】输出长文本时自动堆叠 #337

hug1013 opened this issue Apr 4, 2025 · 1 comment

Comments

@hug1013
Copy link

hug1013 commented Apr 4, 2025

问题类型 (Issue Type):

  • 功能请求 (Feature Request)

问题描述
目前,当 AI 生成非常长的文本回复时,整个回复会完全展开显示。这会导致:

  1. 界面刷屏 (Screen Flooding): 长文本占据大量垂直空间,将之前的对话内容推得很远,需要用户大量滚动才能查看上下文或后续消息。
  2. 阅读效率降低 (Reduced Readability): 大段连续的文本一次性展示,可能让用户难以快速抓住重点或跟上对话节奏。
  3. 界面混乱 (Cluttered Interface): 聊天界面因为过长的消息气泡而显得不够整洁。

解决方案
希望实现一个功能,当 AI 的回复超过一定长度(例如,特定的行数或高度阈值)时,默认只显示其开头部分,并自动折叠其余内容。

  • 自动折叠 (Auto-Collapse): 默认仅显示消息的前 N 行或固定高度。
  • 展开提示 (Expand Indicator): 在被折叠消息的末尾显示一个明确的提示,例如 "显示更多" (Show More) 文本按钮,或者一个向下的箭头图标 (类似截图中的 ^ 反向,或者 v)。
  • 展开操作 (Expand Action): 用户点击该提示后,消息气泡应平滑展开,显示完整的文本内容。
  • 收起操作 (Collapse Action - 可选): 展开后,可以提供一个相应的 "收起" (Show Less) 或向上的箭头选项,让用户可以手动将消息重新折叠。

效果类似于下图:

Image

Image

Image

Image

其他信息

  • 此功能在许多现代聊天和内容展示界面中很常见,可以显著提升用户体验,尤其是在处理需要详细解释或生成长代码块、文章等场景时。
  • 有助于保持对话界面的整洁和易用性。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@hug1013 and others