Repository navigation
Conversation
|
Thanks for working on this! This is a useful improvement. |
meh7an
force-pushed
the
feature/open-links-in-fields
branch
from
October 10, 2026 11:14
1c8d739 to
27b4465
Compare
meh7an
force-pushed
the
feature/open-links-in-fields
branch
from
October 10, 2026 11:32
27b4465 to
89fbba8
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Needs desktop-app/lib_ui#383.
Links typed or formatted in the message field, in captions, while editing a message or in the article editor can't be opened from there; the context menu only offers to edit them. Most editors open a link on Ctrl+click (Cmd+click on macOS), and the message fields now do the same through the new open link callback of the lib_ui input field. While Ctrl is held over a link, the link is underlined and the cursor becomes a pointer, so it's clear what the click will open.
Links that open inside the app (a chat, a profile, a hashtag search, t.me links) are only enabled where the typed text survives the navigation: the message field, including editing, the topic, comments, scheduled and business message fields, which keep their draft, and the article editor, which has its own window. There they open text links, plain URLs and emails, usernames, mentions picked by name and hashtags the same way they open in messages. Every other field, like captions, poll and todo fields, share and forward comments, gift messages, folder names and story replies, lives in a box or the media viewer that such a navigation would close together with what was typed, so it only opens web links and emails, and opens Instant View pages in the browser.
DefaultOpenLinkCallback()takes these asOpenLinkOptions, and the check follows the URL the click really opens, so Telegram links with login tokens or long t.me links aren't let through.Hidden text links and suspicious-looking URLs still show the "Open this link?" box with the real address. Ctrl+click skips it in messages, but in a field Ctrl is the only way to open a link, so the new
ClickHandlerContext::ctrlRequiredkeeps the confirmation, andHiddenUrlClickHandlerkeeps confirming telegra.ph pages when Instant View isn't tried. In story replies, the video chat message field and dark share boxes the box uses the dark label style.Testing
Tested on macOS 27.0, in a Debug build:
https://example.com/❤️/guideand a text link with an emoji in its label are underlined and opened as a whole.