fix: render correct meta key in keyboard hints on Windows/Linux
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
This commit is contained in:
@@ -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({
|
||||
</span>
|
||||
<span>
|
||||
<kbd className="rounded bg-white/10 px-1.5 py-0.5 font-mono text-xs">
|
||||
⌘+Enter
|
||||
{metaKey}+Enter
|
||||
</kbd>{" "}
|
||||
create
|
||||
</span>
|
||||
|
||||
@@ -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({
|
||||
</span>
|
||||
<span>
|
||||
<kbd className="rounded bg-white/10 px-1.5 py-0.5 font-mono text-xs">
|
||||
⌘+Enter
|
||||
{metaKey}+Enter
|
||||
</kbd>{" "}
|
||||
{submitHint}
|
||||
</span>
|
||||
{immersive && (
|
||||
<span>
|
||||
<kbd className="rounded bg-white/10 px-1.5 py-0.5 font-mono text-xs">
|
||||
⌘+M
|
||||
{metaKey}+M
|
||||
</kbd>{" "}
|
||||
markdown
|
||||
</span>
|
||||
|
||||
@@ -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";
|
||||
Reference in New Issue
Block a user