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: support AZERTY Keyboards (AltGr + à) @ startMeasure #277

Merged
merged 3 commits into from
Sep 14, 2024

Conversation

Jarryxin
Copy link
Contributor

@Jarryxin Jarryxin commented Sep 11, 2024

#50795 Mentions Component Fails to Detect "@" on AZERTY Keyboards (AltGr + à)

Summary by CodeRabbit

  • 新功能
    • 在提及组件中添加对“Meta”和“Alt”键的支持,增强了用户输入的响应能力。
  • 测试
    • 在完整流程测试套件中添加了针对AZERTY键盘布局的测试用例,以验证键盘事件处理的正确性。

Copy link

coderabbitai bot commented Sep 11, 2024

Walkthrough

此次更改涉及src/Mentions.tsx文件中InternalMentions组件的条件逻辑。新增的条件检查key变量是否等于'Alt',与之前对nextMeasurePrefix'Shift'的检查一起,改变了控制流。这一修改允许在按下Alt键时执行相应代码块,从而影响组件在提及交互中的响应。此外,还在tests/FullProcess.spec.tsx文件中新增了针对AZERTY键盘布局的测试用例,以验证在特定键盘输入下的功能。

Changes

文件 更改摘要
src/Mentions.tsx InternalMentions组件的条件逻辑中新增对Alt键的检查。
tests/FullProcess.spec.tsx 新增测试用例以验证AZERTY键盘布局下的键盘事件处理。

Poem

在草地上跳跃的小兔子,
新增快捷键真是妙,
按下Alt来提及,
让互动更轻巧。
像风一样自由,
让我们一起欢笑!
🐰✨


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5b9c18a and c9e3cb0.

Files selected for processing (1)
  • tests/FullProcess.spec.tsx (1 hunks)
Additional comments not posted (1)
tests/FullProcess.spec.tsx (1)

191-209: 测试用例覆盖了重要的场景,非常好!

添加针对 AZERTY 键盘布局的测试用例是一个很好的想法,这有助于提高组件的可访问性和国际化支持。测试用例的结构清晰,遵循了现有的测试模式,并使用了 simulateInputfireEvent 工具来模拟用户交互,这是一个很好的实践。断言检查了预期的行为,确保 onChange 回调函数被调用并传入了正确的参数。

总的来说,这个测试用例覆盖了一个重要的场景,提高了测试覆盖率,非常好!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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 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

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.37%. Comparing base (5cf35c0) to head (c9e3cb0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #277   +/-   ##
=======================================
  Coverage   98.36%   98.37%           
=======================================
  Files           7        7           
  Lines         245      246    +1     
  Branches       57       57           
=======================================
+ Hits          241      242    +1     
  Misses          4        4           

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

@Jarryxin Jarryxin changed the title feat: support paste @ startMeasure feat: support AZERTY Keyboards (AltGr + à) @ startMeasure Sep 12, 2024
@Jarryxin
Copy link
Contributor Author

@afc163 期待 review

@afc163
Copy link
Member

afc163 commented Sep 12, 2024

来个测试用例?

@Jarryxin
Copy link
Contributor Author

来个测试用例?

加了

@Jarryxin
Copy link
Contributor Author

来个测试用例?

wait review

@afc163 afc163 merged commit cd1e87f into react-component:master Sep 14, 2024
7 checks passed
@afc163
Copy link
Member

afc163 commented Sep 14, 2024

@Jarryxin
Copy link
Contributor Author

Check https://github.com/react-component/mentions/pull/280/files and ant-design/ant-design#50795 (comment)

#281 用Alt字符串判断不严谨,改为keyCode码

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