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: New Component - Prompts #55

Merged
merged 13 commits into from
Aug 14, 2024
Merged

feat: New Component - Prompts #55

merged 13 commits into from
Aug 14, 2024

Conversation

YumoImer
Copy link
Collaborator

@YumoImer YumoImer commented Aug 4, 2024

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 工作流程
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

[RFC] New Component - Prompts

📝 更新日志

语言 更新描述
🇺🇸 英文 Add new component Prompts
🇨🇳 中文 添加新组件 Prompts

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced the Prompts component for displaying customizable UI elements with predefined questions or suggestions.
    • Added multiple demo components showcasing various use cases for the Prompts component, including disabled prompts, prompts with scroll support, and interactive prompts.
    • Enhanced user interaction with features like item click handling and flexible layouts for prompts.
  • Documentation

    • Created comprehensive bilingual documentation detailing the functionality and usage instructions of the Prompts component in both English and Chinese.
  • Tests

    • Expanded test coverage with new test files specifically targeting the functionality of the Prompts component and its related features.

@YumoImer YumoImer requested a review from a team August 4, 2024 09:19
Copy link

github-actions bot commented Aug 4, 2024

Preview is ready

Copy link
Contributor

coderabbitai bot commented Aug 4, 2024

Walkthrough

The recent updates introduce the Prompts component, enhancing the application's functionality with new types and comprehensive bilingual documentation. The addition of unit tests strengthens the component's reliability, while improvements in styling and interface definitions provide a solid foundation for future enhancements. Overall, these changes promote accessibility and enrich the user experience, catering to a diverse audience.

Changes

Files Change Summary
components/index.ts Added exports for the Prompts component and its types: PromptsProps, PromptProps.
components/prompts/__tests__/index.test.tsx Introduced unit tests for the Prompts component, enhancing verification of its behavior.
components/prompts/demo/*.md Added bilingual documentation for the Prompts component, improving accessibility and usability.
components/prompts/demo/*.tsx Introduced new React components showcasing various usage scenarios with the Prompts component.
components/prompts/style/index.ts Defined styles and tokens for the Prompts component, enhancing styling capabilities.
components/theme/components.ts Updated ComponentTokenMap to include Prompts, enhancing styling flexibility.
.dumi/preset/components-changelog-cn.json, .dumi/preset/components-changelog-en.json Updated JSON structures to include a new key for Prompts, reflecting changes in documentation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant Prompts

    User->>App: Requests prompts display
    App->>Prompts: Renders with data props
    Prompts-->>App: Displays prompts
    App-->>User: Shows prompts on UI
Loading

🐰 "In a meadow bright and wide,
New prompts hop with joy and pride.
With styles and tests, they leap and bound,
Bilingual whispers all around.
A joyful update, fair and spry,
Let’s cheer for changes, oh my my!" 🐇


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

@YumoImer YumoImer changed the title [WIP] New Component - Prompts feat: New Component - Prompts Aug 5, 2024
YumoImer and others added 2 commits August 7, 2024 05:47
 - PromptsProps.flex -> PromptsProps.wrap and PromptsProps.vertical
 - PromptsProps.onClick Object Params -> Array Params
 - PromptsProps.styles -> Keep only the necessary key
 - PromptsProps.classNames -> Keep only the necessary key
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.47%. Comparing base (4288fd3) to head (72dfc5c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   90.54%   91.47%   +0.92%     
==========================================
  Files          17       19       +2     
  Lines         275      305      +30     
  Branches       77       90      +13     
==========================================
+ Hits          249      279      +30     
  Misses         26       26              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator Author

@YumoImer YumoImer left a comment

Choose a reason for hiding this comment

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

+1

@zombieJ zombieJ merged commit e596fe6 into main Aug 14, 2024
10 checks passed
@zombieJ zombieJ deleted the feat/prompts branch August 14, 2024 11:09
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