Skip to content

Commit 202edcb

Browse files
committed
Refactor keyboard shortcut display strings to use consistent, platform-specific formatting
1 parent 705b724 commit 202edcb

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

  • packages
    • ui/src/components/editor/panel/PromptField
    • vscode/src/views/panel/frontend/Main/MainView/components/Header

‎packages/ui/src/components/editor/panel/PromptField/PromptField.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,12 @@ export const PromptField: React.FC<PromptFieldProps> = (props) => {
510510
items={[
511511
{
512512
label: 'Select...',
513-
shortcut: `${mod_key}+${is_mac ? 'Return' : 'Enter'}`,
513+
shortcut: is_mac ? `${mod_key} Return` : `${mod_key}+Enter`,
514514
on_click: handle_select_click
515515
},
516516
{
517517
label: 'Copy prompt',
518-
shortcut: `${mod_key}+${is_mac ? 'Option' : 'Alt'}+C`,
518+
shortcut: is_mac ? `${mod_key}⌥C` : `${mod_key}+Alt+C`,
519519
on_click: handle_copy_click
520520
}
521521
]}

‎packages/vscode/src/views/panel/frontend/Main/MainView/components/Header/Header.tsx‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const Header: React.FC<Props> = (props) => {
8282
<button
8383
className={styles['header__left__toggler']}
8484
onClick={handle_heading_click}
85-
title={`Change mode (${is_mac ? '⌘+Esc' : 'Ctrl+Esc'})`}
85+
title={`Change mode (${is_mac ? '⌘ Esc' : 'Ctrl+Esc'})`}
8686
>
8787
{props.mode == MODE.WEB ? MODE.WEB : MODE.API}
8888
</button>
@@ -99,7 +99,9 @@ export const Header: React.FC<Props> = (props) => {
9999
on_change={props.on_web_prompt_type_change}
100100
max_width={dropdown_max_width}
101101
info={is_narrow_viewport ? undefined : 'prompt type'}
102-
title="Change prompt type (Shift+Alt)"
102+
title={
103+
is_mac ? 'Change prompt type (⇧⌥)' : 'Change prompt type (Shift+Alt)'
104+
}
103105
/>
104106
)}
105107
{props.mode == MODE.API && (
@@ -111,7 +113,9 @@ export const Header: React.FC<Props> = (props) => {
111113
on_change={props.on_api_prompt_type_change}
112114
max_width={dropdown_max_width}
113115
info={is_narrow_viewport ? undefined : 'prompt type'}
114-
title="Change prompt type (Shift+Alt)"
116+
title={
117+
is_mac ? 'Change prompt type (⇧⌥)' : 'Change prompt type (Shift+Alt)'
118+
}
115119
/>
116120
)}
117121
</div>

0 commit comments

Comments
 (0)