Skip to content

Conversation

@zwight
Copy link
Contributor

@zwight zwight commented Nov 13, 2025

变更类型

请选择以下选项以描述 PR 的类型:

  • Bug 修复(修复现有问题)
  • 新功能(添加了一个功能)
  • 代码优化(性能改进、代码重构)
  • 文档更新
  • 单测新增或修改
  • 其他(请说明):

相关问题

变更内容

https://zwight.github.io/dt-react-component/components/chat?tab=conversations

新增Conversations组件
  • 新增Conversations管理和显示具有分组功能的对话列表的组件
  • 新增GroupTitle用于显示组标题的组件
  • 新增Conversations.Item用于渲染对话的组件
  • 新增自定义钩子useGroupable,以方便对对话数据进行高效的分组和排序
  • 引入dropdown参数,为对话项目添加了下拉菜单,可执行更多操作
  • 引入groupable参数,用于控制是否分组,以及自定义分组的排序和标签渲染
  • 引入header参数,为对话列表顶部添加可拓展区,一般用于新增对话按钮操作
  • 国际化Conversations组件
Chat.Button组件修改
  • 样式修改:调整linearGradient的x和y参数,用百分比替换掉固定值,适用更多场景
Chat.Input组件参数调整
  • 参数调整:将InputautoSize参数调整到{...rest}之前,便于使用的时候覆盖默认参数
Markdown组件
  • 参数增加:为ReactMarkdown新增table的自定义,用于添加table的className以及添加table的样式
useChat
  • 接口调整:为_updatePrompt接受的data参数类型拓展,初始化的时候可以重定义Prompt的类型,但是在update的时候接收的还是默认类型,拓展成初始化时自定义的类型
其他
  • 新增demo
  • 新增Conversations单测

详细描述

对应 Previewer

@LuckyFBB LuckyFBB marked this pull request as draft November 13, 2025 07:55
@LuckyFBB LuckyFBB added this to the Next Verison(5.1.0) milestone Nov 13, 2025

export interface IConversationsProps extends React.HTMLAttributes<HTMLUListElement> {
conversations: ConversationInfo[];
activeKey?: ConversationInfo['id'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

设置了 activeKey 的时候,一般表示为受控吧,得暴露回调函数吧

Copy link
Contributor Author

Choose a reason for hiding this comment

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

onItemClick就是设置的回调方法

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

Successfully merging this pull request may close these issues.

2 participants