Skip to content

Conversation

@iampopovich
Copy link
Contributor

@iampopovich iampopovich commented Jun 25, 2025

User description

🔗 Related Issues

relates to #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

  • Include TODO comments for future WebDriver specification verification


Diagram Walkthrough

flowchart LR
  A["webdriver.Key object"] -->|"Add extended keys"| B["RIGHT_SHIFT, RIGHT_CONTROL, RIGHT_ALT, RIGHT_COMMAND"]
  A -->|"Add symbolic keys"| C["OPTIONS, FUNCTION"]
  B -->|"Unicode values"| D["E050-E053"]
  C -->|"Placeholder values"| E["E052, E051 - pending verification"]
Loading

File Walkthrough

Relevant files
Enhancement
key.js
Expand macOS key support with extended and symbolic keys 

javascript/webdriver/key.js

  • Added four extended macOS/ChromeDriver keys with Unicode values
    (E050-E053)
  • Introduced two symbolic macOS keys (OPTIONS, FUNCTION) with
    placeholder Unicode values
  • Added TODO comments indicating need for WebDriver specification
    verification
  • Fixed trailing comma on META key definition for consistency
+11/-1   

@qodo-merge-pro
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

@qodo-merge-pro
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
@iampopovich iampopovich marked this pull request as draft October 24, 2025 13:42
@iampopovich iampopovich marked this pull request as ready for review October 24, 2025 13:45
@qodo-merge-pro
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Key code collision

Description: Key code collisions: symbolic keys OPTIONS ('\uE052') and FUNCTION ('\uE051') reuse the
same Unicode values assigned to RIGHT_ALT and RIGHT_CONTROL, which can cause ambiguous
input interpretation and unintended behavior when simulating keys.
key.js [95-102]

Referred Code
RIGHT_SHIFT:   '\uE050',
RIGHT_CONTROL: '\uE051',
RIGHT_ALT:     '\uE052',
RIGHT_COMMAND: '\uE053',

// Symbolic macOS keys
OPTIONS:       '\uE052',  // TODO: verify Unicode value with WebDriver spec
FUNCTION:      '\uE051'   // TODO: symbolic only; confirm or remove in future
Ticket Compliance
🎫 No ticket provided
- [ ] Create ticket/issue <!-- /create_ticket --create_ticket=true -->

</details></td></tr>
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
No custom compliance provided

Follow the guide to enable custom compliance check.

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-merge-pro
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Assign a unique, non-conflicting value

Assign a unique, non-conflicting Unicode value to the FUNCTION key instead of
reusing the value for RIGHT_CONTROL. This prevents sendKeys(Key.FUNCTION) from
incorrectly sending a RIGHT_CONTROL key press.

javascript/webdriver/key.js [102]

-FUNCTION:      '\uE051'   // TODO: symbolic only; confirm or remove in future
+FUNCTION:      '\uE054'   // TODO: symbolic only; confirm or remove in future
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that aliasing FUNCTION to RIGHT_CONTROL is incorrect and could cause bugs. Proposing a unique, non-conflicting Unicode private use character is a good solution for a symbolic key, preventing unexpected behavior.

Medium
Use generic ALT key value

Alias the OPTIONS key to the generic ALT key's value (\uE00A) instead of the
specific RIGHT_ALT value (\uE052). This aligns with standard keyboard mappings
on macOS and provides more predictable behavior.

javascript/webdriver/key.js [101]

-OPTIONS:       '\uE052',  // TODO: verify Unicode value with WebDriver spec
+OPTIONS:       '\uE00A',  // Alias for ALT
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly points out that the OPTIONS key should be an alias for the generic ALT key, not the specific RIGHT_ALT. Using the standard WebDriver value for ALT (\uE00A) improves correctness and predictability.

Medium
  • More

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.

1 participant