Skip to content

Commit ea7355d

Browse files
committed
Naming: hotkey -> shortcut
1 parent 3242790 commit ea7355d

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

CopilotKit/packages/react-ui/src/components/chat/Chat.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ export interface CopilotChatProps {
5555
onSetOpen?: (open: boolean) => void;
5656

5757
/**
58-
* The hotkey to open the chat window.
59-
* Uses Command-<hotkey> on a Mac and Ctrl-<hotkey> on Windows.
58+
* The shortcut key to open the chat window.
59+
* Uses Command-<shortcut> on a Mac and Ctrl-<shortcut> on Windows.
6060
* @default "e"
6161
*/
62-
hotkey?: string;
62+
shortcut?: string;
6363

6464
/**
6565
* Icons can be used to set custom icons for the chat window.
@@ -127,7 +127,7 @@ export const CopilotChat = ({
127127
clickOutsideToClose = true,
128128
hitEscapeToClose = true,
129129
onSetOpen,
130-
hotkey = "e",
130+
shortcut = "e",
131131
icons,
132132
labels,
133133
makeSystemMessage,
@@ -169,7 +169,7 @@ export const CopilotChat = ({
169169
open={openState}
170170
setOpen={setOpen}
171171
clickOutsideToClose={clickOutsideToClose}
172-
hotkey={hotkey}
172+
shortcut={shortcut}
173173
hitEscapeToClose={hitEscapeToClose}
174174
>
175175
<Header open={openState} setOpen={setOpen} />

CopilotKit/packages/react-ui/src/components/chat/Window.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const Window = ({
66
setOpen,
77
children,
88
clickOutsideToClose,
9-
hotkey,
9+
shortcut,
1010
hitEscapeToClose,
1111
}: WindowProps) => {
1212
const windowRef = React.useRef<HTMLDivElement>(null);
@@ -45,14 +45,14 @@ export const Window = ({
4545
) {
4646
setOpen(false);
4747
} else if (
48-
event.key === hotkey &&
48+
event.key === shortcut &&
4949
((isMacOS() && event.metaKey) || (!isMacOS() && event.ctrlKey)) &&
5050
(!isInput || isDescendantOfWrapper)
5151
) {
5252
setOpen(!open);
5353
}
5454
},
55-
[hitEscapeToClose, hotkey, open, setOpen],
55+
[hitEscapeToClose, shortcut, open, setOpen],
5656
);
5757

5858
const adjustForMobile = useCallback(() => {

CopilotKit/packages/react-ui/src/components/chat/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface WindowProps {
1010
setOpen: (open: boolean) => void;
1111
clickOutsideToClose: boolean;
1212
hitEscapeToClose: boolean;
13-
hotkey: string;
13+
shortcut: string;
1414
children?: React.ReactNode;
1515
}
1616

docs/reference/CopilotPopup.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ For example:
7373
opens or closes.
7474
</ResponseField>
7575

76-
<ResponseField name="hotkey" type="string" default="e">
77-
The hotkey to open the chat window. Uses Command-`hotkey` on a Mac and
78-
Ctrl-`hotkey` on Windows.
76+
<ResponseField name="shortcut" type="string" default="e">
77+
The shortcut key to open the chat window. Uses Command-`shortcut` on a Mac and
78+
Ctrl-`shortcut` on Windows.
7979
</ResponseField>
8080

8181
<ResponseField name="icons" type="CopilotChatIcons">

docs/reference/CopilotSidebar.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ For example:
8181
opens or closes.
8282
</ResponseField>
8383

84-
<ResponseField name="hotkey" type="string" default="e">
85-
The hotkey to open the chat window. Uses Command-`hotkey` on a Mac and
86-
Ctrl-`hotkey` on Windows.
84+
<ResponseField name="shortcut" type="string" default="e">
85+
The shortcut key to open the chat window. Uses Command-`shortcut` on a Mac and
86+
Ctrl-`shortcut` on Windows.
8787
</ResponseField>
8888

8989
<ResponseField name="icons" type="CopilotChatIcons">

0 commit comments

Comments
 (0)