Repository navigation
Open mousse:// links on the phone: chips in messages, in-app navigation, links from outside the app - #50
Merged
Conversation
…on, links from outside the app
TheAnimatrix
force-pushed
the
phone-links
branch
from
December 1, 2026 06:02
7b4ac60 to
276e5b7
Compare
TheAnimatrix
marked this pull request as ready for review
December 1, 2026 06:08
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.
On 0.1.3, a
mousse://thread/…link in a reply was a few coloured words that did nothing when tapped (checked on real data, this PC's Mousse paired with an emulator running a release-path build). A baremousse://thread/<id>was plain text. A link opened from outside the app only handledmousse://pair. The cause: the Markdown readers only madehttp(s)links tappable, and the link code from #32 only ran on the bot panel's rows and the demo's sample data.This PR makes every
mousse://link a place in the app.One grammar in the core (
core/src/links.rs, tests inlinks_tests.rs). It covers all of desktop's forms:mousse://thread/<id>,mousse://thread/<node>:<id>,mousse://bot/<id>(mentions,[@Name](mousse://bot/…)),mousse://bot/<id>/message/<id>,mousse://pair…#<ticket>, and anything else undermousse://(for examplemousse://net/join?…). It reads Markdown links,<…>and bare addresses, and skips code. Ids, node ids, length and characters are checked strictly. Reading a link never does anything but name a place.docs/phone-links.mdlists desktop's grammar with file references.Lookup by id (
core/src/thread_peek.rs). A linked thread the home doesn't list (a hidden one, a subagent, an archived one) is fetched withrouted.thread.snapshotwithout the transcript, from the computer the link names, or from every paired computer. It is asked one at a time and retried on Busy (desktop limits a device's parallel snapshots). Answers are kept for 20 seconds, 128 at most. Desktop'sthread_not_found(fromOwnerRoutes) reads as "can't open here", not as a failure.One link component per platform. Android draws a chip in the line of text (
android/ui/…/LinkChip.kt). iOS draws chips under the message, because SwiftUI text can't hold a button (ios/MousseUI/…/LinkChip.swift). A thread chip shows the thread's title and its live state (Working, Needs you, Paused, Archived). A thread the phone can't open says why: Can't open here, Other computer, or Offline. The chips are a full line tall. A long press offers Open, Copy link and Share.Opening (
MessageLinks.kt/MessageLinks.swift). A thread opens over the screen it was tapped on, and Back returns there. A bot link opens that bot's chat, and a pairing link opens pairing. Any link the phone can't open shows a short note with the address and Copy link, and never reaches the browser.From outside the app. Android's intent filter takes
mousse://thread,mousse://botandmousse://pair, and iOS already registersmousse. The core checks the address first. A pairing link opens pairing. A thread or bot link waits until the home is up (it also works from a cold start), and while a computer is still connecting the lookup waits up to 6 seconds.Needs desktop changes (written up in
docs/phone-links.md, desktop not changed here):thread_not_found(OwnerRoutes.sharedThread). A bot-level read route and distinct refusal codes are needed.net.info), so anod_…:<id>link is resolved by asking every paired computer for the id.Coordinates with M20 (message rows) and M25 (composer). The change stays in the link parser, the link component and navigation. Markdown files gain only the call sites.
Checks
links_tests.rsfor every form and malformed ids/node ids/lengths/characters), Android (build +MarkdownParserTest), iOS (build +check-markdown.swift): green.adb shell am start -a VIEW -d mousse://…), warm and cold start: a thread link opens that thread once the home is up; a pairing link opens pairing.Review
One independent review found 14 issues; 12 are fixed in the last commit:
$pendingsends before it stores). It now uses the value it receives.<…>pairing address is plain text on both platforms, as in the core.)ends an address,](without[isn't a link, an address inside a word isn't one, and an address in a link's own words is its label.Left as is: a pairing link from outside replacing a pairing preview already on screen (as before this PR; the person still confirms before anything joins), and iOS putting an outside link's thread in place of the screens already open (iOS's home holds one screen above it).
A re-check of those fixes found three Android navigation edge cases they caused, and one parser mismatch. All four are fixed in the next commit:
_.