Skip to content

Conversation

@janbrasna
Copy link
Contributor

📜 Tickets

Jira ticket FXIOS-14663
GitHub issue #31698

💡 Description

To offer previewing the actual destination URL query instead of loading the URL itself, to match some other browsers the tradeoffs in the real estate can be tied to the preference to show the page preview render or not — to have at least some idea about the target links when previews are disabled, or for users who want to verify the URL first before loading it. (This would also resolve #27090 and close #27719)

The default is not impacted, this only changes the link context menu title for users who deliberately disable loading the previews in settings.

🎥 Demos

Before After
Image Image

This would only show full URL when preview is disabled; by default with preview enabled it's still the short version:

Previews enabled (default) Previews disabled (preference)
Image Image

📝 Checklist

  • I filled in the ticket numbers and a description of my work
  • I updated the PR name to follow our PR naming guidelines
  • I ensured unit tests pass and wrote tests for new code
  • If working on UI, I checked and implemented accessibility (Dynamic Text and VoiceOver)
  • If needed, I updated documentation and added comments to complex code

@janbrasna janbrasna requested a review from a team as a code owner January 17, 2026 15:13
@janbrasna janbrasna requested a review from Cramsden January 17, 2026 15:13
Copy link
Collaborator

@FilippoZazzeroni FilippoZazzeroni left a comment

Choose a reason for hiding this comment

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

LGTM @janbrasna thanks for bringing this up 😃

Copy link
Contributor Author

@janbrasna janbrasna left a comment

Choose a reason for hiding this comment

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

Adding some corner cases for paper trail — these were the reasons only the normalized domain ended up used for the casual user in the first place.

But for those who prefer to know the destination instead of triggering the preview this might be actually still practical, over… well, not knowing:

Comment on lines 224 to 234
let showPreview = self.profile.prefs.boolForKey(PrefsKeys.ContextMenuShowLinkPreviews) ?? true
let urlTitle = !showPreview ? url.absoluteString : (url.normalizedHost ?? url.absoluteString)

let actions = createActions(isPrivate: isPrivate,
url: url,
addTab: self.addTab,
title: elements.title,
image: elements.image,
currentTab: currentTab,
webView: webView)
return UIMenu(title: url.normalizedHost ?? url.absoluteString, children: actions)
return UIMenu(title: urlTitle, children: actions)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not unlike Focus, the title is left for the UIMenu API/SDK to handle, and truncate and size the component as needed. This still provides some compromise between surfacing as much of the link content with still having reasonable affordance of the context menu items — I've picked some "worst case" examples as the corner case, when the menu items overflow and get clipped and scrollable:

Screenshot 2026-01-17 at 17 31 52 Screenshot 2026-01-17 at 17 34 32 Screenshot 2026-01-17 at 17 35 31
Screenshot 2026-01-17 at 17 08 11 Screenshot 2026-01-17 at 17 08 28

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps a video would show the affordance in those worst examples:

Simulator.Screen.Recording.-.iPad.mini.A17.Pro.-.2026-01-17.at.17.06.07.mov

or depending on the distance between the edges some of the most crammed ones:

Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-01-17.at.17.34.01.mov

but it kinda feels right, esp. for some of those UUID–like links hashing content, like on G SERP outbound links or Amazon product links carrying over random tracking/session crud — if people need to inspect what they're about to click this feels appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Press-hold link URL preview no longer shows entire URL (enables phishing exploits) Enable viewing full URL on long-press preview/menu

2 participants