Skip to content

Make links in Remotes messages open on a tap - #158

Merged
simonhamp merged 1 commit into
NativePHP:mainfrom
mdeloughry:fix/remotes-message-links
Nov 3, 2026
Merged

simonhamp merged 1 commit into
NativePHP:mainfrom
mdeloughry:fix/remotes-message-links

Conversation

@mdeloughry

Copy link
Copy Markdown
Contributor

Links in Remotes messages were drawn as plain text. The shared message-body partial handled mentions, inline code and hex colours, but had no branch for BodyRun::$link, so a URL fell through to a plain text run with no tap handler. That left the links in pinned messages, and in normal thread messages, unclickable.

This adds a links() list to Message (the same shape as commits and scheduled commits), a Conversation::openMessageLink($id, $index) action that opens dev/null pages in the app and everything else in the in-app browser, and link runs in message-body. A named dev/null or GitHub link keeps its muted owner prefix, as a commit's does. On your own lane a link uses the lane's label colour so it reads on the coloured bubble, where Commit Blue would not.

Long pinned messages now draw their three-line preview through the same link-aware body, capped with PinnedLines, so links work before Show more. The preview draws the first block, which keeps the three-line cap without leaking later blocks past it.

Worth a look

  • A link on your own lane is the lane's label colour rather than Commit Blue, so it stays legible on the coloured bubble. Named links keep the owner's prefix muted.
  • A message that is still being pushed has no id yet, so its links are pressable but do nothing until it has been pushed.
  • The folded preview of a long pinned message now draws its first block (code in mono, a quote without its rule) rather than the raw body with its markers.

Testing

New Native::test() coverage: a normal message with a browser link, a dev/null profile link and a commit link; and a pinned message link from the sheet and from its three-line preview, so the preview keeps both the cap and the tap.

ConversationTest is 86 passed with 9 pre-existing failures in this environment (the missing nativephp/mobile-clipboard plugin's BindingResolutionException on Copy text, plus four pin/toast assertions); none of them involve links. Pint passes.

Tried on an iPhone 16 simulator (iOS 18.6) and an Android 15 emulator, in light and dark: the pinned link opens the in-app browser on both. The Android emulator had no SDK on this machine and was set up from scratch for this.

Screenshots

remotes

iOS light iOS dark Android light Android dark
Before
After

@mdeloughry
mdeloughry marked this pull request as ready for review November 3, 2026 22:21
@simonhamp

Copy link
Copy Markdown
Member

looks good! nice work

@simonhamp
simonhamp merged commit 1f00fe7 into NativePHP:main Nov 3, 2026
3 checks passed
@mdeloughry
mdeloughry deleted the fix/remotes-message-links branch November 4, 2026 08:27
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.

2 participants