Skip to content

Link URLs in commits and replies, as the web does - #28

Merged
simonhamp merged 1 commit into
mainfrom
feat/linked-urls
Oct 20, 2026
Merged

simonhamp merged 1 commit into
mainfrom
feat/linked-urls

Conversation

@simonhamp

Copy link
Copy Markdown
Member

URLs in commits and replies are now links, the way the web draws them. Before this they were plain text.

What changed

  • BodyLink finds URLs and bare domains with the web's rules, ported from linkified-text.tsx and the server's Urls.php: the same pattern, TLD allowlist and trailing punctuation handling. It decides how each link shows:
    • a dev/null commit as its author and short hash (Matildevoldsen/7548df5), opening that commit in the app
    • a GitHub repository, issue or pull request as GitHub writes it (laravel/framework#42), opening in the in-app browser
    • anything else shortened like the web (example.com/a-long-path-to-the…), opening in the in-app browser
  • CommitBody splits prose around links before it places mentions and the wordmark, as the web does. That also closes the gap Draw /dev/null as the wordmark in commits and replies #20 mentioned: /dev/null inside a URL now stays part of the link.
  • The body partial draws links in Commit Blue. Commit and GitHub links are mono with the owner muted, like the web. A word joiner after the slash keeps one on a single line.
  • ShowsCommits::openLink($id, $index) opens a link by its place among the body's links, the same way openImage() works. Passing URLs through @press arguments would have been fragile. The server cuts previews at a space, so a folded commit's links are always the first ones of the whole body.

Worth checking

  • The web puts the dev/null mark or the GitHub icon before named links. EDGE text runs can't hold an icon, so the app leaves them out.
  • Quoted commits still show plain text, as before. The web's static quote shortens URLs there, but that card isn't drawn from runs.
  • VoiceOver reads a link as what it shows, so a shortened URL reads shortened. The web keeps the whole URL in hidden text for screen readers, and there's no way to do that in a composed text run.

Screenshots

Tom's reply on dev-null.sh next to the same text in the app, then the other kinds of link:

Web, light App, light Web, dark App, dark
Light Dark

On an iPhone 17 Pro simulator (iOS 27), tapping a commit link opened that commit, and tapping the shortened URL and a GitHub link opened each in the in-app browser.

Testing

1002 tests pass and Pint is clean. The web's link tests from tests/Unit/LinkifiedText.test.tsx are ported to CommitBodyTest: shortening, punctuation, bare domains, commit links, GitHub repositories, issues and pull requests, and the links that should stay plain URLs. A Log test checks the drawn runs and that each link opens the right thing. paragraphRuns() in tests/Pest.php now tells links from mentions.

🤖 Generated with Claude Code

A URL or bare domain in a commit or reply is now a link in Commit Blue,
found with the web's rules from linkified-text.tsx and the server's
Urls.php. It shows shortened the way the web shows it. A dev/null commit
shows as its author and short hash and opens in the app. A GitHub
repository, issue or pull request shows as GitHub writes it. Everything
else opens in the in-app browser.

The web puts a dev/null or GitHub icon before those named links. Text
runs can't hold an icon, so the app leaves it out.

URLs are split out before mentions and the wordmark, as on the web, so a
/dev/null inside a URL now stays part of the link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp merged commit 9ee7fc7 into main Oct 20, 2026
1 check passed
@simonhamp
simonhamp deleted the feat/linked-urls branch October 20, 2026 01:04
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.

1 participant