镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

iOS: Follow Mac mode — render the Mac's live session on the phone - #125

Open
skobylite wants to merge 1 commit into
f:masterfrom
skobylite:pr/ios-follow-mac
Open

skobylite wants to merge 1 commit into
f:masterfrom
skobylite:pr/ios-follow-mac

Conversation

@skobylite

Copy link
Copy Markdown
Contributor

Summary

The iOS app has no way to get a script from the Mac. This adds a fourth follow mode, Follow Mac, that consumes the feed the Mac already broadcasts for the browser Remote Connection and renders it in the native prompter:

  • Connect by scanning the QR code from the Mac's Settings → Remote (new MacQRScannerView, AVCaptureMetadataOutput), or by typing host:port. The address is remembered.
  • MacFollower opens a URLSessionWebSocketTask to httpPort + 1 and decodes the existing BrowserState JSON (words, highlightedCharCount, isActive, …). The Mac's microphone does the word tracking; the phone only draws.
  • The session uses the Mac's words.joined(" ") as its script, so character offsets line up with the Mac's counts. Mirror, column and reading position all apply natively.
  • Reconnects with backoff on drops; clear status text throughout (Connecting… / Following the Mac / Mac is paused / Lost the Mac…).
  • No speech or microphone setup runs in this mode. Manual scroll is a peek only — position is owned by the Mac.
  • Adds NSLocalNetworkUsageDescription to the iOS Info.plist, which iOS requires for the local socket.

No Mac-side changes: the QR code and WebSocket are exactly what the browser remote uses today.

Known limitation: if the Mac changes page mid-session the phone keeps the original script; leave and re-enter the session to pick up the new one.

⚠️ Testing status

Written without Xcode. MacFollower.swift type-checks against the macOS SDK (it is Foundation/Observation only) and every touched file passes swiftc -parse, but the UI and the on-device end-to-end flow have not been compiled against the iOS SDK or run. Please build and try it against a Mac with Remote Connection on before merging; happy to fix anything that turns up.

🤖 Generated with Claude Code

Adds a fourth follow mode that connects to Textream on the Mac over the
Remote Connection WebSocket (httpPort + 1) and renders its script and
word-by-word highlighting in the native prompter. The Mac's microphone
does the tracking; the phone only draws, so mirror, column and reading
position all apply natively.

Connect by scanning the QR code from the Mac's Settings → Remote, or by
typing host:port. The address is remembered. Reconnects with backoff when
the link drops. Requires NSLocalNetworkUsageDescription on iOS.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

2 participants