From fafde57030e46147371ddd802fec9c6aff5feda7 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 16 Apr 2026 15:58:11 +0000 Subject: [PATCH] fix: render correct meta key in keyboard hints on Windows/Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardcoded ⌘ glyphs in compose hints were misleading on non-mac platforms. Add a tiny platform helper sourced from the existing window.electronWindow.platform bridge and substitute "Ctrl" off mac. Closes #167. https://claude.ai/code/session_01YZY4wUqACT7mgibHr2Yncx --- js/src/features/compose/configure-stream-step.tsx | 3 ++- js/src/features/compose/text-editor.tsx | 5 +++-- js/src/lib/platform.ts | 5 +++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 js/src/lib/platform.ts diff --git a/js/src/features/compose/configure-stream-step.tsx b/js/src/features/compose/configure-stream-step.tsx index fb910b5..cf5b363 100644 --- a/js/src/features/compose/configure-stream-step.tsx +++ b/js/src/features/compose/configure-stream-step.tsx @@ -1,6 +1,7 @@ import { useState, useCallback } from "react"; import { useNetworks } from "@/hooks/use-networks"; import { cn, removeDuplicates } from "@/lib/utils"; +import { metaKey } from "@/lib/platform"; import { useAuthStore } from "@/stores/auth-store"; import { generateRandomName } from "@/lib/random-name"; import { Input } from "@/components/ui/input"; @@ -163,7 +164,7 @@ export function ConfigureStreamStep({ - ⌘+Enter + {metaKey}+Enter {" "} create diff --git a/js/src/features/compose/text-editor.tsx b/js/src/features/compose/text-editor.tsx index 618c416..900cae1 100644 --- a/js/src/features/compose/text-editor.tsx +++ b/js/src/features/compose/text-editor.tsx @@ -1,6 +1,7 @@ import { useEffect, useRef, useCallback, useState } from "react"; import { Paperclip } from "lucide-react"; import { cn } from "@/lib/utils"; +import { metaKey } from "@/lib/platform"; import { useAllLinkMetadata } from "@/hooks/use-link-metadata"; import { AttachmentStrip } from "@/features/compose/attachment-strip"; import type { PendingAttachment } from "@/features/compose/attachment-strip"; @@ -178,14 +179,14 @@ export function TextEditor({ - ⌘+Enter + {metaKey}+Enter {" "} {submitHint} {immersive && ( - ⌘+M + {metaKey}+M {" "} markdown diff --git a/js/src/lib/platform.ts b/js/src/lib/platform.ts new file mode 100644 index 0000000..8782f64 --- /dev/null +++ b/js/src/lib/platform.ts @@ -0,0 +1,5 @@ +export const isMac = window.electronWindow?.platform === "darwin"; + +// Symbol to show in keyboard hints for the primary modifier +// (Cmd on macOS, Ctrl on Windows/Linux). +export const metaKey = isMac ? "⌘" : "Ctrl";