Skip to content
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

feat: Sender support Sender.Header #156

Merged
merged 6 commits into from
Oct 16, 2024
Merged

feat: Sender support Sender.Header #156

merged 6 commits into from
Oct 16, 2024

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Oct 15, 2024

预览

https://support-header.x-73x.pages.dev/components/sender-cn#sender-demo-header

支持自定义面板

截屏2024-10-15 19 52 05

Summary by CodeRabbit

Summary by CodeRabbit

  • 新功能
    • 引入了可折叠的 SenderHeader 组件,支持动态属性注入。
    • 更新了 SemanticPreview 组件,允许更灵活的子组件渲染。
    • 增强了 App 组件的本地化功能,支持中英文切换。
    • Sender 组件现在支持可定制的前缀和头部。
  • 文档
    • 更新了中英文文档,增加了示例和属性说明。
  • 样式
    • 引入了 genSenderHeaderStyle 函数,为 SenderHeader 组件生成样式。
    • 改进了 Sender 组件的样式逻辑,增强了布局处理。

Copy link
Contributor

coderabbitai bot commented Oct 15, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

本次更改涉及多个组件的更新和新功能的引入。SemanticPreview 组件的 children 属性被修改为支持函数形式,增强了子组件的渲染灵活性。新增的 SenderHeader 组件实现了可折叠的头部界面,并引入了样式生成函数 genSenderHeaderStyle。此外,多个文档文件进行了本地化更新,增加了对新功能的描述和示例,提升了用户体验。

Changes

文件路径 更改摘要
.dumi/components/SemanticPreview.tsx 更新了 SemanticPreviewProps 接口,children 属性支持 React.ReactElement 或函数形式。
components/sender/SenderHeader.tsx 新增 SenderHeader 组件,支持可折叠头部,包含多个自定义属性和动画逻辑。
components/sender/demo/_semantic.tsx 更新 App 组件,增加本地化支持,替换为两个 SemanticPreview 实例,增强功能。
components/sender/demo/header.md 为简体中文和英语添加新章节,提供如何使用头部自定义文件上传示例的说明。
components/sender/demo/header.tsx 新增 Demo 组件,构建文件上传界面,集成 Ant Design 组件,管理上传界面的可见性。
components/sender/index.en-US.md 新增示例“Header panel”,更新 API 部分,添加 prefix 属性和 Sender.Header 子部分。
components/sender/index.tsx 更新 Sender 组件,添加 prefixheader 属性,支持新的头部组件。
components/sender/index.zh-CN.md 为“展开面板”功能添加代码演示,更新 API 部分,增加 prefix 属性和 Sender.Header 子部分。
components/sender/style/header.ts 新增样式生成函数 genSenderHeaderStyle,用于生成头部组件的样式。
components/sender/style/index.ts 更新 SenderToken 接口为导出接口,重构样式生成逻辑,整合头部样式生成。
mako.config.json 移除了 codeSplitting 部分的 moduleIdStrategy 键,简化配置结构。

Poem

在草地上跳跃的小兔,
新组件如花儿绽放,
头部可折叠,样式新,
本地化支持更添光。
快乐的代码,欢笑声,
让我们一起舞动吧! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 11927be and e384a96.

📒 Files selected for processing (3)
  • components/sender/SenderHeader.tsx (1 hunks)
  • components/sender/index.en-US.md (3 hunks)
  • components/sender/index.zh-CN.md (3 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Oct 15, 2024

Preview is ready

Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2024

Deploying x with  Cloudflare Pages  Cloudflare Pages

Latest commit: e384a96
Status: ✅  Deploy successful!
Preview URL: https://6afe1dc2.x-73x.pages.dev
Branch Preview URL: https://support-header.x-73x.pages.dev

View logs

@afc163
Copy link
Member

afc163 commented Oct 15, 2024

我倒觉得附件功能是 Chatbot 类应用中输入上的必备维度,是 llm context 的重要类型,语义上应该留出来。Header 反而是一个布局语义,抽象程度略低。

@zombieJ
Copy link
Member Author

zombieJ commented Oct 15, 2024

我倒觉得附件功能是 Chatbot 类应用中输入上的必备维度,是 llm context 的重要类型,语义上应该留出来。Header 反而是一个布局语义,抽象程度略低。

不同业务需要的文件展示样式是不同的,在 antd 的 UploadList 里已经遇到过一次要么魔改要么自己实现一个 List。这个 PR 目的是先把样式上的弹层做出来,文件管理的实现有开发者自己决定。

@zombieJ zombieJ merged commit e9b14fc into main Oct 16, 2024
9 checks passed
@zombieJ zombieJ deleted the support-header branch October 16, 2024 07:39
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.

3 participants