Skip to content

Update dependency react-hotkeys-hook to v5 #7391

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 13, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
react-hotkeys-hook (source) ^4.6.1 -> ^5.0.0 age adoption passing confidence

Release Notes

JohannesKlauss/react-keymap-hook (react-hotkeys-hook)

v5.0.1

Compare Source

v5.0.0

Compare Source

🎉 Version 5!

Most users should not need to do any migration, but for those who use special characters (+,-/$? and so on) or a different delimiter key than + there is a bit of work to do.

🚨 Breaking Changes

<HotkeysProvider>
  • enabledScopes in the HotkeysProvider has been renamed to activeScopes
  • If all scopes are disabled in the HotkeysProvider no hotkeys will be active
useHotkeys
  • The hook now only listens to the code of the hotkey, not the produced key. This will get rid of all the confusion between different keyboard layouts, multiple accidental triggers and so on.
  • Special character mappings to the german keyboard layout code have been removed
  • The splitKey option has been renamed to delimiter
  • The combinationKey option has been renamed to delimiter
  • New Option useKey: Setting this to true will listen to the produced key rather than the code. Helpful if you want to listen to something like ?, +, !...

🐛 Bugfixes

  • Fixed a bug where listening to control instead of ctrl wouldn't trigger correctly

Migration Guide

  • If you are using the splitKey option, rename that to delimiter
  • If you are using the combinationKey option, rename that to splitKey

If you are listening to special characters like shift+1 in order to listen for the exclamation mark, rewrite your hook like so:

useHotkeys('!', callback, {useKey: true})

This will listen to the produced key instead of the code. Listening for shift is not necessary anymore, because the hook will only check if the produced key matches !, no matter how it has been produced. This will be layout agnostic.

If you want to listen to specifically shift+1, then use the hotkey like this:

useHotkeys('shift+1', callback)

useKey defaults to false, so you only need to set it, if you want to listen to special characters.

One common use case for this is listening to y and z. On a german layout those keys are swapped. So to comply with every possible keyboard layout, you would set useKey: true to listen to the produced key.

useHotkeys('y', callback, {useKey: true}) // Triggers if the user hits their y key on the keyboard depending on the layout
useHotkeys('y', callback) // Triggers if the user hits the y key implying US keyboard layout

New Contributors

Full Changelog: JohannesKlauss/react-hotkeys-hook@v4.6.2...v5.0.0


Configuration

📅 Schedule: Branch creation - "on sunday before 6:00am" in timezone UTC, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Apr 13, 2025
Copy link

vercel bot commented Apr 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview Apr 13, 2025 1:40am
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 13, 2025 1:40am

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 13, 2025
@lobehubbot
Copy link
Member

👍 @renovate[bot]

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link
Contributor

gru-agent bot commented Apr 13, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 90befa7 🚫 Skipped No files need to be tested {"package.json":"target file(package.json) not in work scope \n include: src/utils,src/server,src/database,src/services,src/store,packages//src/ \n exclude: node_modules,/*.test.ts,/.test.tsx,**/.spec.ts,/*.spec.tsx,/.d.ts,**/.test.js,**/*.spec.js,src/database/server"}

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

Copy link

codecov bot commented Apr 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.56%. Comparing base (c98c0f8) to head (90befa7).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7391   +/-   ##
=======================================
  Coverage   89.56%   89.56%           
=======================================
  Files         753      753           
  Lines       53464    53464           
  Branches     3448     3448           
=======================================
  Hits        47887    47887           
  Misses       5577     5577           
Flag Coverage Δ
app 89.56% <ø> (ø)
server 95.72% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant