Repository navigation
Show hex colors with a swatch, as the web does - #89
Merged
Merged
Conversation
A hex color in a commit or a remote, like #ff8a4c or #fff, now draws after a square of that color, as on the web since dev-null-sh/dev-null.sh#1064. It uses the web's rule: 3, 4, 6 or 8 hex digits, where 3 or 4 digits need a letter or a leading zero so #123 stays an issue number, as a whole word, and never inside code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sonalidudhia
marked this pull request as ready for review
October 26, 2026 09:01
The merge from main brought in the quote splitter from NativePHP#88, which rebuilds every prose run as plain text. It didn't know about color runs, so every swatch was lost. Color runs now pass through untouched, the same as mentions, links and wordmarks. Also puts back the docblock lines the conflict resolution clipped in CommitBody and the message body partial. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Cool! |
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.
A hex color in a commit or a remote, like
#ff8a4cor#fff, now shows after a square of that color, as on the web since dev-null-sh/dev-null.sh#1064. That PR notes the mobile app doesn't show swatches yet and would need its own copy of the rule, so this is that copy.CommitBodyfinds colors with the web's rule fromcolors.ts: 3, 4, 6 or 8 hex digits, where 3 or 4 digits need a letter or a leading zero so#123stays an issue number while#000is black. A color is a whole word: it starts a line, follows whitespace or a quoted line's>, and only punctuation may follow it before the next space. Code is blanked out first, so nothing in it counts.BodyRungets acolor, and commits (log, detail, replies, composer preview) and remotes draw it as a■in that color before the value, held to it by a narrow no-break space so they wrap together.Tests port the web's cases (issue numbers, whole words, quoted lines, code, URL fragments, 4- and 8-digit values), and a screen test checks the square's light and dark color.
Limitation: a color the same as the background, like
#fffin light mode, gets a square you can't see. The web draws a 1px border around its swatch, which a text run can't have. Happy to change the approach if there's a better native primitive for this.This branch and #88 both touch
CommitBodyand the body views, so whichever lands second needs a small merge.Screenshots
The composer preview of a draft, so nothing was posted. iOS only for now: I'll add Android before marking this ready.
composer-preview