Skip to content

Outlook 2016: report category and flagged status for messages.#8608

Merged
michaelDCurran merged 7 commits into
masterfrom
i8603
Aug 14, 2018
Merged

Outlook 2016: report category and flagged status for messages.#8608
michaelDCurran merged 7 commits into
masterfrom
i8603

Conversation

@michaelDCurran
Copy link
Copy Markdown
Member

Link to issue number:

Fixes #8603

Summary of the issue:

When navigating the message list in Outlook 2016, NVDA does not report the message category or flag status (completed etc).

Description of how this pull request fixes the issue:

Ensure to collect the category and flag fields when traversing the UIA row's children.
Note that category and flagged are not text elements, but they do have welldefined UIA class names.
Thus the UIA cache request now grabs all children no matter their controlType, but the for loop only allows text elements and or those two class names.

Testing performed:

Testd with Outlook 2016. Focused a message with NVDA: NVDA announced the category and flagged status as the last two bits of information.

Known issues with pull request:

None.

Change log entry:

Bug fixes:

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@michaelDCurran commented on 8 aug. 2018 08:37 CEST:

When navigating the message list in Outlook 2016, NVDA does not report the ... flag status (completed etc).

Does this differ from how we are adding a flagIconLabel to the message announcement?

There are some relevant comments from #7949:

I will fetch the appModule and use it on my system for a while. But it is at least very important to test this thoroughly in conversations view.

Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

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

Indeed, this does break in conversations view.

DEBUGWARNING - external:appModules.outlook.UIAGridRow._get_name (09:12:58.086):
Unable to get relevant children for UIAGridRow

…sation view threads where it fails to return any children at all. We can instead filter the tree for text and image elements which seems to get around the issue.
@michaelDCurran
Copy link
Copy Markdown
Member Author

michaelDCurran commented Aug 8, 2018 via email

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@michaelDCurran commented on 8 aug. 2018 10:20 CEST:

This is clearly a bug in the UIA client library then.

Is it? Or is it an issue in Outlook where conversation view children aren't treated as content? They really should be treated a such IMO, at least in a similar way as in normal message view.

However, I think I have worked around it, by changing the treeFilter to
allow both text and image elements.

Hmm, that should work. However, note that this will also retrieve children that are considered non content, for example, the "no attachments" image. You're clearly filtering this later on though. It would be amazing if Microsoft can fix this, in which case we can also do attachment announcements using UIA.

@LeonarddeR
Copy link
Copy Markdown
Collaborator

I also discovered that NVDA is now announcing "no flag" for messages without a flag. This seems a bit redundant to me.

or UIAClassName in ("CategoryField","FlagField")
):
continue
name=e.cachedName
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.

In an earlier version of #7949, I used this code snippet below this line:

			isFlag = UIAClassName=="FlagField"
			if isFlag:
				flagIcon=0
				if selection:
					try:
						flagIcon=selection.flagIcon
					except COMError:
						pass
				if not flagIcon:
					# This message has no flag.
					# Filter the flag field, as it provides redundant information.
					# Ignore flags if the object model couldn't be accessed.
					continue

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.

THen, below the if text: line:

				if isFlag:
					# At least Outlook 2016 seems to have a bug where it is not possible to reorder the flag field in a view.
					# Since flags are considered important, announce them as early as possible.
					textList.insert(0, text)
				else:
					text+=u","
					textList.append(text)

Feel free to discard from this code whatever you do not like. And at least do not forget to remove the flag fetching that happens earlier :)

@michaelDCurran
Copy link
Copy Markdown
Member Author

michaelDCurran commented Aug 8, 2018 via email

LeonarddeR
LeonarddeR previously approved these changes Aug 8, 2018
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

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

From a code perspective, this looks ok now. I will test it during the next few days.

In the meanwhile, I'm getting increasing requests from people to add reading replied to/forwarded status to outlook messages. However, we rely on localised data for this info, and as noted earlier, the German order is different than the Dutch/English order, so we can't reliable filter redundant information. The information is present in the grid row's value in Outlook 15 (2013) and above. In Outlook 2010, the value might be identical to the name and thus is really redundant.

I see three possible implementations for this:

  1. Revert the value = None for outlook 2013 and above.
  2. Similar to 1, but map the value to the description object attribute. This allows people to toggle descriptions on and off in a per app profile, for example. This is my preferred approach.
  3. Add an object gesture to GridRow that reads the value.

Note that the value contains read/unread status, forwarded/replied as well as the message class (i.e. meeting request)

@michaelDCurran
Copy link
Copy Markdown
Member Author

I reverted the replied/forwarded stuff. And have also removed the oleFlagLabels dictionary as it is no longer used.

# Stops us from reporting "no categories" which is too verbose.
elif UIAClassName=="CategoryField":
try:
if not selection.categories: continue
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.

For me, this fails on the top level tree view items like "today" or "yesterday" when using conversations view.

AttributeError: 'NoneType' object has no attribute 'flagIcon'```

May be return early if not selection, or something like that?

…ion when matching on different fields for message rows.
@michaelDCurran
Copy link
Copy Markdown
Member Author

michaelDCurran commented Aug 9, 2018 via email

LeonarddeR
LeonarddeR previously approved these changes Aug 9, 2018
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

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

All right, this works as expected now :)

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.

"Categories" not reported for messages in Outlook

3 participants