[GH-ISSUE #14892] feat: Show the correct modifier key based on user os #137121

Closed
opened 2026-05-25 06:16:41 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @luantak on GitHub (Jun 11, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/14892

Check Existing Issues

  • I have searched the existing issues and discussions.

Problem Description

Image

Currently instead of showing the correct modifier key based on the users system both possible modifiers are shown.

Desired Solution you'd like

Something like this to show the correct modifier for the users device:

function getModifierLabel() {
  const nav = navigator;

  // 1. UA-Client-Hints (Chromium 89+, Edge 89+, Opera 75+, Android WebView 89+)
  if (nav.userAgentData && nav.userAgentData.platform) {
    return /^mac/i.test(nav.userAgentData.platform) ? '⌘' : 'Ctrl';
  }

  // 2. Legacy sniffing
  const platformString = nav.platform || nav.userAgent || '';
  const isApple =
    /(Mac|iPhone|iPod|iPad)/i.test(platformString);   // includes iPadOS 13+ (MacIntel)
  return isApple ? '⌘' : 'Ctrl';
}

// Example: paint a shortcut label
const modifier = getModifierLabel();           // "⌘" on macOS/iOS, "Ctrl" elsewhere
document.querySelector('#saveTip').textContent = `${modifier} + S`;

I can implement this, just getting feedback if this is wanted first.

Alternatives Considered

No response

Additional Context

No response

Originally created by @luantak on GitHub (Jun 11, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/14892 ### Check Existing Issues - [x] I have searched the existing issues and discussions. ### Problem Description ![Image](https://github.com/user-attachments/assets/4a974102-cb5a-49e1-9ae5-7357cfc9e6dd) Currently instead of showing the correct modifier key based on the users system both possible modifiers are shown. ### Desired Solution you'd like Something like this to show the correct modifier for the users device: ```js function getModifierLabel() { const nav = navigator; // 1. UA-Client-Hints (Chromium 89+, Edge 89+, Opera 75+, Android WebView 89+) if (nav.userAgentData && nav.userAgentData.platform) { return /^mac/i.test(nav.userAgentData.platform) ? '⌘' : 'Ctrl'; } // 2. Legacy sniffing const platformString = nav.platform || nav.userAgent || ''; const isApple = /(Mac|iPhone|iPod|iPad)/i.test(platformString); // includes iPadOS 13+ (MacIntel) return isApple ? '⌘' : 'Ctrl'; } // Example: paint a shortcut label const modifier = getModifierLabel(); // "⌘" on macOS/iOS, "Ctrl" elsewhere document.querySelector('#saveTip').textContent = `${modifier} + S`; ``` I can implement this, just getting feedback if this is wanted first. ### Alternatives Considered _No response_ ### Additional Context _No response_
Author
Owner

@silentoplayz commented on GitHub (Nov 7, 2025):

This should be addressed with v0.6.35 of Open WebUI. Let us know if you have any issues!

Also see https://github.com/open-webui/open-webui/pull/18473.

<!-- gh-comment-id:3504918425 --> @silentoplayz commented on GitHub (Nov 7, 2025): This should be addressed with [v0.6.35](https://github.com/open-webui/open-webui/releases/tag/v0.6.35) of Open WebUI. Let us know if you have any issues! Also see https://github.com/open-webui/open-webui/pull/18473.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#137121