Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@yaakovschectman
Copy link
Contributor

For now at least, this PR will mostly serve as feedback for how to actually represent the tooltip in the MSAA node on Windows. Currently, I am appending it to the end of the Name field. We can change this to a different approach if desired. I will add/modify tests once we are sure of the approach to use.

Addresses flutter/flutter#112876

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

If this is the approach we are going to take, the code looks good to me. Do you know what's native behavior for tooltip?

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

Overall looks good, just need to bump the new value to the end of the FlutterSemanticsNode struct.

target->GetString16Attribute(ax::mojom::StringAttribute::kTooltip);
if (!tooltip.empty()) {
AppendTextToString(tooltip, &name);
}
Copy link
Member

Choose a reason for hiding this comment

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

It looks like UIA has better support for tooltips via the UIA_HelpTextPropertyId property. At some point, we should plan to do some research into how much effort would be required to migrate from MSAA to UIA, but this seems like a reasonable approach given the constraints of MSAA.

@cbracken
Copy link
Member

If this is the approach we are going to take, the code looks good to me. Do you know what's native behavior for tooltip?

From looking at the MSAA docs, native Win32 tooltips are modelled as a new window with their own nodes in the a11y tree.

I'm not entirely sure what the "right" behaviour for Flutter tooltips is. For example, if we needed to support hit-testing on tooltips, we'd probably want to model them as a separate node with their own extent etc. This seems like a reasonable stopgap fix for the time being though.

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

LGTM stamp from a Japanese personal seal

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants