Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OS detection for cross-browser compatibility #8784

Merged
merged 7 commits into from
Jul 17, 2024

Conversation

lappemic
Copy link
Contributor

This PR addresses part of the issue described in #8736, where Slider Component Demos and some UI elements were not working correctly in Firefox and Safari.

Changes made:

  • Replaced the use of navigator.userAgentData with a more compatible get_os() function
  • Updated the logic for setting the meta_key based on the detected OS

These changes improve compatibility across different browsers, particularly Firefox and Safari. The new implementation:

  • Fixes the functionality of tabs and the "Open in..." button in Firefox and Safari
  • Resolves the demo loading issue in Safari

Note: The demo in Firefox still requires further investigation.

To test:

  1. Check the functionality of tabs and the "Open in..." button in Firefox and Safari
  2. Verify that the demo loads correctly in Safari
  3. Confirm that the correct keyboard shortcut (⌘+K for Mac/iOS, CTRL+K for others) is displayed

If anyhone knows how to address the Firefox demo issue i would love to fix this as well.

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 15, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/b3369ca18539a4e2c697bebab2441de574b54937/gradio-4.38.1-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@b3369ca18539a4e2c697bebab2441de574b54937#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/b3369ca18539a4e2c697bebab2441de574b54937/gradio-client-1.3.0.tgz

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Jul 15, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
website minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Fix OS detection for cross-browser compatibility

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@abidlabs abidlabs requested a review from aliabd July 15, 2024 18:59
Copy link
Collaborator

@aliabd aliabd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lappemic! Changes look good to me.

I'll continue to debug what's going on with demos on firefox.

@aliabd aliabd merged commit 2cc813a into gradio-app:main Jul 17, 2024
7 of 8 checks passed
@pngwn pngwn mentioned this pull request Jul 17, 2024
@lappemic lappemic deleted the 8736-fix-slider-component-demo branch July 18, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants