Assistants Web: Add hot key bindings button #841
+43
−9
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.
There is a modal dialog that already exists in the Assistants Web interface, that shows the available keyboard shortcuts. This modal dialog can already be accessed by pressing Ctrl + K or Cmd + K.
This PR modifies the left navigation menu to include a "Hot Keys" button that can be used to access the hot keys dialog:
When hovering over the button, it shows the keystroke to the right:
AI Description
This PR introduces a new feature for managing hotkeys in the application. The changes include:
src/interfaces/assistants_web/src/components/HotKeys/HotKeysProvider.tsx:
useSettingsStore
hook is imported from@/stores
.useState
hook is removed, and theisHotKeysDialogOpen
andsetIsHotKeysDialogOpen
states are now managed using theuseSettingsStore
hook.open
andclose
functions now usesetIsHotKeysDialogOpen
to toggle the dialog.HotKeysDialog
component is updated to useisHotKeysDialogOpen
andsetIsHotKeysDialogOpen
from theuseSettingsStore
hook.src/interfaces/assistants_web/src/components/SideNavPanel/SideNavPanel.tsx:
isHotKeysDialogOpen
andsetIsHotKeysDialogOpen
states are added to theuseSettingsStore
hook.openHotKeysDialog
is introduced, which toggles theisHotKeysDialogOpen
state.AgentsSidePanelButton
is added to the footer, allowing users to open the hotkeys dialog.src/interfaces/assistants_web/src/components/UI/Icon.tsx:
'hot-keys'
is added to thegetIcon
function.src/interfaces/assistants_web/src/stores/persistedStore.ts:
isHotKeysDialogOpen
andsetIsHotKeysDialogOpen
states are added to theuseSettingsStore
hook.src/interfaces/assistants_web/src/stores/slices/settingsSlice.ts:
isHotKeysDialogOpen
state is added to theINITIAL_STATE
object.setIsHotKeysDialogOpen
is introduced to update theisHotKeysDialogOpen
state.