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

fix: Mentions doesnt work on chrome and on firefox #280

Merged
merged 8 commits into from
Sep 19, 2024

Conversation

ilyassBZ
Copy link
Contributor

@ilyassBZ ilyassBZ commented Sep 14, 2024

fixing mention dosnt work on azer keyboard:
issues:
fix ant-design/ant-design#50795,

Summary by CodeRabbit

Summary by CodeRabbit

  • 新功能
    • 增强了键盘输入处理功能,支持对 'AltGraph' 键的检测,改善了用户交互体验。
  • 测试
    • 新增了针对 'AltGr' 键的用户输入测试用例,确保组件在不同键盘下的正确行为。

Copy link

coderabbitai bot commented Sep 14, 2024

Warning

Rate limit exceeded

@ilyassBZ has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 16 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between 2b013dc and 507362d.

Walkthrough

此次更改涉及对 src/Mentions.tsx 文件中 InternalMentions 组件的条件逻辑进行修改。新增的条件检查 'AltGraph' 键,与现有的 'Shift' 键和变量 nextMeasurePrefix 一同工作。这一修改增强了键盘输入的处理功能,使得组件能够更全面地检测用户输入,尤其是在涉及 'AltGraph' 键的场景中。同时,tests/FullProcess.spec.tsx 文件中新增了测试用例,以验证 AltGr 键的输入处理。

Changes

文件 更改摘要
src/Mentions.tsx 修改 InternalMentions 组件的条件逻辑,新增对 'AltGraph' 键的检查。
tests/FullProcess.spec.tsx 新增测试用例 "azerty Keyboards",验证 AltGr 键的输入处理。

Assessment against linked issues

Objective Addressed Explanation
Mentions dropdown should appear when "@" is typed (AltGr + à) (50795)

Possibly related PRs

Poem

在键盘上跳跃的小兔子,
新增条件乐无比,
'AltGraph' 伴随而来,
输入检测更精彩。
让我们一起欢呼吧,
代码世界更美好! 🐇✨


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>, 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.

@yoyo837
Copy link
Member

yoyo837 commented Sep 14, 2024

Can a test case be added to cover this scene?

Copy link

codecov bot commented Sep 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.38%. Comparing base (76cf919) to head (507362d).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #280   +/-   ##
=======================================
  Coverage   98.37%   98.38%           
=======================================
  Files           7        7           
  Lines         246      247    +1     
  Branches       58       58           
=======================================
+ Hits          242      243    +1     
  Misses          4        4           

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

@ilyassBZ
Copy link
Contributor Author

@yoyo837 done

package.json Outdated Show resolved Hide resolved
@yoyo837
Copy link
Member

yoyo837 commented Sep 14, 2024

Conflicting.

@ilyassBZ
Copy link
Contributor Author

Conflicting.

fixed.. plus keyCode.ALT doesnt work in azert... no need for it

if (
key === nextMeasurePrefix ||
key === 'Shift' ||
which === KeyCode.ALT ||
key === 'AltGraph' ||
Copy link
Member

@afc163 afc163 Sep 14, 2024

Choose a reason for hiding this comment

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

@Jarryxin Is this correct? Should #281 already resolve the problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

2024-09-14_11-36
....

Copy link
Contributor

Choose a reason for hiding this comment

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

@Jarryxin Is this correct? Should #281 already resolve the problem?

可能确实不一样,我是用港版mac改成法语,测试alt是 18,在我修改的版本发邮件给提问者,他说是正确的。是否应该两种alt都兼容?

Maybe it's different. I changed from using the Hong Kong version of Mac to French, and the alt test was 18. In the revised version I provided to the questioner, he said it was correct. Should both alt versions be compatible?

Copy link
Contributor

Choose a reason for hiding this comment

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

ant-design/ant-design#50795 (comment) in this comment , the alt keycode is 18

Copy link
Contributor Author

@ilyassBZ ilyassBZ Sep 14, 2024

Choose a reason for hiding this comment

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

Im azerty user we have 2 Alt keys the one u talked about and the other one it AltGr that it been user to do @ cus in azerty keyboard just normal Alt +  à dosnt do anything AltGr does
I guess in mac in diffrent or something
In azert keyboard we have left alt whiche it all keyboard and the right AltGr with it only in azerty keyboard

Copy link
Contributor Author

@ilyassBZ ilyassBZ Sep 14, 2024

Choose a reason for hiding this comment

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

U can merge both do if u wanna satay safe in case ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i guess we should merge both of them do

Copy link
Contributor Author

@ilyassBZ ilyassBZ Sep 14, 2024

Choose a reason for hiding this comment

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

cus in ur coode u looking for the key number which it 18 OR 225 depending on keyboard but key name gonna stay the same which it AltGraph it dosnt change ... that's make using key=== "AltGraph" moore affection than using which key number but im fine with merging both of them if thats gonna suit u @yoyo837 @Jarryxin

Copy link
Member

Choose a reason for hiding this comment

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

KeyCode.ALT or AltGraph? Which one is correct?

Copy link
Member

@afc163 afc163 Sep 18, 2024

Choose a reason for hiding this comment

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

i guess we should merge both of them do

Should we keep KeyCode.ALT?

@yoyo837
Copy link
Member

yoyo837 commented Sep 14, 2024

AZERTY keyboard image:

image

@ilyassBZ
Copy link
Contributor Author

AZERTY keyboard image:

image

yuup Alt Gr == AltGraph

@ilyassBZ
Copy link
Contributor Author

@yoyo837 any update for the merge ?

@yoyo837
Copy link
Member

yoyo837 commented Sep 16, 2024

Personally, I think it's better to merge both just to be safe.

@ilyassBZ
Copy link
Contributor Author

Personally, I think it's better to merge both just to be safe.

sure should i add it for u can merge both of them or u gonna add it from ur side ?

@yoyo837
Copy link
Member

yoyo837 commented Sep 16, 2024

Personally, I think it's better to merge both just to be safe.

@afc163 @zombieJ @MadCcc Please double check.

@ilyassBZ
Copy link
Contributor Author

Personally, I think it's better to merge both just to be safe.

@afc163 @zombieJ @MadCcc Please double check.

any update ? we are waiting for the merge

tests/FullProcess.spec.tsx Outdated Show resolved Hide resolved
src/Mentions.tsx Outdated Show resolved Hide resolved
@afc163 afc163 changed the title fix:fixing mention dosnt work on chrom and on firfox when using azer… fix: Mentions doesnt work on chrome and on firefox Sep 19, 2024
@afc163 afc163 merged commit 5bfbb3d into react-component:master Sep 19, 2024
6 checks passed
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.

Mentions Component Fails to Detect "@" on AZERTY Keyboards (AltGr + à) in Chrome and Edge Browsers
4 participants