Repository navigation
Link URLs in commits and replies, as the web does - #28
Merged
Merged
Conversation
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>
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.
URLs in commits and replies are now links, the way the web draws them. Before this they were plain text.
What changed
BodyLinkfinds URLs and bare domains with the web's rules, ported fromlinkified-text.tsxand the server'sUrls.php: the same pattern, TLD allowlist and trailing punctuation handling. It decides how each link shows:Matildevoldsen/7548df5), opening that commit in the applaravel/framework#42), opening in the in-app browserexample.com/a-long-path-to-the…), opening in the in-app browserCommitBodysplits 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/nullinside a URL now stays part of the link.ShowsCommits::openLink($id, $index)opens a link by its place among the body's links, the same wayopenImage()works. Passing URLs through@pressarguments 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
Screenshots
Tom's reply on dev-null.sh next to the same text in the app, then the other kinds of link:
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.tsxare ported toCommitBodyTest: 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()intests/Pest.phpnow tells links from mentions.🤖 Generated with Claude Code