-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Feature/bubble footer enhancement #638
base: feature
Are you sure you want to change the base?
Feature/bubble footer enhancement #638
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis pull request enhances the Bubble component by adding a new feature to support dynamic footer content. The footer can now be a static React node or a function that receives the content as a parameter. This change also includes updates to the documentation and test cases to reflect the new functionality. Changes
|
components/bubble/Bubble.tsx
Outdated
@@ -173,7 +182,8 @@ const Bubble: React.ForwardRefRenderFunction<BubbleRef, BubbleProps> = (props, r | |||
...styles.footer, | |||
}} | |||
> | |||
{footer} | |||
{/* {footerNode} */} | |||
{typeof footer === 'function' ? footer(mergedContent as string) : footer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the footer
function handles all possible content types correctly to avoid runtime errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
footer 需要确保是 react Element
这里footer就是react.ReactNode的类型吧
mergedContent的到的ts类型是,应该是修改下这里参数的类型?
const mergedContent: string | number | bigint | boolean | object | null | undefined
import React from 'react'; | ||
|
||
const App: React.FC = () => { | ||
const { token } = theme.useToken(); | ||
|
||
// 豆包中生成的图片也是不支持复制的 如果期望的是复制待md格式的内容? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无关注释需要删除
<Space size={token.paddingXXS}> | ||
<Button color="default" variant="text" size="small" icon={<SyncOutlined />} /> | ||
<Button color="default" variant="text" size="small" icon={<CopyOutlined />} /> | ||
<Button | ||
// onClick={() => console.log('Copy message:', messageContext.content)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
无关注释需要删除
components/bubble/Bubble.tsx
Outdated
@@ -161,6 +169,7 @@ const Bubble: React.ForwardRefRenderFunction<BubbleRef, BubbleProps> = (props, r | |||
</div> | |||
)} | |||
{fullContent} | |||
{/* {footerNode && ( */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余代码注释需要删除
components/bubble/Bubble.tsx
Outdated
// } else { | ||
// footerNode = footer; | ||
// } | ||
// if (header || footerNode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码注释需要删除
Bundle ReportBundle size has no change ✅ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #638 +/- ##
===========================================
+ Coverage 91.81% 91.88% +0.07%
===========================================
Files 67 67
Lines 1466 1467 +1
Branches 388 388
===========================================
+ Hits 1346 1348 +2
+ Misses 120 119 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
中文版模板 / Chinese template
🤔 This is a ...
🔗 Related Issues
💡 Background and Solution
📝 Change Log