feat: show firefox-compatible command palette shortcut alias (#7825)

This commit is contained in:
David Luzar 2024-03-28 18:12:54 +01:00 committed by GitHub
parent 1d71f84515
commit 3e334a67ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 8 deletions

View File

@ -60,8 +60,8 @@ const shortcutMap: Record<ShortcutName, string[]> = {
clearCanvas: [getShortcutKey("CtrlOrCmd+Delete")],
imageExport: [getShortcutKey("CtrlOrCmd+Shift+E")],
commandPalette: [
getShortcutKey("CtrlOrCmd+Shift+P"),
getShortcutKey("CtrlOrCmd+/"),
getShortcutKey("CtrlOrCmd+Shift+P"),
],
cut: [getShortcutKey("CtrlOrCmd+X")],
copy: [getShortcutKey("CtrlOrCmd+C")],

View File

@ -3755,8 +3755,7 @@ class App extends React.Component<AppProps, AppState> {
) {
this.setToast({
message: t("commandPalette.shortcutHint", {
shortcutOne: getShortcutFromShortcutName("commandPalette"),
shortcutTwo: getShortcutFromShortcutName("commandPalette", 1),
shortcut: getShortcutFromShortcutName("commandPalette"),
}),
});
event.preventDefault();

View File

@ -281,10 +281,14 @@ export const HelpDialog = ({ onClose }: { onClose?: () => void }) => {
/>
<Shortcut
label={t("commandPalette.title")}
shortcuts={[
getShortcutFromShortcutName("commandPalette"),
getShortcutFromShortcutName("commandPalette", 1),
]}
shortcuts={
isFirefox
? [getShortcutFromShortcutName("commandPalette")]
: [
getShortcutFromShortcutName("commandPalette"),
getShortcutFromShortcutName("commandPalette", 1),
]
}
/>
</ShortcutIsland>
<ShortcutIsland

View File

@ -560,6 +560,6 @@
"noMatch": "No matching commands..."
},
"itemNotAvailable": "Command is not available...",
"shortcutHint": "For Command palette, use {{shortcutOne}} or {{shortcutTwo}}"
"shortcutHint": "For Command palette, use {{shortcut}}"
}
}