Repository navigation
fix(mobile): link URLs with ports, single-label hosts and fuller paths - #933
Merged
Merged
Conversation
Chat text such as http://localhost:3000/path or http://devbox/x was left as plain text on mobile because the bundled md4c parser requires a dotted host and stops at ':'. Scheme URLs now link with one host label, an optional port, and the usual path, query and fragment punctuation. Trailing sentence punctuation stays outside the link, while a trailing underscore or tilde stays inside it. www and e-mail autolinks still require a dotted host. pnpm resolves react-native-nitro-markdown to the registry 0.5.8 build, so the upstream patch applies as is. Pylon's native rendering and selection module is unchanged. Adopted from upstream fe6388f01d5ae9f9db43079c6f5b2c31869067ca (#13795) and 81e0491d2bdec153bf1ee12d4e1deab3909b7428 (#13807).
Contributor
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Problem
On mobile, URLs like
http://localhost:3000/path,http://devbox/xorhttps://example.com:8443/a?b=c:din chat text were not tappable. The md4c parser bundled inreact-native-nitro-markdownrequires a dotted host for autolinks, stops at:, and accepts only a small set of path, query and fragment characters.Fix
Add upstream's pnpm patch for
react-native-nitro-markdown@0.5.8. Scheme URLs now link with a single host label, an optional numeric port, and the common path / query / fragment punctuation. A trailing run of sentence punctuation (?!.,:*) stays outside the link; a trailing_or~stays inside it.www.and e-mail autolinks still require a dotted host.Sources
fe6388f01d5ae9f9db43079c6f5b2c31869067ca81e0491d2bdec153bf1ee12d4e1deab3909b7428Which package Pylon actually builds
The earlier review note for these sources assumed Pylon builds from
apps/mobile/deps/react-native-nitro-markdown-0.5.0.tgz. It does not:apps/mobile/package.jsonlists that tarball under a package-leveloverrideskey, which pnpm ignores (only npm reads it; the workspaceoverridesinpnpm-workspace.yamlhas no entry for this package).pnpm-lock.yamlresolvesreact-native-nitro-markdown^0.5.0to the registry0.5.8, andapps/mobile/node_modules/react-native-nitro-markdownis that build. Itsmd4c.cdiffers from the tarball's (the tarball carries extra LaTeX delimiter code).0.5.8the same way.So the upstream patch file applies unchanged and no tarball rebuild is needed. The tarball and the npm-only override are left untouched; whether to delete them is a separate cleanup.
Pylon adaptations
None to the patch. The lockfile change is limited to the five lines that carry the new patch hash. Pylon's native rendering and selection module (
apps/mobile/modules/t3-markdown-text) is unchanged; it consumes the parser's link nodes.Verification
vp i --frozen-lockfileaccepted the lockfile, and the installedcpp/md4c/md4c.ccontains the patch.md4c.cwith the flags the library uses and compared it with the unpatched file over 12 inputs. Newly linked:http://localhost:3000/path,http://devbox/x,https://example.com:8443/a?b=c:d#frag:1,http://127.0.0.1:5173/?token=a.b~c,https://example.com/a(b)c:d@e!f,g;h%20,https://example.com/foo_,https://example.com/x~. Unchanged:https://example.com/a...links ashttps://example.com/a,https://example.com.drops the full stop,www.localhostandme@localhoststay plain text, emphasis and strikethrough around a URL still resolve.vp test run apps/mobile/src/lib/nativeMarkdownText.test.ts: 63 tests passed.Limits
Refs #865.
Model: Claude Opus 5.5. Harness: Claude Code in Pylon. Workflow: review-t3-upstream skill.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.