Skip to content

Emoji panel and clipboard history: locate correct items if controls are different due to recent changes#10378

Closed
josephsl wants to merge 8 commits into
nvaccess:masterfrom
josephsl:i10377emojiPanelTraversal
Closed

Emoji panel and clipboard history: locate correct items if controls are different due to recent changes#10378
josephsl wants to merge 8 commits into
nvaccess:masterfrom
josephsl:i10377emojiPanelTraversal

Conversation

@josephsl

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #10377

Summary of the issue:

In May 2019 Update, wrong item is announced when emoji panel and clipboard history opens due to UIA tree changes.

Description of how this pull request fixes the issue:

Depending on UIA automation ID, select the right child from emoji panel/clipboard history panel so the correct item can be announced when it opens.

Testing performed:

Tested via Windows 10 App Essentials add-on.

Known issues with pull request:

None

Change log entry:

None

# This event is properly raised in build 17134.
if winVersion.winVersion.build <= 17134 and childAutomationID in ("TEMPLATE_PART_ExpressiveInputFullViewFuntionBarItemControl", "TEMPLATE_PART_ExpressiveInputFullViewFuntionBarCloseButton"):
if (
winVersion.winVersion.build <= 17134

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we use winVersion.isWin10 instead?

if (
winVersion.winVersion.build <= 17134
and inputPanelAutomationID in (
"TEMPLATE_PART_ExpressiveInputFullViewFuntionBarItemControl",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could you store these in a constant?

):
try:
self.event_UIA_elementSelected(obj.firstChild.firstChild.firstChild, nextHandler)
self.event_UIA_elementSelected(inputPanel.firstChild.firstChild, nextHandler)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm curious what @michaelDCurran thinks here, but I'd prefer something like eventHandler.executeEvent instead. IN the current code, it is difficult to find out how the flow of events is.

emojisList = emojisList.previous
try:
self.event_UIA_elementSelected(obj.firstChild.children[-2].firstChild.firstChild, nextHandler)
self.event_UIA_elementSelected(emojisList.firstChild.firstChild, nextHandler)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above

clipboardHistory = obj.children[-2]
if clipboardHistory.UIAElement.cachedAutomationID == inputPanelAutomationID:
clipboardHistory = clipboardHistory.next
self.event_UIA_elementSelected(clipboardHistory, nextHandler)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same as above

@josephsl

josephsl commented Oct 14, 2019 via email

Copy link
Copy Markdown
Contributor Author

@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

Deferred to after 2019.3 release. Thanks.

@josephsl

Copy link
Copy Markdown
Contributor Author

Hi,

Now that 2019.3 stable version is out, let's get this PR going again. Note that this PR might be influenced by a UIA IME branch being worked on by @michaelDCurran.

Thanks.

…s. Re nvaccess#10377.

For ease of readability, rename childAutomationID to inputPanelAutomationID, and assign obj.firstChild to inputPanel to better communicate event traversals.
…and clipboard history can be announced. Re nvaccess#10377.

In recent versions of emoji panel and clipboard history (particularly since may 2019 Update), something other than selected item is announced - for example, clipboard tip instead of most recently copied item, or emoji group rather than selected emoji (the latter leading to NVDA staying silent). Thus make sure to keep in mind by checking for UIA automation ID's for both old and new versions. moving to a different element if the automation ID is different from old releases.
…vents directly. Re nvaccess#10377.

Reviewed by Leonard de Ruijter: try using eventHandler.executeEvent when firing UIA item selected event for various modern keyboard features.
@josephsl

josephsl commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

Hi,

I'm looking into an alternative implementation that may future-proof this and could serve as a test bed for File Explorer status bar announcement issue (don't remember exactly which ticket it was). basically I'm thinking about locating a specific UIA element based on automation ID rather than traversing through the UIA tree. If it works (to be tested via Windows 10 App Essentials add-on), I'll open a successor PR to resolve this unless it is fine to continue working on this branch.

Thanks.

@josephsl

josephsl commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

Hi,

Actually, scratch the alternative - traversal is still required when reading clipboard announcement when clipboard history is empty. So traversal is the way to go for this one.

Thanks.

@josephsl

josephsl commented May 27, 2020

Copy link
Copy Markdown
Contributor Author

Potentially blocked by #11214. Once that PR is included in master, I suggest merging this PR, as the follow-up described in the mentioned PR will apply to this work also.

Update: #11214 does not block this PR, as they address two different things.

Thanks.

@feerrenrut

Copy link
Copy Markdown
Contributor

@josephsl let me know if I misunderstood please.

This PR is blocked requiring #11214 in order to be able traverse the emoji and clipboard history. Labeling as blocked.

@josephsl

josephsl commented Jul 1, 2020

Copy link
Copy Markdown
Contributor Author

Hi,

Technically, #11214 addresses name change event in emoji panel. This PR addresses UIA element traversal, which is different from that PR (note: the above comment was corrected).

Thanks.

@feerrenrut feerrenrut removed the blocked label Jul 2, 2020
@josephsl

josephsl commented Aug 3, 2020

Copy link
Copy Markdown
Contributor Author

Hi,

Since #11447 was merged, this pull request has become a bit complicated, as modern keyboard support must be revised extensively thanks to detection of UIA events for elements with no Automation Id property. Therefore a future PR will succeed this one - closing for now (I plan to integrate this PR into the succeeding PR).

Thanks.

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.

Emoji panel and clipboard history: wrong item is announced when selecting first item in May 2019 Update and later

3 participants