Skip to content

Conversation

crazytonyli
Copy link
Contributor

Note

This PR is built on top of #24871, and will be merged after that.

Description

My understanding is that the delegate function that uses UITextItemInteraction was split into two methods: the primaryActionFor one and the menuConfigurationFor one.

We need to return a UIAction in the primaryActionFor delegate method. And, where the original function returns false, we now need to return nil in the menuConfigurationFor delegate method.

Testing instructions

@crazytonyli crazytonyli added this to the 26.4 milestone Sep 22, 2025
@crazytonyli crazytonyli requested a review from kean September 22, 2025 08:55
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 22, 2025

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number29140
VersionPR #24872
Bundle IDorg.wordpress.alpha
Commit24f497d
Installation URL24j06f51nbiqg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Sep 22, 2025

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number29140
VersionPR #24872
Bundle IDcom.jetpack.alpha
Commit24f497d
Installation URL6ekfrubh5ld1o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Base automatically changed from bump-deployment-target to trunk September 22, 2025 12:14
@crazytonyli crazytonyli force-pushed the deprecated-api-textinteraction branch from 2233d00 to 24f497d Compare September 22, 2025 21:34
Copy link

@kean
Copy link
Contributor

kean commented Sep 22, 2025

I ran out of time today – I'll review and test it tomorrow morning.

This PR is built on top of #24871, an

It would be nice to remove the now redundant code under available(iOS 17

@crazytonyli
Copy link
Contributor Author

It would be nice to remove the now redundant code under available(iOS 17

Good call. I'll do that.

}

func textView(_ textView: UITextView, menuConfigurationFor textItem: UITextItem, defaultMenu: UIMenu) -> UITextItem.MenuConfiguration? {
if case .link = textItem.content {
Copy link
Contributor

Choose a reason for hiding this comment

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

Were you able to get these menus to work? I'm long-pressing on the links in notifications, and func textView(_ textView: UITextView, menuConfigurationFor textItem: UITextItem, defaultMenu: UIMenu) -> UITextItem.MenuConfiguration? { doesn't seem to be called, and it shows the standard menu instead of the URL-related menu. I'm not sure if it's a regression from the PR or something else.

Screen.Recording.2025-09-23.at.3.20.33.PM.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The trunk branch also behaves like that. The original deprecated function is also not called when long-pressing on links. I think that may have something to do with the RichTextView type.

@kean
Copy link
Contributor

kean commented Oct 1, 2025

Let's merge this targeting 26.5, reducing the affected areas for 26.4.

@kean kean modified the milestones: 26.4, 26.5 Oct 1, 2025
@kean kean self-requested a review October 7, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants