Add customizable keyboard shortcuts#888
Open
Rhoahndur wants to merge 1 commit intohumanlayer:mainfrom
Open
Conversation
- Add hotkey configuration schema with defaults (config/hotkeys.ts) - Add Zustand store for hotkey settings with localStorage persistence - Add useConfigurableHotkey hook that reads from store - Add HotkeySettings UI component in Settings dialog - Support conflict detection when setting duplicate keys - Add reset to defaults option (individual and all) -----> NOT FULLY IMPLEMENTED STILL NEED TO DISPLACE ALL THE HARDCODED SHORTCUTS SEEKING FEEDBACK ON THIS
Contributor
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 46a4db5 in 1 minute and 2 seconds. Click for details.
- Reviewed
1116lines of code in7files - Skipped
0files when reviewing. - Skipped posting
5draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. humanlayer-wui/src/components/HotkeySettings.tsx:77
- Draft comment:
Consider memoizing the filtered hotkeys (based on category) to avoid re-computation on each render if the HOTKEY_DEFINITIONS list grows. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. humanlayer-wui/src/components/Layout.tsx:697
- Draft comment:
Using useStore.getState() directly in navigation callbacks bypasses reactivity. Consider using a selector hook outside or within the callback for consistency. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
3. humanlayer-wui/src/hooks/useConfigurableHotkey.ts:14
- Draft comment:
Ensure the caller supplies all required dependencies in the deps array so the hotkey binding updates as expected when state changes. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
4. humanlayer-wui/src/stores/hotkeyStore.ts:120
- Draft comment:
As the number of hotkeys increases, consider caching the normalized binding keys to avoid repeated normalization on each conflict check. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
5. humanlayer-wui/src/hooks/useHotkeyUnicodeChars.ts:117
- Draft comment:
Review the modifier mapping in formatBindingForDisplay to ensure it robustly handles edge cases (e.g. unusual key names or multiple alternatives). - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
Workflow ID: wflow_qAYJIF4gUWzpUekF
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) was I solving?
Keyboard shortcuts are hardcoded - users can't customize them to their preferences.
What user-facing changes did I ship?
How I implemented it
config/hotkeys.ts: Central schema with hotkey IDs, labels, defaults, categoriesstores/hotkeyStore.ts: Zustand store with persistence for custom bindingshooks/useConfigurableHotkey.ts: Drop-in replacement for useHotkeys that reads from storeHotkeySettings.tsx: Settings UI componentHow to verify it
make check testpassesDescription for the changelog
Added customizable keyboard shortcuts with settings UI and persistence.-----> NOT FULLY IMPLEMENTED STILL NEED TO DISPLACE ALL THE HARDCODED SHORTCUTS SEEKING FEEDBACK ON HOW THIS FEELS CAN FINISH IF GET THE NOD :)
Important
Adds customizable keyboard shortcuts with a settings UI, allowing users to edit, reset, and persist hotkey bindings.
SettingsDialog.localStorage.HotkeySettings.tsx: New component for managing hotkey settings UI.SettingsDialog.tsxto include theHotkeySettingscomponent.Layout.tsxto replace hardcoded hotkeys with configurable ones usinguseConfigurableHotkey.config/hotkeys.ts: Defines hotkey schema with IDs, labels, defaults, and categories.stores/hotkeyStore.ts: Zustand store for managing custom bindings and persistence.hooks/useConfigurableHotkey.ts: Hook to use configurable hotkeys, replacinguseHotkeys.formatBindingForDisplayinuseHotkeyUnicodeChars.tsfor displaying hotkeys based on platform.This description was created by
for 46a4db5. You can customize this summary. It will automatically update as commits are pushed.