-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add RichText support to find.text() #87197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @goderbauer - I addressed all of your concerns. Can you review again? :) |
| /// [Text] and [Text.rich] widgets) are matched by comparing the | ||
| /// [InlineSpan.toPlainText] with the given `text`. | ||
| /// If `skipRichText` is enabled, all standalone [RichText] widgets are | ||
| /// ignored and [Text] matching shortcuts to [Text.data]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds confusing, maybe better:
| /// ignored and [Text] matching shortcuts to [Text.data]. | |
| /// ignored and `text` is matched with [Text.data]. |
|
@goderbauer I addressed your comments from code review. |
|
Looks the analyzer is unhappy and some tests are failing. Can you take a look? |
|
@goderbauer Thanks - I cannot believe I missed that; updated it. |
goderbauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after nits are fixed.
Co-authored-by: Michael Goderbauer <[email protected]>
|
@goderbauer done 👍 |
|
@dnfield thx a lot ❤️ |
Description
Adds support for matching standalone
RichTextwidgets tofind.text()in a backwards-compatible manner. That is, this does not break any existing tests (which #21964 did).It adds the arguably better strategy for matching
Textwidgets (using onlyRichText) behind askipRichTextflag that has to be set tofalse.Documentation
I have added both extensive additions to the existing
find.text()docs as well as a comment to explain why we are using the inferiorwidget is Textmethod of looking upTextwidgets (when we could just always only look forRichTextas that is also inserted byTextwidgets).Tests
I have added test cases for every possible scenario, which ensures that both the new
skipRichText: falsestrategy finds every text widget once, as well as testing that the old strategy does not matchRichTextat all.The semantics test case is taken from #21964.
Issues
This resolves a popular issue:
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.