Skip to content

Conversation

@auto-submit
Copy link
Contributor

@auto-submit auto-submit bot commented May 13, 2024

Reverts: #143002

Initiated by: cbracken

Reason for reverting: unresolved docs links. See failure here: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20docs_test/16540/overview

dartdoc:stdout: Generating docs for package flutter...
dartdoc:stderr:   error: unresolved doc reference [TextInput.showSystemContextMenu]
dartdoc:stderr:     from widgets.MediaQueryData.supportsShowingSystemContextMenu: (file:///b/s/w/ir/x/w/flutter/packages/flutt
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: justinmc
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {Renzo-Olivares, hellohuanlin}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
In order to work around the fact that iOS 15 shows a notification on pressing Flutter's paste button (https://github.com/flutter/flutter/issues/103163), this PR allows showing the iOS system context menu in text fields.

<img width="385" alt="Screenshot 2024-02-06 at 11 52 25 AM" src="https://github.com/flutter/flutter/assets/389558/d82e18ee-b8a3-4082-9225-cf47fa7f3674">

It is currently opt-in, which a user would typically do like this (also in example system_context_menu.0.dart):

```dart
      contextMenuBuilder: (BuildContext context, EditableTextState editableTextState) {
        // If supported, show the system context menu.
        if (SystemContextMenu.isSupported(context)) {
          return SystemContextMenu.editableText(
            editableTextState: editableTextState,
          );
        }
        // Otherwise, show the flutter-rendered context menu for the current
        // platform.
        return AdaptiveTextSelectionToolbar.editableText(
          editableTextState: editableTextState,
        );
      },

Requires engine PR flutter/engine#50095.

API changes

SystemContextMenu

A widget that shows the system context menu when built, and removes it when disposed. The main high-level way that most users would use this PR. Only works on later versions of iOS.

SystemContextMenuController

Used under the hood to hide and show a system context menu. There can only be one visible at a time.

MediaQuery.supportsShowingSystemContextMenu

Sent by the iOS embedder to tell the framework whether or not the platform supports showing the system context menu. That way the framework, or Flutter developers, can decide to show a different menu.

flutter/platform ContextMenu.showSystemContextMenu

Sent by the framework to show the menu at a given targetRect, which is the current selection rect.

flutter/platform ContextMenu.hideSystemContextMenu

Sent by the framework to hide the menu. Typically not needed, because the platform will hide the menu when the user taps outside of it and after the user presses a button, but it handles edge cases where the user programmatically rebuilds the context menu, for example.

flutter/platform System.onDismissSystemContextMenu

Sent by the iOS embedder to indicate that the system context menu has been hidden by the system, such as when the user taps outside of the menu. This is useful when there are multiple instances of SystemContextMenu, such as with multiple text fields.

@auto-submit auto-submit bot added the revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests. label May 13, 2024
@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos labels May 13, 2024
@auto-submit auto-submit bot merged commit 14d88ee into master May 13, 2024
@auto-submit auto-submit bot deleted the revert_125543505d2608afccbbd1486bd3380d7c388893 branch May 13, 2024 17:43
justinmc added a commit that referenced this pull request May 13, 2024
auto-submit bot added a commit that referenced this pull request May 13, 2024
Reverts: #148238
Initiated by: zanderso
Reason for reverting: Failures in post submit https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8748025189669617649/+/u/run_test.dart_for_web_canvaskit_tests_shard_and_subshard_3/stdout
Original PR Author: justinmc

Reviewed By: {hellohuanlin}

This change reverts the following previous change:
Reland of #143002, which was reverted in #148237 due to unresolved docs references. Not sure why those weren't caught in presubmit.

```
dartdoc:stdout: Generating docs for package flutter...
dartdoc:stderr:   error: unresolved doc reference [TextInput.showSystemContextMenu]
dartdoc:stderr:     from widgets.MediaQueryData.supportsShowingSystemContextMenu: (file:///b/s/w/ir/x/w/flutter/packages/flutter/lib/src/widgets/media_query.dart:579:14)
dartdoc:stderr:     in documentation inherited from widgets.MediaQueryData.supportsShowingSystemContextMenu: (file:///b/s/w/ir/x/w/flutter/packages/flutter/lib/src/widgets/media_query.dart:579:14)
dartdoc:stderr:   error: unresolved doc reference [showSystemContextMenu]
dartdoc:stderr:     from services.SystemContextMenuController.hide: (file:///b/s/w/ir/x/w/flutter/packages/flutter/lib/src/services/text_input.dart:2554:16)
dartdoc:stderr:   error: unresolved doc reference [hideSystemContextMenu]
dartdoc:stderr:     from services.SystemContextMenuController.show: (file:///b/s/w/ir/x/w/flutter/packages/flutter/lib/src/services/text_input.dart:2509:16)
```
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 14, 2024
flutter/flutter@1255435...d2da1b2

2024-05-14 [email protected] Roll Flutter Engine from 491f460a25fb to 7bf865774d06 (1 revision) (flutter/flutter#148325)
2024-05-14 [email protected] Roll Packages from 1412041 to fd714bd (1 revision) (flutter/flutter#148324)
2024-05-14 [email protected] Roll Flutter Engine from c381b852605f to 491f460a25fb (1 revision) (flutter/flutter#148319)
2024-05-14 [email protected] Roll Flutter Engine from b4b798d2e706 to c381b852605f (1 revision) (flutter/flutter#148303)
2024-05-14 [email protected] Roll Flutter Engine from 0de6701b537a to b4b798d2e706 (2 revisions) (flutter/flutter#148299)
2024-05-14 [email protected] Roll Flutter Engine from 764c33c3c773 to 0de6701b537a (2 revisions) (flutter/flutter#148297)
2024-05-14 [email protected] Roll Flutter Engine from 797eab742925 to 764c33c3c773 (1 revision) (flutter/flutter#148290)
2024-05-14 [email protected] Roll Flutter Engine from 84687fe0f199 to 797eab742925 (1 revision) (flutter/flutter#148288)
2024-05-14 [email protected] Roll Flutter Engine from bee398d95abe to 84687fe0f199 (3 revisions) (flutter/flutter#148282)
2024-05-14 [email protected] Roll Flutter Engine from a1cdcb6a6687 to bee398d95abe (2 revisions) (flutter/flutter#148280)
2024-05-14 [email protected] Roll Flutter Engine from 13a561cb6d5a to a1cdcb6a6687 (1 revision) (flutter/flutter#148276)
2024-05-14 [email protected] Roll Flutter Engine from 7dcbd93e5c1a to 13a561cb6d5a (6 revisions) (flutter/flutter#148274)
2024-05-13 [email protected] Roll Flutter Engine from aeff9b174c84 to 7dcbd93e5c1a (1 revision) (flutter/flutter#148266)
2024-05-13 [email protected] Mark platform_views_scroll_perf_ad_banners__timeline_summary not flaky (flutter/flutter#148263)
2024-05-13 [email protected] add more print traces in hot runner workflow (flutter/flutter#148258)
2024-05-13 [email protected] Refactors page API (flutter/flutter#137792)
2024-05-13 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.3 to 3.25.5 (flutter/flutter#148262)
2024-05-13 [email protected] Roll Flutter Engine from 11502404a52a to aeff9b174c84 (2 revisions) (flutter/flutter#148260)
2024-05-13 [email protected] Use super.key instead of manually passing the Key parameter to the parent class (flutter/flutter#147621)
2024-05-13 [email protected] Try fix module test (flutter/flutter#147934)
2024-05-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland Native ios context menu (#143002) (#148238)" (flutter/flutter#148254)
2024-05-13 [email protected] Reland Native ios context menu (#143002) (flutter/flutter#148238)
2024-05-13 [email protected] Roll Flutter Engine from 636374fd00ee to 11502404a52a (1 revision) (flutter/flutter#148242)
2024-05-13 [email protected] Roll Packages from 6c4482a to 1412041 (16 revisions) (flutter/flutter#148239)
2024-05-13 [email protected] Roll Flutter Engine from 0050bf9a8094 to 636374fd00ee (1 revision) (flutter/flutter#148216)
2024-05-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Native ios context menu (#143002)" (flutter/flutter#148237)

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 [email protected],[email protected] 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
auto-submit bot pushed a commit that referenced this pull request May 15, 2024
Reverting #148238 which was relanded in #148237 which was originally from #143002.

This time post-submit I saw a failure of a wasm version of a test added by this PR.
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
flutter/flutter@1255435...d2da1b2

2024-05-14 [email protected] Roll Flutter Engine from 491f460a25fb to 7bf865774d06 (1 revision) (flutter/flutter#148325)
2024-05-14 [email protected] Roll Packages from 1412041 to fd714bd (1 revision) (flutter/flutter#148324)
2024-05-14 [email protected] Roll Flutter Engine from c381b852605f to 491f460a25fb (1 revision) (flutter/flutter#148319)
2024-05-14 [email protected] Roll Flutter Engine from b4b798d2e706 to c381b852605f (1 revision) (flutter/flutter#148303)
2024-05-14 [email protected] Roll Flutter Engine from 0de6701b537a to b4b798d2e706 (2 revisions) (flutter/flutter#148299)
2024-05-14 [email protected] Roll Flutter Engine from 764c33c3c773 to 0de6701b537a (2 revisions) (flutter/flutter#148297)
2024-05-14 [email protected] Roll Flutter Engine from 797eab742925 to 764c33c3c773 (1 revision) (flutter/flutter#148290)
2024-05-14 [email protected] Roll Flutter Engine from 84687fe0f199 to 797eab742925 (1 revision) (flutter/flutter#148288)
2024-05-14 [email protected] Roll Flutter Engine from bee398d95abe to 84687fe0f199 (3 revisions) (flutter/flutter#148282)
2024-05-14 [email protected] Roll Flutter Engine from a1cdcb6a6687 to bee398d95abe (2 revisions) (flutter/flutter#148280)
2024-05-14 [email protected] Roll Flutter Engine from 13a561cb6d5a to a1cdcb6a6687 (1 revision) (flutter/flutter#148276)
2024-05-14 [email protected] Roll Flutter Engine from 7dcbd93e5c1a to 13a561cb6d5a (6 revisions) (flutter/flutter#148274)
2024-05-13 [email protected] Roll Flutter Engine from aeff9b174c84 to 7dcbd93e5c1a (1 revision) (flutter/flutter#148266)
2024-05-13 [email protected] Mark platform_views_scroll_perf_ad_banners__timeline_summary not flaky (flutter/flutter#148263)
2024-05-13 [email protected] add more print traces in hot runner workflow (flutter/flutter#148258)
2024-05-13 [email protected] Refactors page API (flutter/flutter#137792)
2024-05-13 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.3 to 3.25.5 (flutter/flutter#148262)
2024-05-13 [email protected] Roll Flutter Engine from 11502404a52a to aeff9b174c84 (2 revisions) (flutter/flutter#148260)
2024-05-13 [email protected] Use super.key instead of manually passing the Key parameter to the parent class (flutter/flutter#147621)
2024-05-13 [email protected] Try fix module test (flutter/flutter#147934)
2024-05-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Reland Native ios context menu (#143002) (#148238)" (flutter/flutter#148254)
2024-05-13 [email protected] Reland Native ios context menu (#143002) (flutter/flutter#148238)
2024-05-13 [email protected] Roll Flutter Engine from 636374fd00ee to 11502404a52a (1 revision) (flutter/flutter#148242)
2024-05-13 [email protected] Roll Packages from 6c4482a to 1412041 (16 revisions) (flutter/flutter#148239)
2024-05-13 [email protected] Roll Flutter Engine from 0050bf9a8094 to 636374fd00ee (1 revision) (flutter/flutter#148216)
2024-05-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Native ios context menu (#143002)" (flutter/flutter#148237)

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 [email protected],[email protected] 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests a: text input Entering text in a text field or keyboard related problems d: api docs Issues with https://api.flutter.dev/ d: examples Sample code and demos framework flutter/packages/flutter repository. See also f: labels. revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants