Use platform-specific meta key in keyboard hints #168

Merged
talksik merged 1 commits from claude/platform-detection-meta-key-7EoBP into master 2026-04-16 16:04:29 +00:00
talksik commented 2026-04-16 16:03:35 +00:00 (Migrated from github.com)

Summary

Updated keyboard hints throughout the application to display the correct modifier key based on the platform (⌘ for macOS, Ctrl for Windows/Linux) instead of hardcoding the macOS symbol.

Changes

  • Created new platform.ts utility module that detects the platform via window.electronWindow?.platform and exports a metaKey constant that resolves to "⌘" on macOS and "Ctrl" on other platforms
  • Updated keyboard hint displays in text-editor.tsx to use the dynamic metaKey variable instead of hardcoded "⌘" symbol for both ⌘+Enter and ⌘+M shortcuts
  • Updated keyboard hint display in configure-stream-step.tsx to use the dynamic metaKey variable for the ⌘+Enter shortcut

Implementation Details

  • The platform detection leverages the Electron window object's platform property, which is set to "darwin" on macOS
  • The metaKey constant is exported from a centralized location to ensure consistency across all keyboard hint displays
  • This change improves UX for Windows and Linux users by showing the correct modifier key for their platform

https://claude.ai/code/session_01YZY4wUqACT7mgibHr2Yncx

## Summary Updated keyboard hints throughout the application to display the correct modifier key based on the platform (⌘ for macOS, Ctrl for Windows/Linux) instead of hardcoding the macOS symbol. ## Changes - Created new `platform.ts` utility module that detects the platform via `window.electronWindow?.platform` and exports a `metaKey` constant that resolves to "⌘" on macOS and "Ctrl" on other platforms - Updated keyboard hint displays in `text-editor.tsx` to use the dynamic `metaKey` variable instead of hardcoded "⌘" symbol for both ⌘+Enter and ⌘+M shortcuts - Updated keyboard hint display in `configure-stream-step.tsx` to use the dynamic `metaKey` variable for the ⌘+Enter shortcut ## Implementation Details - The platform detection leverages the Electron window object's platform property, which is set to "darwin" on macOS - The `metaKey` constant is exported from a centralized location to ensure consistency across all keyboard hint displays - This change improves UX for Windows and Linux users by showing the correct modifier key for their platform https://claude.ai/code/session_01YZY4wUqACT7mgibHr2Yncx
Sign in to join this conversation.