From 39d517c3988d9c9bbb840b43cbbccd93637ca5ae Mon Sep 17 00:00:00 2001 From: d1rshan Date: Fri, 20 Mar 2026 13:22:42 +0530 Subject: [PATCH] fix(command-line): hide Firefox private-window shortcut hint (@d1rshan) --- .../ts/components/layout/footer/Keytips.tsx | 22 ++++++++++++++----- .../src/ts/components/pages/AboutPage.tsx | 22 ++++++++++++++++--- frontend/src/ts/pages/settings.ts | 8 +++---- 3 files changed, 38 insertions(+), 14 deletions(-) diff --git a/frontend/src/ts/components/layout/footer/Keytips.tsx b/frontend/src/ts/components/layout/footer/Keytips.tsx index 3c703888f71f..bef5cb86d5df 100644 --- a/frontend/src/ts/components/layout/footer/Keytips.tsx +++ b/frontend/src/ts/components/layout/footer/Keytips.tsx @@ -6,10 +6,8 @@ import { Conditional } from "../../common/Conditional"; export function Keytips(): JSXElement { const userAgent = window.navigator.userAgent.toLowerCase(); - const modifierKey = - userAgent.includes("mac") && !userAgent.includes("firefox") - ? "cmd" - : "ctrl"; + const isFirefox = userAgent.includes("firefox"); + const modifierKey = userAgent.includes("mac") && !isFirefox ? "cmd" : "ctrl"; const commandKey = (): string => getConfig.quickRestart === "esc" ? "tab" : "esc"; @@ -36,8 +34,20 @@ export function Keytips(): JSXElement { } />
- {commandKey()} or {modifierKey} + shift{" "} - + p - command line + + {commandKey()} - command line + + } + else={ + <> + {commandKey()} or {modifierKey} +{" "} + shift + p - command line + + } + /> ); diff --git a/frontend/src/ts/components/pages/AboutPage.tsx b/frontend/src/ts/components/pages/AboutPage.tsx index f14caf161fb8..375f81574921 100644 --- a/frontend/src/ts/components/pages/AboutPage.tsx +++ b/frontend/src/ts/components/pages/AboutPage.tsx @@ -20,6 +20,11 @@ import { H2, H3 } from "../common/Headers"; export function AboutPage(): JSXElement { const isOpen = () => getActivePage() === "about"; + const isFirefox = window.navigator.userAgent + .toLowerCase() + .includes("firefox"); + const commandKey = (): string => + getConfig.quickRestart === "esc" ? "tab" : "esc"; const contributors = useQuery(() => ({ ...getContributorsQueryOptions(), @@ -203,9 +208,20 @@ export function AboutPage(): JSXElement {

You can use tab and enter (or just{" "} tab if you have quick tab mode enabled) to restart the - typing test. Open the command line by pressing ctrl/cmd +{" "} - shift + p or esc - there you can - access all the functionality you need without touching your mouse. + typing test. Open the command line by pressing{" "} + + ctrl/cmd + shift + p or{" "} + {commandKey()} + + } + > + {commandKey()} + {" "} + - there you can access all the functionality you need without touching + your mouse.

diff --git a/frontend/src/ts/pages/settings.ts b/frontend/src/ts/pages/settings.ts index 3cf3e11f6bc2..8fdf3a57b93a 100644 --- a/frontend/src/ts/pages/settings.ts +++ b/frontend/src/ts/pages/settings.ts @@ -724,15 +724,13 @@ export async function update( CustomBackgroundFilter.updateUI(); const userAgent = window.navigator.userAgent.toLowerCase(); - const modifierKey = - userAgent.includes("mac") && !userAgent.includes("firefox") - ? "cmd" - : "ctrl"; + const isFirefox = userAgent.includes("firefox"); + const modifierKey = userAgent.includes("mac") && !isFirefox ? "cmd" : "ctrl"; const commandKey = Config.quickRestart === "esc" ? "tab" : "esc"; qs(".pageSettings .tip")?.setHtml(` tip: You can also change all these settings quickly using the - command line (${commandKey} or ${modifierKey} + shift + p)`); + command line (${isFirefox ? `${commandKey}` : `${commandKey} or ${modifierKey} + shift + p`})`); if ( customLayoutFluidSelect !== undefined &&