Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-1.8.0 #12024 +/- ##
=================================================
+ Coverage 37.05% 37.13% +0.08%
=================================================
Files 1588 1589 +1
Lines 77969 77983 +14
Branches 11803 11807 +4
=================================================
+ Hits 28893 28962 +69
+ Misses 47454 47370 -84
- Partials 1622 1651 +29
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Description
The initial issue was that clicking Reset on a single shortcut did not return it to the system default. Instead, it reverted to the last saved/custom value, because the reset logic was based on the current shortcut list (which already included the user’s edits) rather than the original default list. The only way to truly restore defaults was the Restore button, which reset all shortcuts at once.
Refactored the shortcut editing logic into helpers and reduced inline logic in the component to improve readability and testability. The main component now calls these helpers and uses a dedicated reset handler instead of inline onClick logic, so the UI behavior is clearer and easier to maintain.
Added a helper module that centralizes shortcut lookup, duplication checks, normalization, and key-combination formatting. This makes those behaviors reusable and straightforward to unit test.
Added unit tests covering the helper behaviors (lookup, duplication detection, normalization, key formatting).
Before
https://github.com/user-attachments/assets/e4322f02-5cc0-41d3-a0d7-f1227c3aad02
After
https://github.com/user-attachments/assets/8c7b0619-8bda-4e91-b2a3-10229d6e6b4e