shelley: use Cmd+K on macOS, Ctrl+K elsewhere for command palette

Philip Zeyliger and Claude created

Prompt: Fix https://github.com/boldsoftware/shelley/issues/52

This preserves the native Ctrl+K (kill to end of line) emacs-style
shortcut on macOS.

Fixes https://github.com/boldsoftware/shelley/issues/52

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Change summary

ui/src/App.tsx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

Detailed changes

ui/src/App.tsx 🔗

@@ -113,10 +113,14 @@ function App() {
     loadConversations();
   }, []);
 
-  // Global keyboard shortcut for command palette (Cmd+K / Ctrl+K)
+  // Global keyboard shortcut for command palette (Cmd+K on macOS, Ctrl+K elsewhere)
   useEffect(() => {
+    const isMac = navigator.platform.toUpperCase().includes("MAC");
     const handleKeyDown = (e: KeyboardEvent) => {
-      if ((e.metaKey || e.ctrlKey) && e.key === "k") {
+      // On macOS use Cmd+K, on other platforms use Ctrl+K
+      // This preserves native Ctrl+K (kill to end of line) on macOS
+      const modifierPressed = isMac ? e.metaKey : e.ctrlKey;
+      if (modifierPressed && e.key === "k") {
         e.preventDefault();
         setCommandPaletteOpen((prev) => !prev);
       }