Skip to content

[js] Add extended and symbolic macOS/ChromeDriver key representations #15957

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

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

iampopovich
Copy link
Contributor

@iampopovich iampopovich commented Jun 25, 2025

User description

🔗 Related Issues

fixes #15945

💥 What does this PR do?

This pull request adds support for extended macOS/ChromeDriver keys and symbolic macOS keys in the webdriver.Key object within javascript/webdriver/key.js. These changes expand the range of key codes available for macOS-specific functionality.

Enhancements to macOS key support:

  • javascript/webdriver/key.js: Added extended macOS/ChromeDriver keys (RIGHT_SHIFT, RIGHT_CONTROL, RIGHT_ALT, RIGHT_COMMAND) with their respective Unicode values.
  • javascript/webdriver/key.js: Introduced symbolic macOS keys (OPTIONS, FUNCTION) with placeholder Unicode values, pending verification with the WebDriver specification.

🔧 Implementation Notes

💡 Additional Considerations

🔄 Types of changes

  • New feature (non-breaking change which adds functionality)

PR Type

Enhancement


Description

  • Add extended macOS/ChromeDriver key representations (RIGHT_SHIFT, RIGHT_CONTROL, RIGHT_ALT, RIGHT_COMMAND)

  • Introduce symbolic macOS keys (OPTIONS, FUNCTION) with placeholder Unicode values

  • Expand key code support for macOS-specific functionality


Changes walkthrough 📝

Relevant files
Enhancement
key.js
Extended macOS key support                                                             

javascript/webdriver/key.js

  • Added four extended macOS/ChromeDriver keys with Unicode values
  • Introduced two symbolic macOS keys with placeholder values
  • Fixed trailing comma formatting for existing META key
  • +11/-1   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Duplicate Values

    The symbolic macOS keys OPTIONS and FUNCTION are using the same Unicode values as RIGHT_SHIFT and RIGHT_CONTROL respectively. This creates ambiguity and potential conflicts when these keys are used.

    RIGHT_SHIFT:   '\uE050',
    RIGHT_CONTROL: '\uE051',
    RIGHT_ALT:     '\uE052',
    RIGHT_COMMAND: '\uE053',
    
    // Symbolic macOS keys
    OPTIONS:       '\uE050',  // TODO: verify Unicode value with WebDriver spec
    FUNCTION:      '\uE051'   // TODO: symbolic only; confirm or remove in future
    TODO Comments

    The symbolic macOS keys contain TODO comments indicating uncertainty about their Unicode values and future status. This suggests incomplete implementation that may need verification before merging.

    OPTIONS:       '\uE050',  // TODO: verify Unicode value with WebDriver spec
    FUNCTION:      '\uE051'   // TODO: symbolic only; confirm or remove in future

    Copy link
    Contributor

    qodo-merge-pro bot commented Jun 25, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix duplicate Unicode key mappings
    Suggestion Impact:The suggestion partially impacted the commit - only the OPTIONS key was changed from '\uE050' to '\uE052', while FUNCTION key remained unchanged at '\uE051'

    code diff:

    -  OPTIONS:       '\uE050',  // TODO: verify Unicode value with WebDriver spec
    +  OPTIONS:       '\uE052',  // TODO: verify Unicode value with WebDriver spec

    The symbolic macOS keys OPTIONS and FUNCTION are using the same Unicode values
    as RIGHT_SHIFT and RIGHT_CONTROL respectively. This creates duplicate key
    mappings that could cause conflicts when these keys are used in automation
    scripts.

    javascript/webdriver/key.js [100-102]

     // Symbolic macOS keys
    -OPTIONS:       '\uE050',  // TODO: verify Unicode value with WebDriver spec
    -FUNCTION:      '\uE051'   // TODO: symbolic only; confirm or remove in future
    +OPTIONS:       '\uE054',  // TODO: verify Unicode value with WebDriver spec
    +FUNCTION:      '\uE055'   // TODO: symbolic only; confirm or remove in future

    [Suggestion processed]

    Suggestion importance[1-10]: 8

    __

    Why: The suggestion correctly identifies that the newly added keys OPTIONS and FUNCTION use the same Unicode values as RIGHT_SHIFT and RIGHT_CONTROL, which would cause conflicts. The proposed change to unique values is a valid and important correction.

    Medium
    • Update

    @iampopovich iampopovich changed the title Add extended and symbolic macOS/ChromeDriver key representations [js] Add extended and symbolic macOS/ChromeDriver key representations Jun 25, 2025
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    [🚀 Feature]: Add macOS-specific keys (OPTION, FN) to Keys enum
    1 participant