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")], clearCanvas: [getShortcutKey("CtrlOrCmd+Delete")],
imageExport: [getShortcutKey("CtrlOrCmd+Shift+E")], imageExport: [getShortcutKey("CtrlOrCmd+Shift+E")],
commandPalette: [ commandPalette: [
getShortcutKey("CtrlOrCmd+Shift+P"),
getShortcutKey("CtrlOrCmd+/"), getShortcutKey("CtrlOrCmd+/"),
getShortcutKey("CtrlOrCmd+Shift+P"),
], ],
cut: [getShortcutKey("CtrlOrCmd+X")], cut: [getShortcutKey("CtrlOrCmd+X")],
copy: [getShortcutKey("CtrlOrCmd+C")], copy: [getShortcutKey("CtrlOrCmd+C")],

View File

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

View File

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

View File

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