Skip to content
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

Add ProcessTextService #137145

Merged
merged 1 commit into from Oct 26, 2023
Merged

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Oct 24, 2023

Description

This PR adds ProcessTextService on the framework side to communicate with the engine to query and run text processing actions (on the engine side, only Android is supported currently, see flutter/engine#44579).

Related Issue

Non-UI framework side for #139361

Tests

Adds 3 tests.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Oct 24, 2023
@bleroux bleroux requested a review from camsim99 October 24, 2023 14:20
Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

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

Looks good! Just left some nits

/// The `readOnly` parameter indicates that the transformed text, it if exists,
/// will be used as read-only.
/// See https://developer.android.com/reference/android/content/Intent#EXTRA_PROCESS_TEXT_READONLY.
Future<String?> processTextAction(String id, String text, bool readOnly);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it purposeful that this is separated from the default service in the sense that the behavior here is intended to be customizable? Assuming so, a nit is maybe the link can be mentioned in the default service since this seems specific to Android?

abstract class ProcessTextService {
/// Returns a [Future] that resolves to a [List] of [ProcessTextAction]s
/// containing all text processing actions available.
Future<List<ProcessTextAction>> queryTextActions();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: maybe note that if there are none available, an empty list will be returned.

@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 26, 2023
@auto-submit auto-submit bot merged commit b2ec34f into flutter:master Oct 26, 2023
65 checks passed
@bleroux bleroux deleted the process_text_service branch October 26, 2023 12:01
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 26, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 26, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 26, 2023
flutter/flutter@5dd2a4e...c555599

2023-10-26 engine-flutter-autoroll@skia.org Roll Packages from f751ffb to fea24c5 (4 revisions) (flutter/flutter#137339)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 23649a0529e5 to 61ae5ef94e9c (1 revision) (flutter/flutter#137337)
2023-10-26 15619084+vashworth@users.noreply.github.com Run test with older version of Xcode (flutter/flutter#137293)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from f8525b9fdddf to 23649a0529e5 (1 revision) (flutter/flutter#137333)
2023-10-26 leroux_bruno@yahoo.fr Add ProcessTextService (flutter/flutter#137145)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from b6bea17e39d3 to f8525b9fdddf (1 revision) (flutter/flutter#137330)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from ec29ea930f58 to b6bea17e39d3 (1 revision) (flutter/flutter#137329)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2a01fae53ded to ec29ea930f58 (1 revision) (flutter/flutter#137326)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 10a91eb44c5b to 2a01fae53ded (1 revision) (flutter/flutter#137320)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from f844ab933364 to 10a91eb44c5b (1 revision) (flutter/flutter#137317)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6428ed576841 to f844ab933364 (1 revision) (flutter/flutter#137314)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6e09ee14e244 to 6428ed576841 (38 revisions) (flutter/flutter#137310)
2023-10-26 50643541+Mairramer@users.noreply.github.com fix:: trigger onTapOutside only if has focus (flutter/flutter#136291)
2023-10-25 goderbauer@google.com Fix structure of pkg:integration_test (flutter/flutter#137283)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
HugoOlthof pushed a commit to moneybird/packages that referenced this pull request Dec 13, 2023
…r#5237)

flutter/flutter@5dd2a4e...c555599

2023-10-26 engine-flutter-autoroll@skia.org Roll Packages from f751ffb to fea24c5 (4 revisions) (flutter/flutter#137339)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 23649a0529e5 to 61ae5ef94e9c (1 revision) (flutter/flutter#137337)
2023-10-26 15619084+vashworth@users.noreply.github.com Run test with older version of Xcode (flutter/flutter#137293)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from f8525b9fdddf to 23649a0529e5 (1 revision) (flutter/flutter#137333)
2023-10-26 leroux_bruno@yahoo.fr Add ProcessTextService (flutter/flutter#137145)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from b6bea17e39d3 to f8525b9fdddf (1 revision) (flutter/flutter#137330)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from ec29ea930f58 to b6bea17e39d3 (1 revision) (flutter/flutter#137329)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 2a01fae53ded to ec29ea930f58 (1 revision) (flutter/flutter#137326)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 10a91eb44c5b to 2a01fae53ded (1 revision) (flutter/flutter#137320)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from f844ab933364 to 10a91eb44c5b (1 revision) (flutter/flutter#137317)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6428ed576841 to f844ab933364 (1 revision) (flutter/flutter#137314)
2023-10-26 engine-flutter-autoroll@skia.org Roll Flutter Engine from 6e09ee14e244 to 6428ed576841 (38 revisions) (flutter/flutter#137310)
2023-10-26 50643541+Mairramer@users.noreply.github.com fix:: trigger onTapOutside only if has focus (flutter/flutter#136291)
2023-10-25 goderbauer@google.com Fix structure of pkg:integration_test (flutter/flutter#137283)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC camillesimon@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants