fix(auto-query): improve icon display logic by adding selectable text element check#1087
Merged
fix(auto-query): improve icon display logic by adding selectable text element check#1087
Conversation
…element check This commit fixes the auto-query icon display issue by ensuring icons only appear when the focused element is a selectable text control. Changes made: - Added `isFocusedSelectableTextElement()` method to verify if the focused element can accept text input - Added bundle ID allowlist for apps where focused element detection via Accessibility APIs is unreliable - Enhanced logging to debug icon display decisions - Updated auto-select text logic to skip when focused element is not selectable text The fix prevents false positives by checking the UI element's role, selected text range, and content, ensuring the auto-query feature only triggers in appropriate contexts.
This refactoring enhances the focused element detection system with better organization and naming consistency. Key improvements: - Renamed `isTextField` to `isTextInputField` for clarity - Centralized selectable text roles in `FocusedElementInfo.selectableTextRoles` - Consolidated role checking logic to use `selectableTextRoles` instead of redundant definitions - Updated method signatures to use consistent naming - Improved code organization by moving role definitions to their logical location The changes make the code more maintainable and reduce duplication while maintaining full backward compatibility.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit fixes the auto-query icon display issue by ensuring icons only appear when the focused element is a selectable text control.
Changes made:
isFocusedSelectableTextElement()method to verify if the focused element can accept text inputThe fix prevents false positives by checking the UI element's role, selected text range, and content, ensuring the auto-query feature only triggers in appropriate contexts.
Fix #1079