From 19264174583936e4d478164cf34c251e1493693f Mon Sep 17 00:00:00 2001 From: xob0t <5348245@gmail.com> Date: Thu, 19 Feb 2026 01:32:23 +0300 Subject: [PATCH 1/2] fix: use event.code instead of event.key for keyboard shortcuts This fixes keyboard shortcuts (Ctrl+S, Ctrl+B, Ctrl+J, Ctrl+K) not working with non-English keyboard layouts (e.g., Russian, French AZERTY, German QWERTZ). Fixes #3495 --- .../dashboard/application/environment/show-enviroment.tsx | 2 +- .../components/dashboard/application/environment/show.tsx | 2 +- .../dashboard/compose/general/compose-file-editor.tsx | 2 +- .../components/dashboard/project/environment-variables.tsx | 7 ++++++- .../components/dashboard/projects/project-environment.tsx | 7 ++++++- apps/dokploy/components/dashboard/search-command.tsx | 2 +- .../dashboard/settings/web-server/edit-traefik-env.tsx | 7 ++++++- apps/dokploy/components/shared/focus-shortcut-input.tsx | 2 +- apps/dokploy/components/ui/sidebar.tsx | 4 ++-- 9 files changed, 25 insertions(+), 10 deletions(-) diff --git a/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx b/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx index 797a317a8..0b8f6aef2 100644 --- a/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx +++ b/apps/dokploy/components/dashboard/application/environment/show-enviroment.tsx @@ -111,7 +111,7 @@ export const ShowEnvironment = ({ id, type }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading) { + if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isLoading) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/application/environment/show.tsx b/apps/dokploy/components/dashboard/application/environment/show.tsx index cbbd105df..68cb79a88 100644 --- a/apps/dokploy/components/dashboard/application/environment/show.tsx +++ b/apps/dokploy/components/dashboard/application/environment/show.tsx @@ -104,7 +104,7 @@ export const ShowEnvironment = ({ applicationId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading) { + if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isLoading) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx b/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx index cb727e2a9..ddc905356 100644 --- a/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx +++ b/apps/dokploy/components/dashboard/compose/general/compose-file-editor.tsx @@ -93,7 +93,7 @@ export const ComposeFileEditor = ({ composeId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading) { + if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isLoading) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/project/environment-variables.tsx b/apps/dokploy/components/dashboard/project/environment-variables.tsx index e833fa779..f8d595b96 100644 --- a/apps/dokploy/components/dashboard/project/environment-variables.tsx +++ b/apps/dokploy/components/dashboard/project/environment-variables.tsx @@ -85,7 +85,12 @@ export const EnvironmentVariables = ({ environmentId, children }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading && isOpen) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isLoading && + isOpen + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/projects/project-environment.tsx b/apps/dokploy/components/dashboard/projects/project-environment.tsx index cb6245f08..ae79885f7 100644 --- a/apps/dokploy/components/dashboard/projects/project-environment.tsx +++ b/apps/dokploy/components/dashboard/projects/project-environment.tsx @@ -84,7 +84,12 @@ export const ProjectEnvironment = ({ projectId, children }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading && isOpen) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isLoading && + isOpen + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/search-command.tsx b/apps/dokploy/components/dashboard/search-command.tsx index 6fd798955..60d82f178 100644 --- a/apps/dokploy/components/dashboard/search-command.tsx +++ b/apps/dokploy/components/dashboard/search-command.tsx @@ -64,7 +64,7 @@ export const SearchCommand = () => { React.useEffect(() => { const down = (e: KeyboardEvent) => { - if (e.key === "j" && (e.metaKey || e.ctrlKey)) { + if (e.code === "KeyJ" && (e.metaKey || e.ctrlKey)) { e.preventDefault(); setOpen((open) => !open); } diff --git a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx index 482b98579..78e43edb1 100644 --- a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx +++ b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx @@ -87,7 +87,12 @@ export const EditTraefikEnv = ({ children, serverId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.key === "s" && !isLoading && !canEdit) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isLoading && + !canEdit + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/shared/focus-shortcut-input.tsx b/apps/dokploy/components/shared/focus-shortcut-input.tsx index 9c9215236..8bdc72f57 100644 --- a/apps/dokploy/components/shared/focus-shortcut-input.tsx +++ b/apps/dokploy/components/shared/focus-shortcut-input.tsx @@ -9,7 +9,7 @@ export const FocusShortcutInput = (props: Props) => { useEffect(() => { const onKeyDown = (e: KeyboardEvent) => { const isMod = e.metaKey || e.ctrlKey; - if (!isMod || e.key.toLowerCase() !== "k") return; + if (!isMod || e.code !== "KeyK") return; const target = e.target as HTMLElement | null; if (target) { diff --git a/apps/dokploy/components/ui/sidebar.tsx b/apps/dokploy/components/ui/sidebar.tsx index bb9d940a1..9b107d888 100644 --- a/apps/dokploy/components/ui/sidebar.tsx +++ b/apps/dokploy/components/ui/sidebar.tsx @@ -22,7 +22,7 @@ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7; const SIDEBAR_WIDTH = "16rem"; const SIDEBAR_WIDTH_MOBILE = "18rem"; const SIDEBAR_WIDTH_ICON = "3rem"; -const SIDEBAR_KEYBOARD_SHORTCUT = "b"; +const SIDEBAR_KEYBOARD_SHORTCUT = "KeyB"; type SidebarContext = { state: "expanded" | "collapsed"; @@ -99,7 +99,7 @@ const SidebarProvider = React.forwardRef< React.useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { if ( - event.key === SIDEBAR_KEYBOARD_SHORTCUT && + event.code === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey) ) { event.preventDefault(); From b573ccc90ccff6b2f2bb8864bd18bfc2810329c0 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 5 Apr 2026 04:48:38 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- .../components/dashboard/project/environment-variables.tsx | 7 ++++++- .../components/dashboard/projects/project-environment.tsx | 7 ++++++- .../dashboard/settings/web-server/edit-traefik-env.tsx | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/dokploy/components/dashboard/project/environment-variables.tsx b/apps/dokploy/components/dashboard/project/environment-variables.tsx index 5653fafdc..2826e2bcb 100644 --- a/apps/dokploy/components/dashboard/project/environment-variables.tsx +++ b/apps/dokploy/components/dashboard/project/environment-variables.tsx @@ -88,7 +88,12 @@ export const EnvironmentVariables = ({ environmentId, children }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isPending && isOpen) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isPending && + isOpen + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/projects/project-environment.tsx b/apps/dokploy/components/dashboard/projects/project-environment.tsx index e2cb672d5..ba70bb971 100644 --- a/apps/dokploy/components/dashboard/projects/project-environment.tsx +++ b/apps/dokploy/components/dashboard/projects/project-environment.tsx @@ -87,7 +87,12 @@ export const ProjectEnvironment = ({ projectId, children }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isPending && isOpen) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isPending && + isOpen + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); } diff --git a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx index d4c3f60f5..1312b96c5 100644 --- a/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx +++ b/apps/dokploy/components/dashboard/settings/web-server/edit-traefik-env.tsx @@ -87,7 +87,12 @@ export const EditTraefikEnv = ({ children, serverId }: Props) => { // Add keyboard shortcut for Ctrl+S/Cmd+S useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { - if ((e.ctrlKey || e.metaKey) && e.code === "KeyS" && !isPending && !canEdit) { + if ( + (e.ctrlKey || e.metaKey) && + e.code === "KeyS" && + !isPending && + !canEdit + ) { e.preventDefault(); form.handleSubmit(onSubmit)(); }