Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Jan 12, 2024

Description

This PR adds the share button to text selection toolbar buttons on Android and iOS for SelectableRegion (and therefore SelectionArea).

#139479 adds this button for EditableText (which is used by TextField and SelectableText but not by SelectionArea).

Edit: supporting this on iOS will need more work (see #141447 (comment) and #141775).

Related Issue

Follow up for #138728

Tests

Adds 1 test.

@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. f: material design flutter/packages/flutter/material repository. f: cupertino flutter/packages/flutter/cupertino repository labels Jan 12, 2024
@bleroux bleroux requested a review from justinmc January 12, 2024 18:55
@ueman
Copy link
Contributor

ueman commented Jan 12, 2024

Does this work on an iPad? The share functionality on the iPad needs an anchor for the share popup. For the textfield it works because it's backed on iOS with an invisible native text field, which I assume is not the case for text selection.

@bleroux
Copy link
Contributor Author

bleroux commented Jan 15, 2024

Very good point @ueman 👍
@justinmc As a follow up to #138728, do you think it would be wiser that I made this PR Android only?
The iOS side will need more work, probably some on the engine side (similar to flutter/engine#48427).

@ueman
Copy link
Contributor

ueman commented Jan 16, 2024

I think long term, the framework needs to pass the anchor to the engine. Otherwise, people will keep repeating that mistake since it's really not that obvious 😕

@bleroux bleroux force-pushed the add_share_button_to_selection_toolbar_for_selectable_region branch from cf9ea15 to 6cb7e65 Compare January 18, 2024 13:42
@bleroux bleroux changed the title Add Share button to the SelectableRegion toolbar on Android and iOS Add Share button to the SelectableRegion toolbar on Android Jan 18, 2024
@bleroux
Copy link
Contributor Author

bleroux commented Jan 18, 2024

@justinmc I have updated the PR to make it Android only and I filed #141775 to track work on the iOS side.

@bleroux bleroux force-pushed the add_share_button_to_selection_toolbar_for_selectable_region branch from 6cb7e65 to 3f066f5 Compare January 18, 2024 19:06
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consider proposed -> shown.

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: consider making the switch its own variable maybe, platformCanShare.

Copy link
Contributor

Choose a reason for hiding this comment

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

should we only run this test on Android?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this test is Android only on purpose. This is the new test I added.
The Github diff makes it look like I removed the variant line for it, but this is a variant line I updated for another test (see lines 3336-3337).

Testing if the share button is visible on other platforms is done in a test below (lines 3440-3455).
This new test checks the behavior when clicking on the share button (this is why it is Android only).

@bleroux bleroux force-pushed the add_share_button_to_selection_toolbar_for_selectable_region branch from 3f066f5 to b2f06c6 Compare January 23, 2024 09:47
Copy link
Contributor

@Renzo-Olivares Renzo-Olivares left a comment

Choose a reason for hiding this comment

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

LGTM

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 23, 2024
flutter/flutter@3ee8ff2...5b673c2

2024-01-23 [email protected] Roll Flutter Engine from fd0335a910b8 to b229878c57f5 (1 revision) (flutter/flutter#142051)
2024-01-23 [email protected] Remove unused clipBehavior from OverflowBar (flutter/flutter#141976)
2024-01-23 [email protected] Roll Packages from e4cbf23 to 841fe90 (7 revisions) (flutter/flutter#142047)
2024-01-23 [email protected] Roll Flutter Engine from d2855da628da to fd0335a910b8 (1 revision) (flutter/flutter#142046)
2024-01-23 [email protected] Add Share button to the SelectableRegion toolbar on Android (flutter/flutter#141447)
2024-01-23 [email protected] Relax the warning of unavailable tokens in `gen_defaults` when a default value is provided (flutter/flutter#140872)
2024-01-23 [email protected] Roll Flutter Engine from 37f68f6fc7fc to d2855da628da (1 revision) (flutter/flutter#142033)
2024-01-23 [email protected] Roll Flutter Engine from 9e582c9032e5 to 37f68f6fc7fc (1 revision) (flutter/flutter#142027)
2024-01-23 [email protected] Roll Flutter Engine from df6b15d35703 to 9e582c9032e5 (1 revision) (flutter/flutter#142026)
2024-01-23 [email protected] Roll Flutter Engine from d3dbd4225e08 to df6b15d35703 (6 revisions) (flutter/flutter#142023)
2024-01-23 [email protected] Add a comment about how to test flutter_goldens (flutter/flutter#141902)
2024-01-23 [email protected] Enable contextMenuBuilder in the absence of selectionControls (flutter/flutter#141810)
2024-01-23 [email protected] Roll Flutter Engine from b069d7f8f1fd to d3dbd4225e08 (3 revisions) (flutter/flutter#142005)
2024-01-23 98614782+auto-submit[bot]@users.noreply.github.com Reverts "hello_world app: migrate to Gradle Kotlin DSL" (flutter/flutter#142018)
2024-01-22 [email protected] Floating cursor docs (flutter/flutter#133002)
2024-01-22 [email protected] refactor: Rename filterPluginsByPlatform, cleanup Platform Strings (flutter/flutter#141780)
2024-01-22 [email protected] hello_world app: migrate to Gradle Kotlin DSL (flutter/flutter#141541)
2024-01-22 [email protected] Roll Flutter Engine from b2762f410840 to b069d7f8f1fd (4 revisions) (flutter/flutter#141993)
2024-01-22 [email protected] Remove duplicate code as suggested by natebosch. (flutter/flutter#141988)
2024-01-22 [email protected] Revert "Remove hack from PageView." (flutter/flutter#141977)
2024-01-22 [email protected] Roll Flutter Engine from d653559ae183 to b2762f410840 (3 revisions) (flutter/flutter#141978)
2024-01-22 [email protected] Do not hang on test failures of tests within `flutter_tools` (flutter/flutter#141821)
2024-01-22 [email protected] Remove unneeded expectation in test (flutter/flutter#141822)
2024-01-22 [email protected] Roll Flutter Engine from 1efe8ba6bc04 to d653559ae183 (3 revisions) (flutter/flutter#141972)
2024-01-22 [email protected] Add documentation which explains that `debugPrint` also logs in release mode (flutter/flutter#141595)
2024-01-22 [email protected] Fix `RangeSlider` throws a null-check error after `clearSemantics` is called (flutter/flutter#141965)
2024-01-22 [email protected] Roll Flutter Engine from c49989292fc1 to 1efe8ba6bc04 (1 revision) (flutter/flutter#141969)
2024-01-22 [email protected] [web] - Fix broken `TextField` in semantics mode when it's a sibling of `Navigator` (flutter/flutter#138446)

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],[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
@bleroux bleroux deleted the add_share_button_to_selection_toolbar_for_selectable_region branch February 15, 2024 08:20
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 f: cupertino flutter/packages/flutter/cupertino repository f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants