Skip to content

Commit b2e8690

Browse files
authored
🤖 fix: use platform-aware keybind in review comment hints (#991)
_Generated with `mux`_ The review comment editor showed "⌘Enter save, Esc cancel" regardless of platform. Now uses `formatKeybind(KEYBINDS.SAVE_EDIT)` to show: - **Linux/Windows**: Ctrl+Enter - **macOS**: ⌘·Enter
1 parent 01513de commit b2e8690

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/browser/components/ReviewsBanner.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import type { Review } from "@/common/types/review";
2929
import { useReviews } from "@/browser/hooks/useReviews";
3030
import { formatRelativeTime } from "@/browser/utils/ui/dateTime";
3131
import { DiffRenderer } from "./shared/DiffRenderer";
32-
import { matchesKeybind, KEYBINDS } from "@/browser/utils/ui/keybinds";
32+
import { matchesKeybind, formatKeybind, KEYBINDS } from "@/browser/utils/ui/keybinds";
3333

3434
// ═══════════════════════════════════════════════════════════════════════════════
3535
// ERROR BOUNDARY
@@ -262,7 +262,9 @@ const ReviewItem: React.FC<ReviewItemProps> = ({
262262
placeholder="Your comment..."
263263
/>
264264
<div className="flex items-center justify-end gap-1">
265-
<span className="text-muted mr-2 text-[10px]">⌘Enter to save, Esc to cancel</span>
265+
<span className="text-muted mr-2 text-[10px]">
266+
{formatKeybind(KEYBINDS.SAVE_EDIT)} to save, Esc to cancel
267+
</span>
266268
<Button
267269
variant="ghost"
268270
size="sm"

src/browser/components/shared/ReviewBlock.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import React, { useState, useCallback, useRef, useMemo } from "react";
1010
import { MessageSquare, X, Pencil, Check } from "lucide-react";
1111
import { DiffRenderer } from "./DiffRenderer";
1212
import { Button } from "../ui/button";
13-
import { matchesKeybind, KEYBINDS } from "@/browser/utils/ui/keybinds";
13+
import { matchesKeybind, formatKeybind, KEYBINDS } from "@/browser/utils/ui/keybinds";
1414
import type { ReviewNoteDataForDisplay } from "@/common/types/message";
1515

1616
// ═══════════════════════════════════════════════════════════════════════════════
@@ -130,7 +130,9 @@ const ReviewBlockCore: React.FC<ReviewBlockCoreProps> = ({
130130
placeholder="Your comment..."
131131
/>
132132
<div className="flex items-center justify-end gap-1">
133-
<span className="text-muted mr-1 text-[10px]">⌘Enter save, Esc cancel</span>
133+
<span className="text-muted mr-1 text-[10px]">
134+
{formatKeybind(KEYBINDS.SAVE_EDIT)} save, Esc cancel
135+
</span>
134136
<Button
135137
variant="ghost"
136138
size="sm"

0 commit comments

Comments
 (0)