Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 9374cd7

Browse files
authored
FIX: Keyboard shortcut should be platform specific (#801)
1 parent 9cd14b0 commit 9374cd7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

assets/javascripts/discourse/components/ai-helper-options-list.gjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { fn } from "@ember/helper";
33
import { service } from "@ember/service";
44
import { and } from "truth-helpers";
55
import DButton from "discourse/components/d-button";
6+
import { PLATFORM_KEY_MODIFIER } from "discourse/lib/keyboard-shortcuts";
7+
import { translateModKey } from "discourse/lib/utilities";
68
import eq from "truth-helpers/helpers/eq";
79
import AiHelperCustomPrompt from "../components/ai-helper-custom-prompt";
810

@@ -13,6 +15,10 @@ export default class AiHelperOptionsList extends Component {
1315
return this.site.desktopView && this.args.shortcutVisible;
1416
}
1517

18+
get shortcut() {
19+
return translateModKey(`${PLATFORM_KEY_MODIFIER}+alt+p`);
20+
}
21+
1622
<template>
1723
<ul class="ai-helper-options">
1824
{{#each @options as |option|}}
@@ -33,7 +39,7 @@ export default class AiHelperOptionsList extends Component {
3339
class="ai-helper-options__button"
3440
>
3541
{{#if (and (eq option.name "proofread") this.showShortcut)}}
36-
<kbd class="shortcut">⌘⌥p</kbd>
42+
<kbd class="shortcut">{{this.shortcut}}</kbd>
3743
{{/if}}
3844
</DButton>
3945
</li>

0 commit comments

Comments
 (0)